-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mounting a Windows share to a container #6083
Comments
This does not look like an issue with the Docker Desktop application itself but with the upstream docker windows container implementation so I'm closing this issue. Could you please open an issue on https://github.com/moby/moby instead as that is the more appropriate place? |
Well hold on, sorry, file sharing is kind of tied to Docker Desktop as well actually. |
I am running: DockerDesktop 2.2.0.4 |
@Hamsterman thanks for your report. If you have a moment could you describe your use-case a little? We focus our testing on the "standard" way for file sharing rather than NFS or CIFS. I suspect the reason NFS isn't working is because in
The I don't believe this syntax is supported: |
First of all I have no favorite protocol I would like to use at this point in time. I just wanna see just one work. The use case is simple to have a persistent storage on a share (I am testing with a Windows Share). I have tried with the nfs4 as you can see below. If I use host.docker.internal C:\Program Files\Docker\docker.exe: Error response from daemon: error while mounting volume '/var/lib/docker/volumes/bar/_data': failed to mount local volume: mount :/DockerShare:/var/lib/docker/volumes/bar/_data, data: addr=host.docker.internal,hard,nolock: invalid argument. And if I use the actual IP of the Windows host |
bump |
bump again |
Issues go stale after 90 days of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
I have been looking hundreds of post that try to explain how to map a share to a container - but still no luck.
My setup
It seems that some people have this working:
docker volume create --driver local --opt type=nfs --opt o=addr=127.0.0.1,hard,nolock,rw --opt device=:/DockerShare bar
docker run -it -v bar:/server-dev alpine sh
But I get this error:
C:\Program Files\Docker\docker.exe: Error response from daemon: error while mounting volume '/var/lib/docker/volumes/bar/_data': failed to mount local volume: mount :/DockerShare:/var/lib/docker/volumes/bar/_data, data: addr=127.0.0.1,hard,nolock: operation not supported.
When I switch to nfs4 I get a different error.
docker volume create --driver local --opt type=nfs4 --opt o=addr=127.0.0.1,hard,nolock,rw --opt device=:/DockerShare bar
docker run -it -v bar:/server-dev alpine sh
C:\Program Files\Docker\docker.exe: Error response from daemon: error while mounting volume '/var/lib/docker/volumes/bar/_data': failed to mount local volume: mount :/DockerShare:/var/lib/docker/volumes/bar/_data, data: addr=127.0.0.1,hard,nolock: connection refused.
Why is this so hard ? - shouldn't it be possible to code something that just work without so many problems.
By the way I did this as well
docker run -it -v //127.0.0.1/DockerShare:/server-dev alpine sh
No errors but I could not see the files from the DockerShare in the server-dev folder.
I tried to create a folder in the server-dev folder from within my container to my surprise it was still there after exited the container, removed it, did a docker volume prune and executed
docker run -it -v //127.0.0.1/DockerShare:/server-dev alpine sh
again.
Also I did a search for the folder I created but it could not be found on the Window host.
On last thing - I tried the "standard" way which is activating sharing of the C drive in Docker Deskop.
Then I started the container like this:
docker run -it -v /c/SomeTest/:/server-dev alpine sh
That works just fine - I can see the content of C:\SomeTest and I can add files in it which shows instant in the server-dev folder.
The confusion is complete!
The text was updated successfully, but these errors were encountered: