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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use non-privileged scratch for production Docker images #4211

Merged
merged 4 commits into from Mar 26, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions build/ferretdb/production.Dockerfile
Expand Up @@ -88,6 +88,7 @@ go version -m bin/ferretdb
bin/ferretdb --version
EOF

RUN mkdir /state
AlekSi marked this conversation as resolved.
Show resolved Hide resolved

# stage for binary only
rumyantseva marked this conversation as resolved.
Show resolved Hide resolved

Expand All @@ -102,10 +103,11 @@ FROM scratch AS production

COPY --from=production-build /src/bin/ferretdb /ferretdb

# TODO https://github.com/FerretDB/FerretDB/issues/3992
# COPY build/ferretdb/passwd /etc/passwd
# COPY build/ferretdb/group /etc/group
# USER ferretdb:ferretdb
COPY build/ferretdb/passwd /etc/passwd
COPY build/ferretdb/group /etc/group
USER ferretdb:ferretdb

COPY --chown=ferretdb:ferretdb --from=production-build /state /state
AlekSi marked this conversation as resolved.
Show resolved Hide resolved

ENTRYPOINT [ "/ferretdb" ]

Expand Down