From 4f438bb05e3625ef60a14f23cc8ed1f570bea10c Mon Sep 17 00:00:00 2001 From: Rosyya Date: Wed, 14 Aug 2024 15:45:59 +0800 Subject: [PATCH] distroless image --- Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index d6d41dd..5179b0b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN cd /gnfd-qa-test-monitor \ && go build -o build/monitor main.go # Pull greenfield into a second stage deploy alpine container -FROM alpine:3.17 +FROM alpine:3.17 AS deploy ARG USER=sp ARG USER_UID=1000 @@ -40,6 +40,10 @@ WORKDIR ${WORKDIR} COPY --from=builder /gnfd-qa-test-monitor/build/* ${WORKDIR}/ RUN chown -R ${USER_UID}:${USER_GID} ${WORKDIR} -USER ${USER_UID}:${USER_GID} -ENTRYPOINT ["/app/monitor"] \ No newline at end of file + +# distroless image. +FROM gcr.io/distroless/static-debian11 +COPY --from=deploy /app/monitor / +USER ${USER_UID}:${USER_GID} +ENTRYPOINT ["/monitor"] \ No newline at end of file