Mount DFS to Docker container in Windows 10
NickName:Esben Eickhardt Ask DateTime:2020-02-10T23:21:57

Mount DFS to Docker container in Windows 10

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?

Copyright Notice:Content Author:「Esben Eickhardt」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/60153400/mount-dfs-to-docker-container-in-windows-10

More about “Mount DFS to Docker container in Windows 10” related questions

Mount DFS to Docker container in Windows 10

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\

Show Detail

Docker volume mount windows container

I am getting the following error while trying to mount a volume in windows docker container. =============== C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon:

Show Detail

Docker: Mount volume on Windows host - Windows Container

I seem to be running the least supported combination of docker. Im running on a windows host machine and a windows container. I want to mount C:\temp -> C:\temp I have tried docker run ... -v C:...

Show Detail

Docker Mount Project error response from daemon on Windows 10

I am new in using Docker and I want to mount my project in a container to run it on a Virtual Host. First of all I installed the Docker Toolbox that works for Windows 10. I am using the Docker Quic...

Show Detail

How to mount private SSH key to Docker for Windows container?

Good day everyone. I have following dev environment: Win 10 host Docker Desktop for Windows latest php5.6 image running in container via docker-compose How can I mount my private SSH key to this

Show Detail

Docker container: mount plugged devices on Windows

Running a container on Linux: $ docker run -it --name damastes --rm --mount type=bind,source="$HOME"/,target=/enjoy --mount type=bind,source=/run/media,target=/run/media,bind-propagation=...

Show Detail

How to mount directory with docker logs to docker container

I am using Docker for Windows on Windows 10 with WSL I want to collect docker logs using Fluentd I figured out that docker logs on my machine store here \\wsl$\docker-desktop-data\version-pack-data\

Show Detail

Docker: How to mount current directory in Windows 10

I am using docker toolbox v17.03 in Windows 10 Home. I am playing with flask app from python slim. I tried to mount the current directory to app and tried ${PWD} and %cd% like below. docker contai...

Show Detail

Mount Windows network drive in Docker container (Linux)

I am trying to mount Windows shared drive into Linux. I also want it to be in the docker container, so would like to add few commands in Dockerfile. (Then, it will mount whenever container is creat...

Show Detail

How to mount a Windows path volume inside a Docker container

It's OK when I use docker run --rm -v C:\Python39:/mnt --entrypoint ls alpine -la /mnt to mount a Windows path into a container in a native Windows shell. But when I mount Windows //var/run/docker....

Show Detail