I’ve just installed OpenMediaVault (OMV) on a PC and enabled docker. I have also made an SMB share called appdata which will hold the various Docker config files. For example when creating Portainer like this:
docker run -d -p 49164:8000 -p 49162:9443 -p 49163:9000 --name portainer \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /srv/dev-disk-by-uuid-59f00097-009f-44bb-9a3e-8a1a59624ad8/appdata/portainer:/data \
-e TZ=Australia/Sydney \
-l diun.enable=true \
my share is …appdata/portainer. I can see this share on the Network and can read and write files to the appdata folder but I cannot write to the Docker folders, portainer in this case.
How can I change this behaviour as I need to be able to write to the Docker folders?
Does it mean that you don’t have permission to write it? Could you share an error message? If Portainer works but you can’t write the volume folder, that is expected. The user inside the container is not the same as the user on your host. You may need a root user to write it from the host if Docker changed the owner when you started the container.
As I thought. I also checked the file permissions:
4 drwxr-xr-x 7 root root 4.0K Apr 2 06:37 .
4 drwxr-xr-x 1 root root 4.0K Apr 2 06:39 ..
4 drwx------ 2 root root 4.0K Apr 2 06:37 bin
4 drwx------ 2 root root 4.0K Apr 2 06:37 certs
4 drwx------ 2 root root 4.0K Apr 2 06:37 compose
4 drwx------ 3 root root 4.0K Apr 2 06:37 docker_config
32 -rw------- 1 root root 64.0K Apr 2 06:37 portainer.db
4 -rw------- 1 root root 227 Apr 2 06:37 portainer.key
4 -rw------- 1 root root 190 Apr 2 06:37 portainer.pub
4 drwx------ 2 root root 4.0K Apr 2 06:37 tls
Nobody has read access, except the root user.
Can I ask why do you want to write that folder? I think you should not. Portainer will manage the files there. When you occasionally need to read them, you can try from a terminal with a root user. If you can’t easily open a terminal on the host, you can run an other container which has a shell and use that:
docker run --rm -it -v /srv/dev-disk-by-uuid-59f00097-009f-44bb-9a3e-8a1a59624ad8/appdata/portainer:/data bash
Then you can to install the tools you need to edit the files, but I do not recommend it.
Portainer was just an example, and no I don’t want to write to that folder. But some of the other Containers I do want to write to so I can make changes. Like Sonarr, Heimdall , Tvheadend etc. I just thought it easier to show a Container that was easy and straight forward and most know about.