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

Enhancement request: Use deterministic UID/GID in Dockerfile #230

Open
ghsa-retrieval opened this issue Jan 21, 2025 · 0 comments
Open

Enhancement request: Use deterministic UID/GID in Dockerfile #230

ghsa-retrieval opened this issue Jan 21, 2025 · 0 comments
Labels
design needed Design details needed to complete the issue enhancement New feature or request

Comments

@ghsa-retrieval
Copy link

ghsa-retrieval commented Jan 21, 2025

Is your enhancement request related to a problem? Please describe.
The UID and GID in the Dockerfile can change since the user and group are only created by name. This has implications for deployments that rely on identifying the user exactly. For example: Settings for the security context in Kubernetes/Helm charts, such as runAsUser and runAsGroup, cannot be applied, since the UID and GID are not known ahead of time and may change between versions.

What are the benefits of the requested enhancement?
The user and group are no longer assigned a non-deterministic ID. You can set up user namespaces in a predictable way.

Describe the solution you would like
Modify the adduser and addgroup commands in the Dockerfile to use a numerical UID and GID instead of a name. The UID and GID should be ones that are not already occupied by the Python base image.

Additional notes
Using a numerical UID and GID instead of name is also recommended according to Docker: https://docs.docker.com/build/building/best-practices/#user

@ghsa-retrieval ghsa-retrieval added design needed Design details needed to complete the issue enhancement New feature or request labels Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design needed Design details needed to complete the issue enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant