docker and SMB shares reddit / selfhosted ---------------------------------------------------------------------- steve_docker · 2023-10-14 12:08 Hi, I am trying to run a docker-compose file (seafile if that makes any difference). This works fine if dockerroot and all of the data volumes are located on the local filesystem. (Which is an Ubuntu proxmox VM) However I am running into problems when trying to move the data volume and/or dockerroot to an SMB mounted from another machine. (In case it makes any difference they are both ubuntu VM's running under proxmox on a 192.168.x.x.). I \*believe\* I have the correct permissions on the SMB share, local mount point and on the VM running docker. Also when I run "docker- compose up" I do see docker successfully writing files to the SMB share. There are no errors shown in /var/log/samba on the server. The SMB share is mounted on the docker host with an /etc/fstab as below: [//192.168.1.163/proxshare](//192.168.1.163/proxshare) /mnt/sambashare cifs username=auser,password=,uid=1000,rw,file\_mode=0777,dir\_mode=0777 0 0 The user 'auser' and root can read and write to the SMB share via normal commands like touch etc. ​ Permissions for the directory on the samba server are: drwxr-xr-x 13 auser auser 4096 Oct 14 12:29 sambashare ​ Permissions for the mount point on the remote VM running docker are: drwxrwxrwx 2 auser root 0 Oct 14 11:29 sambashare ​ So I'm at a loss as to why this doesn't work. In case it helps its the mariadb docker container that seems to be having problems when being run with docker volume being set to be the smb share. ​ I'm wondering: 1) Should this work and should docker/the OS see /mnt/sambashare as pretty much just a local directory? 2) Do I need to give the \`docker\` user special permissions to this share? ​ ​ ---------------------------------------------------------------------- thekrautboy · 2023-10-14 12:16 * Why SMB between two Linux machines? Use NFS and save yourself a headache. Use SMB only when its required because Windows is involved. > Should this work and should docker/the OS see /mnt/sambashare as pretty much just a local directory? With the way you set it up, yes. Docker isnt even aware its a SMB share, it only uses that directory you tell it to. So the problem cannot be Docker here, atleast not directly. Most likely you have a permissions issue between the user that is running inside the container, the Docker host and the SMB host. > Do I need to give the `docker` user special permissions to this share? Thats your hint. Alternatively you could use SMB (or better NFS) directly as Docker volumes, Docker has builtin volume drivers for that, this would allow you to skip the mounting on the Docker host and possibly make permissions easier to handle. https://docs.docker.com/storage/volumes/#use-a-volume-driver Also, /r/Docker exists but my guess this is more fitting for /r/LinuxQuestions and /r/Linux4Noobs ---------------------------------------------------------------------- [deleted] · 2023-10-14 12:22 [removed] ---------------------------------------------------------------------- [deleted] · 2023-10-14 12:57 [removed]