[英]Docker Desktop won't switch to Windows containers (on Windows 10)
I have Windows 10 Pro, version 21H1.我有 Windows 10 Pro,版本 21H1。 Virtualization is enabled in BIOS, Hyper-V is running. BIOS 中启用了虚拟化,Hyper-V 正在运行。 I've installed Docker Desktop for Windows, as described here .我已经为 Windows 安装了 Docker Desktop,如此处所述。 I start the Docker Desktop and all seems to work fine with Linux containers.我启动了 Docker 桌面,似乎一切都与 Linux 容器一起工作。 However, when I switch to Windows containers, I keep getting a crash with this stacktrace:但是,当我切换到 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\WindowsC Docker.Core.DockerException:所需服务进程已退出 Docker.Engines.DockerDaemonChecker.d__5.MoveNext() 在 C:\workspaces\PR-16360\src\github.com\docker\pinata\win\src\Docker.Engines \DockerDaemonChecker.cs:line 58 --- 从先前抛出异常的位置开始的堆栈跟踪结束 --- 在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)在 Docker.Engines.WindowsContainersEngine.d__12.MoveNext() 在 C:\workspaces\PR-16360\src\github.com\docker\pinata\win\src\Docker.Engines\WindowsContainersEngine.cs:line 56 --- 结束来自先前抛出异常的位置的堆栈跟踪 --- 在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在 Docker.Engines.WindowsContainersEngine.d__12.MoveNext() 在 C:\workspaces\PR-16360\src\github .com\docker\pinata\win\src\Docker.Engines\WindowsC ontainersEngine.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 thr ontainersEngine.cs:第 65 行 --- 从先前抛出异常的位置开始的堆栈跟踪结束 --- 在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)在Docker.ApiServices.StateMachines.TaskExtensions.d__0.MoveNext() 在 C:\workspaces\PR-16360\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\TaskExtensions.cs:line 29 - -- 从先前抛出异常的位置开始的堆栈跟踪结束 --- 在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 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 --- 堆栈跟踪结束来自以前发生异常的位置own --- 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自己 --- 在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在 Docker.ApiServices.StateMachines.StartTransition.d__5.MoveNext() 在 C:\workspaces\PR-16360\src\github.com\docker\pinata\ win\src\Docker.ApiServices\StateMachines\StartTransition.cs: 第 92 行
In the logs I keep seeing this line:在日志中,我一直看到这一行:
msg="Error watch events stream: Error response from daemon: open \\.\pipe\docker_engine_windows: The system cannot find the file specified." msg="错误监视事件 stream:来自守护程序的错误响应:打开 \\.\pipe\docker_engine_windows:系统找不到指定的文件。"
I tried various recommended fixes, such as:我尝试了各种推荐的修复方法,例如:
cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchDaemon
Nothing works.什么都不管用。 Please give me some ideas, I don't know what to do anymore.请给我一些想法,我不知道该怎么办了。
Thanks,谢谢,
Greetings,你好,
Sorin索林
Finally I noticed that the issue was due to the fact I had another, stray Docker daemon (dockerd.exe) running in the background.最后我注意到这个问题是由于我有另一个在后台运行的流浪 Docker 守护进程 (dockerd.exe)。 After stopping that one, I could switch the Docker Desktop to Windows containers.停止那个之后,我可以将 Docker 桌面切换到 Windows 容器。 Also, running this in a command line is now successful:此外,现在在命令行中运行它是成功的:
docker -H "npipe:////./pipe/docker_engine_windows" ps
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.