Question
How do I give correct permissions to shared volumes in Docker?
I followed this guide https://www.digitalocean.com/community/tutorials/how-to-share-data-between-docker-containers and created a volume that I share between my samba and nextcloud containers. However, samba and nextcloud are accessing it from different usernames, and I can’t find a way to make them both have read/write access to it. I’ve tried to create a group (on the host, where the volume is located) and put both www-data and the samba user in that group and give that group write permission on the volume. But somehow only the user who is chown the volume can read, even if it’s also chown to the group. Any suggestions on this?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
Correction; “somehow only the user who is chown the volume can read” should of course be write instead of read.