I have Docker container with named volume running on non-root user started with the following command:
docker run -v backup:/backup someimage
In the image, there's a backup script which is trying to save files in /backup
directory but it fails. Mounted backup
volume in /backup
dir belongs to root user.
How to change permissions for /backup
directory?
-----EDIT1:
mcve below:
Run docker container with Gerrit:
docker run -v backupgerrit:/backup --name gerrit gerritcodereview/gerrit
Now on other terminal window try to save something in /backup
dir:
docker exec gerrit touch /backup/testfile
You will get:
touch: cannot touch '/backup/testfile': Permission denied