docker-nexus3 icon indicating copy to clipboard operation
docker-nexus3 copied to clipboard

Use numeric uid instead of username in Dockerfiles

Open candrews opened this issue 4 months ago • 0 comments

Systems configured to disallow running images as root aren't able to run images that use a username string value for the USER because they can't validate that a username isn't mapped to uid 0 (root). To allow images to run on such systems, use the uid of the user as the value for USER instead of the username.

This has no downside when running in environments that do not do non-root validation.

See MustRunAsNonRoot at https://kubernetes.io/docs/reference/access-authn-authz/psp-to-pod-security-standards/ and https://github.com/kubernetes/kubernetes/pull/56503

candrews avatar Sep 11 '25 19:09 candrews