问题
ENV:
`Windows 10 Enterprise 1809 17763.864
Docker Desktop Community 2.1.0.5
Tried sharing drive from D drive
docker run -it -v d:/srv/busybox/demo:/var/log busybox
daemon throw errors as Drive sharing failed for an unknown reason
when checked for docker logs
[17:07:54.721][Moby ][Info ] [ 866.663149] CIFS VFS: SMB3 encryption not supported yet
[17:07:54.757][Moby ][Info ] [ 866.698107] CIFS VFS: SMB3 encryption not supported yet
[17:07:54.797][Moby ][Info ] [ 866.729911] CIFS VFS: SMB signature verification returned error = -13
[17:07:54.835][Moby ][Info ] [ 866.770682] CIFS VFS: SMB signature verification returned error = -13
[17:07:54.841][SambaShare ][Error ] Unable to mount D drive: unexpected error: System.AggregateException: One or more errors occurred. ---> Docker.Backend.HttpBadResponseException: Exception of type 'Docker.Backend.HttpBadResponseException' was thrown.
at Docker.Backend.HttpClientExtensions.<ParseResponseBodyAsJsonAsync>d__2`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Backend.HttpClientExtensions.<PostJsonWithJsonResponseAsync>d__1`1.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Docker.Backend.LifecycleClient.Mount(MountRequest req)
at Docker.Backend.SambaShare.MountInMoby(String drive, Credential cred, UserNameAndDomain info, String options, String ip)
---> (Inner Exception #0) Docker.Backend.HttpBadResponseException: Exception of type 'Docker.Backend.HttpBadResponseException' was thrown.
at Docker.Backend.HttpClientExtensions.<ParseResponseBodyAsJsonAsync>d__2`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Backend.HttpClientExtensions.<PostJsonWithJsonResponseAsync>d__1`1.MoveNext()<---
Suggestion from communities tried
- Creating a local user with RWX rights to drive
- Sharing the drive
- Restarting the computer :-P
- Resetting the docker for Windows
- Switching from and to Windows and Linux containers
- Reinstalling Docker for windows
- Disabling Firewall/Antivirus Software
but nothing helped!
回答1:
The culprit was SAMBA encryption. With encryption disabled it works great
Bug: Unable to share C drive #1637 https://github.com/docker/for-win/issues/1637
Bug: Encryption disabling is not an option nor SMB below 3 #5342 https://github.com/docker/for-win/issues/5342
But it's not recommended so in current edge releases of Docker for windows has moved away from SAMBA.
so installing Docker for Windows Edge 2.1.7.0(41536) or later resolved the issue.
You might face switching to edge channel from stable 2.1.0.5 (current)
Bug: Docker Desktop on Windows unable to switch to Edge #4672 https://github.com/docker/for-win/issues/4672 (OPEN)
You can uninstall the stable release and download the edge release from https://docs.docker.com/docker-for-windows/edge-release-notes/
for me installing Docker for Windows Edge 2.1.7.0(41536) solved the issue.
来源:https://stackoverflow.com/questions/59555010/docker-for-windows-drive-sharing-failed-for-an-unknown-reason