4

I have a DFS network drive that I would like to mount to my docker container in Windows 10. But I cannot make it work using any of the "half" suggestions on Google.

# First try
docker run -v \\my\network\storage\:/my_container_path/ my_image:latest

# Result
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: Mount denied:
The source path "\\\\my\\network\\storage\\" is not a valid Windows path

I read a suggestion to use a docker volume.

# Second try
docker volume create --name my_volume --opt type=none --opt device=\\my\network\storage\ --opt o=bind
docker run -p 6969:6969 -v my_volume:/my_container_path/ my_image:latest

# Result
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: error while mounting volume '/var/lib/docker/volumes/my_volume/_data': 
failed to mount local volume: mount \\my\network\storage\:/var/lib/docker/volumes/my_volume/_data, flags: 0x1000: no such file or directory.

I though I could just create the container, log in and then mount it directly there:

# Third try
mkdir /mnt/myshare
mount -t smbfs //my/network/storage/ /mnt/myshare

# Result
mount: /mnt/myshare: permission denied

I do not understand why permission i denied to a folder I just created????

Finally some suggested writing it all into a docker-compose.yml file, but I do not see how that would solve the problem.

I have gone over the documentation, and I cannot make neither volume mounts or bind mounts work. Has anyone been able to mount a DFS storage to their containers?

Esben Eickhardt
  • 3,183
  • 2
  • 35
  • 56

1 Answers1

0

You probably need to first create a symbolic link on the windows system (perhaps even under your user account, e.g. C:\Users\You\Documents) to the DFS network drive, and then use the path to the link for the volume bind in docker run.

Peter Kionga-Kamau
  • 6,504
  • 2
  • 17
  • 13