Docker Containers Read/Write Access to Synology (NAS) Shared Folders/Files

    • Docker Containers Read/Write Access to Synology (NAS) Shared Folders/Files

      Hi Everyone...

      My plan was simple, so I thought. Little background. I purchased a Synology DS2413+ (NAS) three years ago. I installed quite a few apps (SABnzbd, Sonarr, Mylar, etc...) with all the respective media defined in shared folders. It works, bu because of the hardware constraints, it was to taxing to have more than two apps running at a time. My plan is to build a small miniPC to house OMV and use docker containers for all the automated programs. I want to keep Synology for file storage only, for everyone on my network.

      I'm not new to using SABnzbd, Sonarr, etc, but I am new to OMV and Docker. I've set up OMV temporarily on VMWare Worksation Pro, just to understand the setup and usage before I move on to building a stand alone miniPC. The setup of OMV and Docker went quite well. I setup virtual hard drives in VMWare to make sure all my setting were working. Everything worked perfectly.

      Where I am running into problems is when I start pointing Docker containers to the Synology shared folders. Permission errors from all the containers. I've double checked all permissions for all the folders and files on Synoogy that I want the containers to access and still no luck. I've added the correct PUID and GUID to the containers, but the moment I go to save the new default folders I get "can't write to..."

      I've also used the Remote Mount plugin and same errors.

      I may be new to OMV and Docker, but I have used Linux and have no problems with command line and config edits, etc...

      Any thoughts or suggestions?

      Much appreciated
    • As a quick disclaimer:
      Running OMV/Docker combinations inside of a VM, is the net equivalent of running a VM within a VM. Odd things with access to physical drives and permissions can, and do, happen.
      ______________________________________________________

      A Remote Mount folder is as close to having a folder or network share, "local", as is possible. If the local root account has write access to the remote Synology share, for all intents and purposes, it is local.

      Dockers, on the other hand, are designed to isolate the container away from the host, but there are designed in exceptions. In the Docker GUI, when creating or modifying a Docker container, you can map a folder inside the container to a folder on the host, outside of the container, using "Volumes and Bind points". (Shown below.)




      If they don't exist, these volume - bind point folders are created when added to a Host Path / Container Path entry, and saved. (Don't "pre-create" the folder on the host side - this would apply permissions from the default create mask. Allow the Docker container configuration to create the folder and assign permissions. On the other hand, given the restrictions imposed when working inside a Docker container, it might be best to map to an inside folder that already exists.)

      These links give write permissions to the host's root account to the folder on the outside where, inside the container, the container's root account has write access to the path/folder inside. It's a kind of access tunnel/transition between the host and container.

      Using Volumes and Bind points, Remote Mount, along with Symlinks (where a Remote Mount folder can be dropped into the host path/folder), you should be able to come up with something to address your permissions/access issue.
      (BTW: Symlinks is available as an OMV plugin.)

      Hope this helps.
      Good backup takes the "drama" out of computing
      ____________________________________
      Primary: OMV 3.0.99, ThinkServer TS140, 12GB ECC, 32GB USB boot, 4TB+4TB zmirror, 3TB client backup.
      Backup: OMV 4.1.9, Acer RC-111, 4GB, 32GB USB boot, 3TB+3TB zmirror, 4TB Rsync'ed disk
      2nd Data Backup: OMV 3.0.99, R-PI 2B, 16GB boot, 4TB WD USB MyPassport - direct connect (no hub)

      The post was edited 2 times, last by flmaxey: edits ().

    • Thanks again for your help. Had some time to test things out. I added the network share folder using remote mount...no problems. I then added the shared folder in the docker container (/srv/...). The problem is after I save, then go back into the container settings, the network folder is changed to read only. I switch it off, but it keeps changing it back to read only.

      Any thoughts?
    • What Docker are you working on and what are you trying to connect it to?

      /srv on the host side is not a good folder to try to place under the control of Docker (and a child container). /srv is where OMV creates paths to physical hard drives and remote mounts. In any case, it's not a good idea to try to place a shared folder under the control of a Docker.

      Set up an, as yet, uncreated folder at the root of OMV, using Volumes and Binds in a Docker container, like I did in the reference picture. Maybe something like /docker/qtorrent (or the name of whatever docker you're using).

      After the container is on line, the folder will appear on the host side, then you can use a Symlink to direct the contents of any sub-directory of /srv into folder /docker/qtorrent.
      _____________________________________

      Do you have WinSCP installed? If you don't, install it on a Windows PC. Use it to connect to your OMV servers IP address and use user root + password to log in. You'll have a windows explorer "like" graphical environment to get a look at the paths involved.

      With a directory selected on the left side pane of WinSCP, on the right side pane you'll be inside of the directory. Right click your mouse and a menu will pop up. Select New and Link. (Don't check the "hard link" box.) This is the setup for creating a manual Symlink outside of OMV. You can create a link that will, effectively, join two directories on the host side.

      So, for example, with a Symlink you can connect the Remote Mount of "Music", on a remote server, to the outside folder of a "Plex Docker". Volumes and Bind points will direct the outside folder to a folder inside the container. (In this case, I'd create a new folder inside the Plex container, using Volumes and Bind points, call "Music".) With the Plex server, you can select the inside "Music" folder and Plex will be populated with music from the remote server.
      Good backup takes the "drama" out of computing
      ____________________________________
      Primary: OMV 3.0.99, ThinkServer TS140, 12GB ECC, 32GB USB boot, 4TB+4TB zmirror, 3TB client backup.
      Backup: OMV 4.1.9, Acer RC-111, 4GB, 32GB USB boot, 3TB+3TB zmirror, 4TB Rsync'ed disk
      2nd Data Backup: OMV 3.0.99, R-PI 2B, 16GB boot, 4TB WD USB MyPassport - direct connect (no hub)