docker
docker copied to clipboard
Allow running tomcat as non-root
It is a good practice to allow running a container as unprivileged user.
To preserve backward compatibility and provide flexibility, this feature is added at the entrypoint level and is set using environment variables.
- RUN_UNPRIVILEGED=true activates the unprivileged mode with default uid:gid as 999:999
- RUN_WITH_USER_UID allows to set the uid used for tomcat user
- RUN_WITH_USER_UID allows to set the gid used for tomcat group
- CHANGE_OWNERSHIP_ON_FOLDERS accepts a space-separated list of folder on which a chmod will be run, changing (recursively) the ownership for the tomcat user.