-
Notifications
You must be signed in to change notification settings - Fork 46
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
Run as non-root #9
Comments
I think all content in the container drops privileges automatically. nginx and php workers use uid 101 |
Hi @BenjaminHae , I could only find using a non-root user in the official Best practices for writing Dockerfiles article, which the I think you mean something different though: specifying yet another UID/GID to be used to run the process, which would have to be dynamically configured while the container is started. Can add a link to the best practice you mentioned so that I can read up and look into it? |
Hi @ckulka, I think the best reference is the CIS Benchmark for Docker. |
@BenjaminHae being able to change to UID and GID is interesting but, As you could notice at the line 33 nginx is the owner of If you so concern about the security you should run your docker-daemon with the parameter Another best practice is to not trust the community and to build your own container and maintain them. |
Given a separate user exists and nginx runs as that non-root user (user is If there's a need for a dynamic user id, i.e. a configurable UID and GID of the user that runs nginx, let's open an issue with that enhancement request... especially since this will require some custom code to dynamically create the user, update the configuration and all file permissions. |
It is good practice to explicitly define a user to run the container as on start, for example like this:
docker run -e USER_ID=997 -e GROUP_ID=997 ckulka/baikal:nginx
This leads to conflicts because of php-fpm can't access /run/php and
chown -R nginx:nginx /var/www/baikal/Specific
needs root permissions.Do you see a way to follow good practice with your image?
The text was updated successfully, but these errors were encountered: