There is:
2 container docker (nginx, php) and general directory / var / www
version: '2' services: web: image: nginx ports: - "80:80" links: - app volumes: - /var/www:/var/www/html app: image: php:7-fpm volumes: - /var/www:/var/www/html- I add projects locally to / var / www with the rights myuser: myuser ug + rwx
Problem:
- each container uses its internal user (nginx, www-data)
- all other commands in the container are root
- persistent problems with "permission denied"
What do you need:
Without reconfiguring each container for one user (root), get rid of the above problems
Additional:
- Without a docker, having a large zoo of services, the problem was solved by a SUID tag, sometimes adding users to the central group. But this method with the docker "does not work", since each container does not know about groups and users from outside
- There is an idea that the docker can run containers (services) on behalf of the user I need, thus, if they do not understand the wilds of containers, they will edit the files (volumes) on behalf of the user of the host machine.
- At the moment the problem is not solved in a good way, here is the official discussion on the githaba