2

I have mounted a Hetzner storage box CIFS volume to my server to /mnt/sbox1, and now I want to make a docker container use it to store downloads on it. My/etc/fstab mounts the drive on startup using the following command:

//u[REDACTED].your-storagebox.de/backup /mnt/sbox1 cifs iocharset=utf8,rw,credentials=/etc/backup-credentials.txt,x-systemd.automount,uid=0,gid=0,file_mode=0777,dir_mode=0777 0 0

Then in my Portainer instance, I'm using the following stack:

version: '3'

services:
  service.simpletorrent:
    image: boypt/cloud-torrent
    restart: unless-stopped
    ports:
      - "3002:3000"
    environment:
      AUTH: "[REDACTED]:[REDACTED]"
      TITLE: "MySimpleTorrent"
    volumes:
      - storagebox-share/simpletorrent/torrent-downloads:/srv/downloads
      - storagebox-share/simpletorrent/cloud-torrent.yaml:/etc/cloud-torrent.yaml
    command: ["-c", "/etc/cloud-torrent.yaml"]
    
volumes:
  storagebox-share:
    driver_opts:
      type: cifs
      o: "username=u[REDACTED],password=[REDACTED],addr=u[REDACTED].your-storagebox.de"
      device: "u[REDACTED].your-storagebox.de/backup" 

Running it as is throws the following error:

Failure failed to deploy a stack: Named volume "storagebox-share/simpletorrent/torrent-downloads:/srv/downloads:rw" is used in service "service.simpletorrent" but no declaration was found in the volumes section. : exit status 1

After searching around, people seem to suggest using a relative path instead. This seems to work since it deploys, but no data seems to be present in the specified directories of the drive. For example, no cloud-torrent.yaml file is visible but the WebGUI of the container is online, so I'm guessing that it falls back to some default directory somewhere?

How can I debug this? The logs for this image are not very helpful.

Stelios Papamichail
  • 955
  • 2
  • 19
  • 57

1 Answers1

0

I've had a similar stack working on my server without any problems. There are two differences in my implementation that I can see:

  • I have cifs-utils installed on the server (as you seem to) and I don't use the volumes/driver_opts block in my stack. Apparently accessing my server mount points directly.

  • My fstab is similar to yours with these small differences: I use: nobrl, noperm, vers=3.0 I do not use: x-systemd.automount And my perms are tighter.

//192.168.xxx.xxx/share-drive /mnt/share1 cifs nobrl,uid=1000,gid=1000,dir_mode=0744,file_mode=0744,credentials=/etc/credentials.share1,iocharset=utf8,noperm,rw,vers=3.0 0 0