Skip to content

Commit

Permalink
Merge pull request #3 from bnb-chain/add_distroless_image
Browse files Browse the repository at this point in the history
distroless image
  • Loading branch information
Rosyya authored Aug 14, 2024
2 parents 4062ed9 + 4f438bb commit c3fd185
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 c3fd185

Please sign in to comment.