Docker permissions issue? Maybe

Discussion about Docker
Post Reply
User avatar
Archigos
Posts: 8
Joined: 14 Mar 2022, 22:44

Docker permissions issue? Maybe

Post by Archigos »

I'm really knew to learning Docker and have set up a few on macOS. This is my first attempt on the NAS. I found a thread on this forum where someone was asking for help and an employee answered. I tried to follow those directions, but the second thing the employee said was navigate to /mnt/md0/docker or something like that... this doesn't exist on my NAS so I gave up and decided to write this.

TOS: 5.1.67
Model: F4-420
Docker: Whatever the one is in App Center

So, I'm trying to install/run a container that I know wont be found on Docker Hub or wherever the GUI can pull from. But I wanted to know where to put the files on the NAS to hopefully grab it via docker-compose (which I haven't even tested is installed and may need help with that if it's not).

Inside the Docker GUI:
To test and start learning, I pulled down the latest Sonarr from LinuxServer. Before running it, I stepped through the guided setup and mapped three folders.
Inside the File Manager I clicked my username on the left and created the following folder structure:

Code: Select all

/<username>/docker/sonarr/config  {and I mapped that to} /config
Next, I mapped two existing folders by clicking the folder icon to make sure I got the directories correct. They ended up being:

Code: Select all

/Volume1/environment/Media/Video/TV  ->  /tv

Code: Select all

/Volume1/environment/Media/Video/downloads  ->  /downloads
I started the container and couldn't access it via Sonarr's port 8989 (found out it gave me a random port, which worked and I fixed after)
I noticed in the real

Code: Select all

/archigos/docker/sonarr/config
filled with files, so that directory works. But, when trying to set up my Root Folder to

Code: Select all

/tv
it appears empty and doesn't contain the real files. Just as another test, I went to the 'real' downloads folder and created a new empty directory... this directory did NOT appear in the folder in the container. So both of them are broken.

I assume this is to do with permissions? There's a setting in Sonarr for "Recycle Bin" which dumps all deleted files there instead of perma-delete and I accidently just pasted in the 'real' location to that folder and got an error stating that "Folder '/<folder I entered>/' is not writable by user 'abc'" So I think Sonarr is actually using a username of abc so how do I fix that so it uses my username (which I hope will get around the permission issues)?

In SSH, running "find ./ -type d -name sonarr" shows that ./home/archigos/ is the same as ./Volume1/User/archigos/ not sure if that helps me in any way, unless maybe I can symlink the 'real' tv and download folders inside the /home/archigos/docker/sonarr/ folder and try to set the locations to that? But that probably wouldn't help if it is a permission issue right?

Any help/suggestions would be greatly appreciated.
User avatar
Archigos
Posts: 8
Joined: 14 Mar 2022, 22:44

Re: Docker permissions issue? Maybe

Post by Archigos »

For anyone trying this on their NAS... most sites that tell you how to setup/install their container normally have a spot in the config/compose/etc. that mentions setting PUID and PGID to 1000 (which I assume is correct on MOST Linux based systems)... Set them to 0 and you'll have access to all files properly.
User avatar
tommi2day
Posts: 45
Joined: 10 Jan 2023, 02:15
Germany

Re: Docker permissions issue? Maybe

Post by tommi2day »

Its common practice to avoid docker container running as UID=0 aka root. However then its necessary to allow the runig user to write into the chosen nas folder. This can be acomplish by allow all rights to all Users (maybe chmod a+rwx /Volume1/docker/sonarr/data) or chown the folder to the running user (maybe chown -R 1000 /Volume1/docker/sonarr/data) Similar can be done in file manager (marked folder->properties->permissions)

Its also recomandet to use the latetest version (totime 1.2.9) of docker manager as former versions hat seriios problems withe file permissions and nameserver resolution
main: T9-450
Post Reply

Return to “Docker”