Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix distroless image #5

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions Dockerfile.distroless
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,25 @@ RUN apk add --no-cache gcc libstdc++-dev libc-dev
RUN cd /gnfd-qa-test-monitor \
&& go build -o ./build/monitor main.go

FROM gcr.io/distroless/base-debian11
RUN cd /gnfd-qa-test-monitor/build && pwd && ls -al

# FROM gcr.io/distroless/base-debian11
# ENV WORKDIR=/app
# ARG USER=sp
# ARG USER_UID=1000
# ARG USER_GID=1000

# WORKDIR ${WORKDIR}

# COPY --from=builder /gnfd-qa-test-monitor/build/* ${WORKDIR}/
# RUN chown -R ${USER_UID}:${USER_GID} ${WORKDIR}
# USER ${USER_UID}:${USER_GID}
# RUN cd ${WORKDIR}/ && pwd && ls -al
# ENTRYPOINT ["/app/monitor"]

FROM gcr.io/distroless/base-debian11
USER nonroot:nonroot
WORKDIR /home/nonroot
COPY --from=builder --chown=nonroot:nonroot /gnfd-qa-test-monitor/build/monitor $WORKDIR
ENTRYPOINT ["./monitor"]
ENV WORKDIR=/home/nonroot
WORKDIR ${WORKDIR}
COPY --from=builder --chown=nonroot:nonroot /gnfd-qa-test-monitor/build/* ${WORKDIR}/
ENTRYPOINT ["/home/nonroot/monitor"]
Loading