Skip to content

Commit

Permalink
distroless image
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosyya committed Aug 14, 2024
1 parent 4062ed9 commit 4f438bb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"]

# distroless image.
FROM gcr.io/distroless/static-debian11
COPY --from=deploy /app/monitor /
USER ${USER_UID}:${USER_GID}
ENTRYPOINT ["/monitor"]

0 comments on commit 4f438bb

Please sign in to comment.