9
9
# Red Hat, Inc. - initial API and implementation
10
10
#
11
11
12
- # https://registry.access.redhat.com/rhel9-2-els/rhel
13
- FROM registry.redhat.io/rhel9-2-els/rhel:9.2-1405 as builder
12
+ # https://registry.access.redhat.com/ubi9/go-toolset
13
+ FROM registry.redhat.io/ubi9/go-toolset:1.22.7-1733160835 as builder
14
14
ENV GOPATH=/go/ \
15
15
CGO_ENABLED=1
16
16
USER root
17
17
WORKDIR /che-machine-exec/
18
18
COPY . .
19
19
# to test FIPS compliance, run https://github.com/openshift/check-payload#scan-a-container-or-operator-image against a built image
20
- RUN dnf -y install golang && \
21
- adduser unprivilegeduser && \
20
+ RUN adduser unprivilegeduser && \
22
21
GOOS=linux go build -mod=vendor -a -ldflags '-w -s' -a -installsuffix cgo -o che-machine-exec . && \
23
22
mkdir -p /rootfs/tmp /rootfs/etc /rootfs/go/bin && \
24
23
# In the `scratch` you can't use Dockerfile#RUN, because there is no shell and no standard commands (mkdir and so on).
@@ -27,12 +26,12 @@ RUN dnf -y install golang && \
27
26
cp -rf /etc/passwd /rootfs/etc && \
28
27
cp -rf /che-machine-exec/che-machine-exec /rootfs/go/bin
29
28
30
- # https://registry.access.redhat.com/rhel9-2-els/rhel
31
- FROM registry.redhat.io/rhel9-2-els/rhel :9.2-1405 as runtime
29
+ # https://registry.access.redhat.com/ubi9-minimal
30
+ FROM registry.redhat.io/ubi9-minimal :9.5-1731593028 as runtime
32
31
COPY --from=builder /rootfs /
33
- RUN dnf install -y openssl && \
34
- dnf -y update && \
35
- dnf clean -y all
32
+ RUN microdnf install -y openssl && \
33
+ microdnf -y update && \
34
+ microdnf clean -y all
36
35
37
36
USER unprivilegeduser
38
37
ENTRYPOINT ["/go/bin/che-machine-exec" ]
0 commit comments