I’m new to Docker, but I’m trying to deploy some containers that will need to read and write to a network shared volume. I’m hoping to run things like Navidrome, Immich, and an Arr Stack. The containers are on Ubuntu and my network volume is on a qnap machine. It is discoverable from Ubuntu without issue.

Do I need to mount the shared volume in Ubuntu or can I just refer to it in the Docker Compose file?

I know I need to mention the location of the volume in the Docker Compose file, but I’m not sure how to write that. How do I include the un/pw information for the NAS?

I read about bind mounts in Docker’s documentation. Is that what I want to use? Again, how do I include the un/pw information? I’m not sure how to use the commands.

The volume path for the navidrome folder is //tiger-nas/music/music for example.

I appreciate any help.

  • roofuskit@lemmy.world
    link
    fedilink
    English
    arrow-up
    12
    arrow-down
    1
    ·
    22 hours ago

    Mount it locally. Then reference the local mount in your docker command or compose file.

    • spiffpitt@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      20 hours ago

      I’m constantly seeing this advice, dispite docker supporting nfs volumes. How do you handle docker starting containers before the shares are mounted? making the docker service as a whole wait for network mounts? what about containers that dont need to wait for a network drive?

      • roofuskit@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        arrow-down
        1
        ·
        19 hours ago

        Honestly I’ve never had that issue, but if you use compose you can delay the start of a container and use the “depends-on” function to hold any other containers. But yes docker supports both NFS and SMB.