Hello,
I was thinking to use my NAS to share the local Docker Volumes, in order to take advantage of its feature (e.g. backup, large space, etc.). So, I have mounted a CIFS Share and I could save some test Volumes and mount on the container. Everything is fine, but it ended up with all files having the same permissions (e.g. 777), as I mount by the CIFS Share by file_mode=0777,dir_mode=0777. So, all the files are executable and R/W which should be a security issue IMHO, and as I have some scripts there, changing the filemask (e.g. 644) is not an option or I wouldnât be able to run the scripts.
Hello @rimelek,
Thank you for getting back!
Yes, NFS would be my first choice, but as my NAS doesnât support it, I have tried with CIFS.
And as explained it works (pretty well), but the permissions are a security issue IMHO.
So, I will end up using the local storage, until I get a new NAS.
Just an idea if you can change how you run the script. Scripts donât have to be executable if they are the just the arguments of the shell. So instead of running
Hello @rimelek,
Thank you again for your messages!
Yes, that is a possible workaround, but adding some additional complexity.
So, I think I will end using the local storage only, until I get a new NAS.
In the meantime, I was also interested to understand how people here have set their Docker environmentsâŠ
I can not imagine that any NAS exist that doesnât come with NFS out of the box.
All Synology and QNAP boxes should allow exposing a share via NFS.
I use NFS v4 for most of my remote shares, and CIFS for special cases, where using NFS v4 resulted in odd permissions, that prevented other CIFS clients to access the data. I donât recall what the exact problem was, but it could be a Synology specific problem. While CIFS makes it necessary to provide credentials in your volume declaration, NFS doesnât.
The cifs mounts implicitly use file_mode=0755, dir_mode=0755 on my system. Aligning uid and gid in the cifs option with the uid/gid of the process inside the container is key to use 755 permissions instead of 777 permissions.