Answer the question
In order to leave comments, you need to log in
How to properly set permissions for a Docker container?
Guys girls, hello.
Please tell me what is my mistake in this case.
I'm running a Docker container with a local folder forwarded to it
docker run -d --rm --name devilbox-php-fpm-5-3 -p 9000:9000 -v /var/www/site.ru/www:/var/www/default/htdocs devilbox/php-fpm-5.3
-rwxr-x-r-x www-data:www-data index.php
chmod 777 index.php
that everything works. Answer the question
In order to leave comments, you need to log in
check the id inside and outside it is necessary to match the www-data account
on the host find out
id -u
id -g
export HOST_USER=$(id -u):$(id -g)
on the container RUN addgroup -S $GROUP_NAME \
&& adduser -h /home/$USER_NAME -u $UID -s /bin/sh -D -G $GROUP_NAME $USER_NAME \
&& chown -R $USER_NAME:$GROUP_NAME список директорий каких надо
USER $USER_NAME
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question