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 all 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
13 changes: 7 additions & 6 deletions build/ferretdb/production.Dockerfile
Expand Up @@ -86,8 +86,9 @@ go build -v -o=bin/ferretdb ./cmd/ferretdb

go version -m bin/ferretdb
bin/ferretdb --version
EOF

mkdir /state
EOF

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

Expand All @@ -100,12 +101,12 @@ COPY --from=production-build /src/bin/ferretdb /ferretdb

FROM scratch AS production

COPY --from=production-build /src/bin/ferretdb /ferretdb
COPY build/ferretdb/passwd /etc/passwd
COPY build/ferretdb/group /etc/group
USER 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 --from=production-build /src/bin/ferretdb /ferretdb
COPY --from=production-build --chown=ferretdb:ferretdb /state /state

ENTRYPOINT [ "/ferretdb" ]

Expand Down