File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed
Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -19,16 +19,17 @@ RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-w -s' -a -installsuffix cgo
1919RUN apk add --no-cache ca-certificates
2020
2121RUN adduser -D -g '' unprivilegeduser && \
22- mkdir -p /rootfs/tmp && chmod 1777 /rootfs/tmp
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 in the scratch /tmp folder.
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
2329
2430FROM scratch
2531
26- # In the scratch you can't use Dockerfile#RUN, because there is no shell and no standard commands (mkdir and so on).
27- # Add absent in the scratch /tmp folder.
2832COPY --from=builder /rootfs /
29- COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
30- COPY --from=builder /etc/passwd /etc/passwd
31- COPY --from=builder /go/src/github.com/eclipse/che-machine-exec/che-machine-exec /go/bin/che-machine-exec
3233
3334USER unprivilegeduser
3435
Original file line number Diff line number Diff line change @@ -18,15 +18,17 @@ WORKDIR /go/src/github.com/eclipse/che-machine-exec/
1818COPY . .
1919RUN adduser unprivilegeduser && \
2020 CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-w -s' -a -installsuffix cgo -o che-machine-exec . && \
21- mkdir -p /rootfs/tmp && chmod 1777 /rootfs/tmp
21+ mkdir -p /rootfs/tmp /rootfs/etc /rootfs/go/bin && \
22+ # 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.
24+ chmod 1777 /rootfs/tmp && \
25+ cp -rf /etc/passwd /rootfs/etc && \
26+ cp -rf /go/src/github.com/eclipse/che-machine-exec/che-machine-exec /rootfs/go/bin
2227
2328FROM scratch
2429
25- # In the scratch you can't use Dockerfile#RUN, because there is no shell and no standard commands (mkdir and so on).
26- # Add absent in the scratch /tmp folder.
2730COPY --from=builder /rootfs /
28- COPY --from=builder /etc/passwd /etc/passwd
29- COPY --from=builder /go/src/github.com/eclipse/che-machine-exec/che-machine-exec /go/bin/che-machine-exec
31+
3032USER unprivilegeduser
3133ENTRYPOINT ["/go/bin/che-machine-exec" ]
3234
You can’t perform that action at this time.
0 commit comments