From ef3e6a40f07f4267c89b1c8a1c8b40e477af640a Mon Sep 17 00:00:00 2001 From: Hamcha Date: Fri, 25 Mar 2022 20:47:12 +0100 Subject: [PATCH] Fix fix the dockerfile if you fix you fix otherwise idk --- Dockerfile | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index c2ffbb4..eccd771 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,16 +21,13 @@ RUN CGO_ENABLED=0 go build \ -o /app . # STAGE 2: build the container to run -FROM scratch AS final +FROM gcr.io/distroless/static AS final + LABEL maintainer="gbaeke" -COPY --from=build /app /app +USER nonroot:nonroot -# copy ca certs -COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ - -# copy users from builder (use from=0 for illustration purposes) -COPY --from=0 /etc/passwd /etc/passwd - -USER myapp +# copy compiled app +COPY --from=build --chown=nonroot:nonroot /app /app +# run binary; use vector form ENTRYPOINT ["/app"] \ No newline at end of file