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

Docker image nonroot user #119

Merged
merged 2 commits into from
Oct 12, 2023
Merged
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
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ RUN go mod download
ADD . .
RUN make build

FROM alpine:latest
FROM alpine:3.18.3
WORKDIR /fabconnect
COPY --from=fabconnect-builder /fabconnect/fabconnect ./
COPY --from=fabconnect-builder --chown=1001:0 /fabconnect/fabconnect ./

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might not need this one here bc of the permissions of /usr/bin are opened up to other linux users normally

ADD ./openapi ./openapi/
RUN ln -s /fabconnect/fabconnect /usr/bin/fabconnect
RUN chgrp -R 0 /openapi && \
chmod -R g+rwX /openapi
USER 1001
ENTRYPOINT [ "fabconnect" ]