diff --git a/Dockerfile.distroless b/Dockerfile.distroless index 2683b03..c536c6d 100644 --- a/Dockerfile.distroless +++ b/Dockerfile.distroless @@ -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"] \ No newline at end of file +ENV WORKDIR=/home/nonroot +WORKDIR ${WORKDIR} +COPY --from=builder --chown=nonroot:nonroot /gnfd-qa-test-monitor/build/* ${WORKDIR}/ +ENTRYPOINT ["/home/nonroot/monitor"] \ No newline at end of file