File tree Expand file tree Collapse file tree 6 files changed +12
-185
lines changed
Expand file tree Collapse file tree 6 files changed +12
-185
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,18 @@ COPY . .
1818RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-w -s' -a -installsuffix cgo -o che-machine-exec .
1919RUN apk add --no-cache ca-certificates
2020
21- RUN adduser -D -g '' unprivilegeduser
21+ RUN adduser -D -g '' unprivilegeduser && \
22+ mkdir -p /rootfs/tmp /rootfs/etc /rootfs/etc/ssl/certs /rootfs/go/bin && \
23+ # In the `scratch` you can't use Dockerfile#RUN, because there is no shell and no standard commands (mkdir and so on).
24+ # That's why prepare absent `/tmp` folder for scratch image
25+ chmod 1777 /rootfs/tmp && \
26+ cp -rf /etc/passwd /rootfs/etc && \
27+ cp -rf /etc/ssl/certs/ca-certificates.crt /rootfs/etc/ssl/certs && \
28+ cp -rf /go/src/github.com/eclipse/che-machine-exec/che-machine-exec /rootfs/go/bin
2229
2330FROM scratch
24- COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
25- COPY --from=builder /etc/passwd /etc/passwd
26- COPY --from=builder /go/src/github.com/eclipse/che-machine-exec/che-machine-exec /go/bin/che-machine-exec
31+
32+ COPY --from=builder /rootfs /
2733
2834USER unprivilegeduser
2935
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1010#
1111
1212# https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/rhel8/go-toolset
13- FROM registry.redhat.io/ rhel8/go-toolset:1.11.13-18 as builder
13+ FROM rhel8/go-toolset:1.11.13-18 as builder
1414ENV PATH=/opt/rh/go-toolset-1.11/root/usr/bin:$PATH \
1515 GOPATH=/go/
1616USER root
@@ -20,7 +20,7 @@ RUN adduser unprivilegeduser && \
2020 CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-w -s' -a -installsuffix cgo -o che-machine-exec . && \
2121 mkdir -p /rootfs/tmp /rootfs/etc /rootfs/go/bin && \
2222 # In the `scratch` you can't use Dockerfile#RUN, because there is no shell and no standard commands (mkdir and so on).
23- # That's why prepare absent in the scratch /tmp folder.
23+ # That's why prepare absent `/tmp` folder for scratch image
2424 chmod 1777 /rootfs/tmp && \
2525 cp -rf /etc/passwd /rootfs/etc && \
2626 cp -rf /go/src/github.com/eclipse/che-machine-exec/che-machine-exec /rootfs/go/bin
You can’t perform that action at this time.
0 commit comments