How would I provide access to my Windows V:\ drive in a docker-compose.yml file?

Here’s my docker-compose.yml file:

version: "3.1"

networks:
  lan_access:
    driver: bridge

services:
  nodejs:
    image: node:18
    environment: 
      - VS_ALLOW_ADMIN=true
      - VS_ALLOW_CORS=true
      - VS_PORT=8000
      - VS_VIDEO_SOURCE=/video
      - VS_ZIDOO_CONNECT=http://192.168.42.71:9529/
    ports:
      - "8000:8000"
    working_dir: /home/app
    restart: always
    volumes:
      - ./nodejs:/home/app
      - "some way to point at my V:\ drive needs to go here":/video
    command: ["node", "app.js"]

Everything else seems to be working now, but either I end up with a docker-compose.yml syntax error, or my /video drive is empty when the server launches. I need /video to provide access to everything on my mapped network V:\ drive.

Since I have Docker on Windows running using WSL, I tried mounting my V:\ in WSL as /mnt/v. WSL sees all of the files on the drive that way, but using /mnt/v as my volume source didn’t help, unfortunately.

Alternatively, I’ve tried accessing the same files via an SMB (since my V: drive is nothing more than a mapped network drive). No success from that approach yet either.

volumes:
  video:
    driver_opts:
      type: cifs
      o: "username=guest,password=guest"
      device: "//192.168.42.13/video"

This looks like examples I’ve found (although some examples add user ID arguments and other things to the “o” parameter), but I keep getting this error:

c:\git\docker-nodejs>docker-compose up

[+] Building 0.0s (0/0)                                                                                 docker:default
Attaching to docker-nodejs-nodejs-1
Error response from daemon: error while mounting volume '/var/lib/docker/volumes/docker-nodejs_video/_data': failed to mount local volume: mount 192.168.42.13/video:/var/lib/docker/volumes/docker-nodejs_video/_data, data: username=guest,password=********: invalid argument

I’ve tried a few variations on this (like adding “smb:” to the IP address), but I’m not getting an error about bad credentials or failing to connect. This error sounds like the syntax simply isn’t accepted, and Docker probably hasn’t even come close yet to actually trying to mount the share.

I haven’t solved the problem, but I’m now seeing that the problem is specifically sharing my V: drive, which is a mapped network drive.

I can mount all of my C drive like this:

    volumes:
      - ./nodejs:/home/app
      - type: bind
        source: c:/
        target: /media/video

That works perfectly. If I substitute v:/ for c:/, however, all I see is an empty directory. There is no error message, no warning, but nothing appears.

If I use an unmapped drive letter, like q:/, I do get an error:

Error response from daemon: mkdir q:: The system cannot find the path specified.

First of all, it’s weird that the error comes from mkdir. Secondly, this tell me Docker can indeed find my V drive, but it then either fails silently in some other manner, or Docker deliberately filters the content of the V drive.

A permissions issue? Docker Desktop used to have a Shared Drives section in its Settings, but that doesn’t exist any more, so if there is a way that I need to provide permission to access the contents of the V drive, I don’t know what that is.

I finally have a solution… no answers to my previous questions, just way to work around the problem.

I enabled NFS sharing on my Unraid array, and finally accessed the files I’ve been trying to access like this:

volumes:
  video:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.42.13
      device: :mnt/user/video

I still don’t know why I couldn’t properly bind and mount my V: drive, however, nor why all attempts to use SMB/CIFS failed.