[HOW-TO] Docker Sonarr

Okey, there is a bit of teaching here, don’t take offence if I explain something you already knew, or felt was obvious. I do what I did with my former pupills, start at a LOW knowledge level, with drastic over simplifications, try to keep a good pace and hope people say . Stop/Wait/Why =)

Your host (Vero4/5), can now handle containers. What is a container?
A container holds it’s own filesystem, most of it is read only. But it doesn’t hold any vital operatingsystem parts, that is for your host.
Unless you have made alterations. /var/lib/docker/ is on you host system and holds much of what makes dockers work:

  • Volumes
  • Networks
  • Overlays
  • Containers
  • images (not pictures)
  • a few more like swarm, plugin, temp, trust, buildkit (this last few just complicate things)

A lot of stuff, but it actually visualize how containers work:
A container is an encapsulation of multiple parts, often a read only “partial filesystem (no kernel)”, that we can call an Image. 1 or more Network-settings, and 1 or more dedicated storage spaces on your real hard drive, a Volume or Volumes. So the Container takes all this, and creates a semi virtual machine, with read only parts and dedicated mappings from within the containers filesystem to rw folders/files on your real filesystem. And overlays it on your host-OS

No offence taken and that (largely) make sense to me!
So my issues is in the last part of what you have written which I’m trying to resolve here: Helping installing sab & radarr - #27 by pinn73

I believe the paths in the yml file are correct but the logs show:

sabnzbd | 2023-09-20 15:26:14,047::ERROR::[filesystem:396] Cannot create directory /media/OneTouch/completed
sabnzbd | 2023-09-20 15:26:14,049::INFO::[filesystem:711] Creating directories: /media/INTENSO/temp

This is presumably a permissions error. And, that’s where I’m stuck today :slight_smile:

I see that these are all running as root, bar the final one:

UID PID PPID C STIME TTY TIME CMD
root 7975 7954 0 15:26 ? 00:00:00 /package/admin/s6/command/s6-svscan -d4 – /run/service
root 8013 7975 0 15:26 ? 00:00:00 s6-supervise s6-linux-init-shutdownd
root 8014 8013 0 15:26 ? 00:00:00 /package/admin/s6-linux-init/command/s6-linux-init-shutdownd -c /run/s6/basedir -g 3000 -C -B
root 8036 7975 0 15:26 ? 00:00:00 s6-supervise svc-sabnzbd
root 8037 7975 0 15:26 ? 00:00:00 s6-supervise s6rc-fdholder
root 8038 7975 0 15:26 ? 00:00:00 s6-supervise s6rc-oneshot-runner
root 8046 8038 0 15:26 ? 00:00:00 /package/admin/s6/command/s6-ipcserverd -1 – /package/admin/s6/command/s6-ipcserver-access -v0 -E -l0 -i data/rules – /package/admin/s6/command/s6-sudod -t 30000 – /package/admin/s6-rc/command/s6-rc-oneshot-run -l …/… –
osmc 8136 8036 1 15:26 ? 00:00:09 python3 /app/sabnzbd/SABnzbd.py --config-file /config --server ::

for docker, any path you don’t explicitly add to the volumes will only exist within the docker container itself. And the applications running in the container have no (zero, none) access to any files on the “real” filesystem beyond what is mapped in as volumes. Any files/paths that you want to read or write to must be explicitly mapped as volumes

for example, your docker-compose.yaml would need something like this to grant access to various mounted drives to the applications running in the container.

volumes:
  - /home/opt/somedockerapp/config:/config
  - /mnt/downloads:/mnt/downloads 
  - /mnt/altdata:/mnt/altdata
  - /mnt/m8:/mnt/m8
  - /mnt/m14:/mnt/m14
  - /mnt/m16:/mnt/m16

[edit] note for those unfamiliar, format is “real/file/path” : “container/file/path”
The first part is the actual path on the real filesystem, the second is the how it is mapped within the container. (eg, the app running inside the conatiner in the above example sees a /config path, bot on the “real” file system (outside the container) the files live at /home/opt/somdockerapp/config

1 Like

If you are not used to multiargument, multiline command in shell, I seriously suggest lookin at Portainer/Yacht/Podman(never tried)?

You can almost of all that you do with command line in Portainer(probably other too), and you get a visual aid for most of those command line options, and get a better overview and understand the magic in that Container.

Yep, that’s clear and what I have is in my yml is:

volumes:
  - /opt/sabnzbd:/config
  - /media/INTENSO/temp:/incomplete-downloads
  - /media/OneTouch/completed:/downloads

My syntax looks different to yours though - should it be /mnt instead of /media?
These are auto mounted drives btw

It’s an option but as I hope this is nearly sorted, I’d rather not have to go another route. Thanks for the tip though.

no, your syntax is fine if your files live under /menda/INTENSO and /media/OneTrouch (and those paths exist on the real filesystem). note that when you configure the application istself (sabnzbd), you would never reference /media , you would only reference “/incomplete-downloads” and “/downloads” since that’s that you mapped them to.

Also check the permissions (user/group) on /media/INTENSO and /media/OneTouch,

the “environment” section of docker-compose sets things like the user/group the app runs as, and that user/group would need to have permissions on the (real) directories.

for example

environment:
- PUID=1000
- PGID=1003
- UMASK=002
- TZ=America/New_York

you would need to check the /etc/groups and /etc/passwd files to verify the id for the user/group.

Ahh, light bulb moment (hopefully)! I was trying to browse to the drive as I used to but now it creates a link to those drives within the config folder, yep?

Well, sab runs fine now and the logs show no permission errors but a test file I downloaded was deposited in the downloads folder in config folder which I assumed mapped to the external drive downloads folder. Not on the external drive though. Stuck again - doh!

do you have sabnzb configured to download into /downloads (the directory you mapped the volume to) , or into /config/downloads (which is a subdirectory under /config and thus belongs under /opt/sabnzbd/?

I just had downloads yes, but if you click in to field, it does seem to want to download into config/download

Digging further down , I guess is it these 2 folders: incomplete & downloads?

you need to put “/downloads” (leading slash) to use the folder mapped to the root directory, rather than just “downloads”, (which is a relative directory)

[edit]
note, you could also configure your volumes as follows and then let sabnzbd use the directories “under” config, but still have those store the data elsewheer.

volumes

  • /opt/sabnzbd:/config
  • /media/whaver/downloads:/config/downloads
  • /media/whatever/incomplete:/config/inconmplete
1 Like

Yep. That seems sorted now. I do see I have 2 instance of the disk now - presumably 1 is the linked one, is it?
image

I need help. I use a raspberry pi 4.

What become this command in the case of omsc ?

$(. /etc/os-release && echo “$VERSION_CODENAME”)