How to change umask total docker volume?

This is due to " https://stackoverflow.com/questions/36477636/how-do-i-implement-a-shared-hosting-like-service-with-docker ".

I am trying to configure a bunch of apache-php containers that should have rw for docroot and one single sftp container that should also have rw capability in the same directory. So the plan is to create a shared volume and mount it inside both containers (obviously in different places when it comes to the sftp container). I changed the official launch of php: 7-apache script as follows:

 #!/bin/bash set -e ### > My stuff chmod g+s /var/www/html chown -R :2048 /var/www/html umask umask 0002 umask ### < My stuff # Apache gets grumpy about PID files pre-existing rm -f /var/run/apache2/apache2.pid exec apache2 -DFOREGROUND 

and in fact the two lines of umask confirm that the clamped umask 0002 working correctly. However, when I bash into the container and test it myself, umask returns 022 , and if I create any file, they actually get 644 permissions. Then I can manually umask 0002 and any new file is created with permissions of 664 (and 775 for directories).

In this case, it is very important that both containers (sftp and apache) can read and write to the shared volume. So how do I do this?

+3
docker apache docker-volume ftp shared-hosting
source share

No one has answered this question yet.

See similar questions:

7
How to mount - snap inside a docker container?

or similar:

3382
How is Docker different from a virtual machine?
1727
Should I use Vagrant or Docker to create a sandbox?
1330
Copy files from host to Docker container
1182
Copy files from Docker container to hosting
1175
How to get Docker container IP address from host?
1148
How to remove old Docker containers
1120
How to copy Docker images from one host to another without using a repository
890
How to list containers in Docker
792
How to delete an image in Docker?
755
How to work with persistent storage (for example, databases) in docker

All Articles