docker / for-win

Bug reports for Docker Desktop for Windows
https://www.docker.com/products/docker#/windows
1.86k stars 290 forks source link

No possible to map any network path 'share drive' on host windows 10 #6597

Open ericksc opened 4 years ago

ericksc commented 4 years ago

Expected behavior

Mount Network Share path as a volume to use under docker container under Windows 10 as Host

Actual behavior

No able to have access the network path resource on Docker settings then no possible to mount it

Information

djs55 commented 4 years ago

@ericksc thanks for your report. Could you describe what you're doing in a bit more detail?

Are you mounting a share to the Windows host, for example as D: and then running docker run -it -v D:\my-project/my-project alpine sh?

ericksc commented 4 years ago

@djs55 my plan is to mount enterprise share locations like \my_company.com\my_dir\ is it currently under the support by docker mount Samba SMB network location?

radeksimko commented 4 years ago

I was also unable to mount shared folder with the following setup:

Here's what I tried:

  1. Install & launch Windows 10, install Docker Desktop and WSL2 + Ubuntu 20.04
  2. Enable (nested) Intel VT-x/EPT virtualisation for the VM in VMware
  3. Share a folder, say mydir with the VM in VMware
    • see it automatically mounted as Z:\mydir on the guest/Windows side which points to \\vmware-host\Shared Folders\mydir
  4. Create mydir/nestedir (a nested folder inside the mounted one)
  5. Create mydir/onefile (an empty file inside the mounted dir)
PS C:\> docker run -v 'Z:\mydir:/data' -ti alpine:latest /bin/sh
/ # ls -la /data
total 8
drwxr-xr-x    2 root     root          4096 Jun 21 17:47 .
drwxr-xr-x    1 root     root          4096 Jun 21 17:48 ..
/ #

^ nesteddir nor onefile is visible from inside the container

I think the most confusing thing is that one may not even realize that it doesn't work as there's no error message or any other hint to suggest that, it just seems to mount an empty folder.

Here is the output from docker inspect: https://gist.github.com/radeksimko/5e3c631b7b87f34d870c067d6c6353c8

docker-robott commented 4 years ago

Issues go stale after 90 days of inactivity. Mark the issue as fresh with /remove-lifecycle stale comment. Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

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. /lifecycle stale

koxu1996 commented 4 years ago

Same here +1

radeksimko commented 4 years ago

/lifecycle frozen

radeksimko commented 4 years ago

/remove-lifecycle stale

doug62 commented 3 years ago

Same here - Microsoft claims this is possible but I can't get it to work.... https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/persistent-storage

Katzmann1983 commented 3 years ago

Same issue here. Got the following errors: docker run -t -v z:/mnt/z anycontainer:latest docker: Error response from daemon: OCI runtime create failed: invalid mount {Destination:z:/mnt/z Type:bind Source:/var/lib/docker/volumes/aea40b4ac6cc6458d6857d76612a365288aa33b354bab974beef6b4e962663ba/_data Options:[rbind]}: mount destination z:/mnt/z not absolute: unknown.

And when trying to add the network drive in the Settings of Docker the following message pops up: Error invoking remote method 'desktop-backend': Error: {"error":true,"type":0,"reason":"Path must be absolute.","details":"System.ArgumentException: Path must be absolute.\r\n at Docker.Core.CanonicalizePath.Ensure(String path) in C:\workspaces\PR-16070\src\github.com\docker\pinata\win\src\Docker.Core\CanonicalizePath.cs:line 34\r\n at Docker.ApiServices.Services.SettingsServices.FileSharingRepository.<>c__DisplayClass7_0.b0(FileSharingResource r) in C:\workspaces\PR-16070\src\github.com\docker\pinata\win\src\Docker.ApiServices\Services\SettingsServices\FileSharingRepository.cs:line 56\r\n at System.Collections.Generic.List1.ForEach(Action1 action)\r\n at Docker.ApiServices.Services.SettingsServices.FileSharingRepository.d7.MoveNext() in C:\workspaces\PR-16070\src\github.com\docker\pinata\win\src\Docker.ApiServices\Services\SettingsServices\FileSharingRepository.cs:line 63\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Docker.ApiServices.Services.SettingsService.d16.MoveNext() in C:\workspaces\PR-16070\src\github.com\docker\pinata\win\src\Docker.ApiServices\Services\SettingsService.cs:line 142\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Docker.ApiServices.Services.SettingsService.d15.MoveNext() in C:\workspaces\PR-16070\src\github.com\docker\pinata\win\src\Docker.ApiServices\Services\SettingsService.cs:line 95\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Docker.HttpApi.Controllers.SettingsController.d__8.MoveNext() in C:\workspaces\PR-16070\src\github.com\docker\pinata\win\src\Docker.HttpApi\Controllers\SettingsController.cs:line 67","url":null,"settings":{"cli":{"useComposeV2":false},"desktop":{"disableUpdate":false,"analyticsEnabled":true,"autoStart":false,"backupData":false,"disableTips":true,"tipLastViewedTime":1618398521575,"tipLastId":11,"updateAvailableTime":0,"updatePopupAppearanceTime":1626436780759,"exportInsecureDaemon":false,"useCredentialHelper":true,"wslEngineEnabled":false,"wslPreconditionMessage":null,"openUIOnStartupDisabled":false,"displayedTutorial":true},"vm":{"daemon":"{\n \"builder\": {\n \"gc\": {\n \"defaultKeepStorage\": \"20GB\",\n \"enabled\": true\n }\n },\n \"debug\": true,\n \"experimental\": false,\n \"insecure-registries\": [],\n \"registry-mirrors\": []\n}\n","fileSharing":[{"path":"C:\tmp","cached":false},{"path":"Input-Output","cached":false}],"kubernetes":{"enabled":false,"showSystemContainers":false},"network":{"automaticDNS":true,"dns":"8.8.8.8","socksProxyPort":0,"vpnkitCIDR":"192.168.65.0/28"},"proxy":{"mode":"system","http":"","https":"","exclude":""},"resources":{"cpus":{"value":8,"min":1,"max":12},"memoryMiB":{"value":12800,"min":1024,"max":30208},"swapMiB":{"value":2048,"min":512,"max":4096},"diskSizeMiB":{"value":65536,"used":19244},"dataFolder":"C:\ProgramData\DockerDesktop\vm-data"}},"wslIntegration":{"distros":[],"enableIntegrationWithDefaultWslDistro":true}}}

Resources File sharing These directories (and their subdirectories) can be bind mounted into Docker containers. You can check the documentation for more details.

C:\tmp

edr0rlaot commented 2 years ago

same issue - Docker version 20.10.13, build a224086

juanrgm commented 2 years ago

Same case.

Docker v20.10.14

docker run -v \\wsl$\docker-desktop-data\version-pack-data\community\docker\volumes:/volumes --rm -it alpine sh

docker: Error response from daemon: can't access specified distro mount service: stat /run/guest-services/distro-services/docker-desktop-data.sock: no such file or directory.

KEMBL commented 2 years ago

the same here, performing:

docker run --entrypoint "/bin/bash" --workdir="/test" --volume="f:/testfolder:/test/data" -it testvolume on Windows 10, Docker 20.10.17

and /test/data is empty after login into container. F: drive is network attached and seen in the windows explorer.

The same result with a symlink to network location:

mklink /d "c:\temp\test" "//nethdd/workfolder"

and then adding an option

docker run --entrypoint "/bin/bash" --workdir="/test" --volume="c:\temp\test\testfolder:/test/data" -it testvolume

it gives nothing again, it seems docker is not able follow the host machine network symlinks from inside the container :(

runningoec commented 1 year ago

same here, kind of annoying when this behavior does not happen on my linux nodes.