Compose with multiple NFS volumes merging them together

I’m trying to use NFS mounts in a docker compose file, and it works for the first one.

/video contains exactly what I would expect. However, /music, and /photo have exactly the same contents as /video, NOT the content I would have expected. This seems like a bug, not an error in the compose file, but any advice would be appreciated.

services:
  jellyfin:
    image: jellyfin/jellyfin
    container_name: jellyfin
    volumes:
      - rack_video:/video
      - rack_music:/music
      - rack_photo:/photo
volumes:
  rack_video:
    driver_opts:
      type: nfs
      o: addr=192.168.1.10,ro
      device: :/volume1/video
  rack_music:
    driver_opts:
      type: nfs
      o: addr=192.168.1.10,ro
      device: :/volume1/music
  rack_photo:
    driver_opts:
      type: nfs
      o: addr=192.168.1.10,ro
      device: :/volume1/photo

Docker volume definitions are immutable: any updates to the configuration of a volume in the compose file will not be propagated to the volume definition.

You will need to stop the compose project, remove the volumes (via cli: docker volume rm <volume name> or with Portainer, or Dockge), the re-deploy your compose project, so that the volume will be re-created with the updated configuration.

Note: you seem to have your shares on a Synology NAS: afair, Syno’s container management ui “Container Manager” does not support deleting volume definitions.

1 Like