Answer the question
In order to leave comments, you need to log in
How to run php-fpm in docker not as root?
I use a ready-made assembly of phpdocker.io with nginx and php-fpm
But the question is also relevant for any independent assembly
When entering the php-fpm container, all files are created from root (in particular, in symfony via bin/console make)
I tried to prescribe in docker-compose in the environment section, php_fpm_user variables, files in the container have rights from the exposed user, but when created from the container, they are still created as root
. Tried
to
pass the user through the file /phpdocker/php-fpm/pool.d/www.conf
user = www-data
group = www-data
but the situation is the same
Answer the question
In order to leave comments, you need to log in
desktop dka # docker run -u www-data -it --rm debian bash
[email protected]:/$ id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
desktop dka # docker exec -it -u www-data 8c4f2230c6d3 bash
[email protected]:/$ id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question