You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 24, 2024. It is now read-only.
There are numerous guidances about running within a container as non-root. These involve the following approaches that layer security around the running container.
Use the DockerfileUSER directive to specify the default, preferably non-root user that will run the combination of the ENTRYPOINT and CMD commands.
Support the use of the docker run --user=xxx --group=yyy parameters that control which user the container runs as.
This issue is to request either guidance or an approach so that downstream derivatives of the base image can run their commands as non-root.
Notes
During our investigation the initial hurdle to being able to use the USER directive within our derived Dockerfile were the /startup/startup.d scripts that install CA certificates.
There are no existing utilities installed like gosu that provide a way to perform a privilege step-down from root to a non-root user. This might be a way to execute the /startup scripts as root and then run everything else as a non-root user.
Derived images could add this utility, but is this the approach that should be followed?
Is an alternative approach to derive a base image after a run of the /startup scripts, so that the image includes the CA certificate changes?
Overview
There are numerous guidances about running within a container as non-root. These involve the following approaches that layer security around the running container.
DockerfileUSERdirective to specify the default, preferably non-root user that will run the combination of theENTRYPOINTandCMDcommands.docker run --user=xxx --group=yyyparameters that control which user the container runs as.This issue is to request either guidance or an approach so that downstream derivatives of the base image can run their commands as non-root.
Notes
During our investigation the initial hurdle to being able to use the
USERdirective within our derivedDockerfilewere the/startup/startup.dscripts that install CA certificates.There are no existing utilities installed like gosu that provide a way to perform a privilege step-down from root to a non-root user. This might be a way to execute the
/startupscripts asrootand then run everything else as a non-root user.Is an alternative approach to derive a base image after a run of the
/startupscripts, so that the image includes the CA certificate changes?Reference links