1

I've searched a while on the internet for a solution.

My setup is as following:

I have a php-apache docker image (basically apache with PHP support). I used a named volume to store the webroot (all Web files, most common PHP files).

This is working fine so far, I can see my files in the browser.

Because it's a multi user project (multiple devs) I want that multiple users should be able to edit the webroot.

The named volume can be edited under /var/lib/docker/volumes/apache_webroot. But it needs root access and that is not a good practice.

How could I manage the permission to this volume without using root? I tought about creating a container that just mounts the named volume and then forwards it to a path where I have access to with all users? Or can I somehow change the permission of /var/lib/docker/volumes/apache_webroot

Anyone ran into the same situation? Should I just mount it to a path on the host machine and not use named volumes at all?

Larce
  • 841
  • 8
  • 17

1 Answers1

1

An alternative would be to create a container for each user and bind them to this volume (docker containers support shared volumes). That would be a particularly good idea.

docker run -d --name some_users_container --volume my_webroot_shared_volume_name /bin/bash -c "while true; do sleep 10; done"

Then all you gotta do is to have the other users ssh to the remote docker container.

Gabriel Fernandez
  • 580
  • 1
  • 3
  • 14
  • Thanks, thats a good approach. Sad to see that there is no way to mount a volume to the host – Larce Mar 13 '18 at 12:11