Docker 桌面不会切换到 Windows 容器(在 Windows 10 上)

Docker Desktop won't switch to Windows containers (on Windows 10)

我有 Windows 10 Pro,版本 21H1。 BIOS 中启用了虚拟化,Hyper-V 是 运行。我已经为 Windows 安装了 Docker Desktop,如前所述 here。 我启动了 Docker 桌面,并且在 Linux 容器中似乎一切正常。但是,当我切换到 Windows 容器时,我不断遇到此堆栈跟踪崩溃:

Docker.Core.DockerException: Required service process has exited at Docker.Engines.DockerDaemonChecker.d__5.MoveNext() in C:\workspaces\PR-16360\src\github.com\docker\pinata\win\src\Docker.Engines\DockerDaemonChecker.cs:line 58 --- 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.Engines.WindowsContainersEngine.d__12.MoveNext() in C:\workspaces\PR-16360\src\github.com\docker\pinata\win\src\Docker.Engines\WindowsContainersEngine.cs:line 56 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Docker.Engines.WindowsContainersEngine.d__12.MoveNext() in C:\workspaces\PR-16360\src\github.com\docker\pinata\win\src\Docker.Engines\WindowsContainersEngine.cs:line 65 --- 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.ApiServices.StateMachines.TaskExtensions.d__0.MoveNext() in C:\workspaces\PR-16360\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\TaskExtensions.cs:line 29 --- 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.ApiServices.StateMachines.StartTransition.d__5.MoveNext() in C:\workspaces\PR-16360\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 67 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Docker.ApiServices.StateMachines.StartTransition.d__5.MoveNext() in C:\workspaces\PR-16360\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 92

在日志中我不断看到这一行:

msg="Error watch events stream: Error response from daemon: open \.\pipe\docker_engine_windows: The system cannot find the file specified."

我尝试了各种推荐的修复方法,例如:

cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchDaemon

没有任何效果。求大神出出主意,我都不知道怎么办了

谢谢,

你好,

索林

最后我注意到这个问题是由于我在后台有另一个杂散的 Docker 守护进程 (dockerd.exe) 运行。停止那个之后,我可以将 Docker 桌面切换到 Windows 容器。 此外,运行 现在在命令行中成功:

docker -H "npipe:////./pipe/docker_engine_windows" ps