-
Notifications
You must be signed in to change notification settings - Fork 313
[docker] Run as non root #5311
Description
Is your feature request related to a problem? Please describe.
Many users enforce policies that docker containers should not run as root user. There should be no reason to run as root by default.
Describe the solution you'd like
Create a user and set USER in Dockerfile.
Additional context
A sample warning from a k8s deploy is like this:
policy require-run-as-nonroot/run-as-non-root fail: validation error: Running as root is not allowed. Either the field spec.securityContext.runAsNonRoot must be set to
true, or the fields spec.containers[].securityContext.runAsNonRoot, spec.initContainers[].securityContext.runAsNonRoot, and spec.ephemeralContainers[*].securityContext.runAsNonRoot must be set totrue. rule run-as-non-root[0] failed at path /spec/securityContext/runAsNonRoot/ rule run-as-non-root[1] failed at path /spec/containers/0/securityContext/runAsNonRoot/
Metadata
Metadata
Assignees
Labels
Type
Projects
Status