Docker for Windows:驱动器共享因未知原因失败

Docker for Windows: Drive sharing failed for an unknown reason

环境:

`Windows 10 企业 1809 17763.864

Docker 桌面社区 2.1.0.5

尝试从 D 盘共享驱动器

docker run -it -v d:/srv/busybox/demo:/var/log busybox

守护进程抛出错误 Drive sharing failed for an unknown reason

检查 docker 日志时

[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()<---

已尝试社区的建议

  1. 正在创建具有驱动器 RWX 权限的本地用户
  2. 共享驱动器
  3. 重新启动计算机:-P
  4. 为 Windows
  5. 重置 docker
  6. 在 Windows 和 Linux 容器之间切换
  7. 正在为 windows
  8. 重新安装 Docker
  9. 禁用 Firewall/Antivirus 软件

但没有任何帮助!

罪魁祸首是 SAMBA 加密。禁用加密后效果很好

错误:无法共享 C 盘 #1637 https://github.com/docker/for-win/issues/1637

错误:禁用加密不是一个选项,也不是低于 3 的 SMB #5342 https://github.com/docker/for-win/issues/5342

但不建议这样做,因此在 Docker 的当前边缘版本中,windows 已从 SAMBA 中移除。

因此为 Windows Edge 2.1.7.0(41536) 或更高版本安装 Docker 解决了这个问题。

您可能面临从稳定的 2.1.0.5(当前)切换到边缘通道

错误:Docker Windows 上的桌面无法切换到 Edge #4672 https://github.com/docker/for-win/issues/4672(打开)

您可以卸载稳定版并从 https://docs.docker.com/docker-for-windows/edge-release-notes/

下载边缘版

对我来说,为 Windows Edge 2.1.7.0(41536) 安装 Docker 解决了这个问题。