安装后Docker无法启动。

3

我尝试在Windows 10上安装Docker;我还激活了Windows功能中的WSL和虚拟化,并安装了最新的Ubuntu发行版。

但是当启动Docker时,它会比平常多等待一会儿,并显示“无法启动Docker”。

以下是我收到的第一个错误:

Docker.Core.HttpBadResponseException:
{"message":"1 error occurred:\n\t* starting WSL integration service: synchronising agents: starting added distros: 1 error occurred:\n\t* waiting for WSL integration for Ubuntu: timed out while polling for WSL distro integration to become ready in \"Ubuntu\"\n\n\n\n"}

   at Docker.Core.GoBackend.GoBackendClient.<PostNoBodyWithError>d__19.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.Core\GoBackend\GoBackendClient.cs:line 226
--- 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.WSL2.LinuxWSL2Engine.<DoStartAsync>d__11.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\LinuxWSL2Engine.cs:line 54
--- 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.<WrapAsyncInCancellationException>d__0.MoveNext() in C:\workspaces\4.16.x\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.<DoRunAsync>d__6.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 91
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__6.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 118
--- 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.EngineStateMachine.<StartAsync>d__15.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\EngineStateMachine.cs:line 72
--- 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.Engines.<StartAsync>d__23.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.Engines\Engines.cs:line 109

然后在之后的尝试中,我得到的错误不同:

Docker.Core.HttpBadResponseException:
{"message":"1 error occurred:\n\t* starting WSL integration service: integration service is already running\n\n"}

   at Docker.Core.GoBackend.GoBackendClient.<PostNoBodyWithError>d__19.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.Core\GoBackend\GoBackendClient.cs:line 226
--- 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.WSL2.LinuxWSL2Engine.<DoStartAsync>d__11.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\LinuxWSL2Engine.cs:line 54
--- 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.<WrapAsyncInCancellationException>d__0.MoveNext() in C:\workspaces\4.16.x\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.<DoRunAsync>d__6.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 91
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__6.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 118
--- 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.EngineStateMachine.<StartAsync>d__15.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\EngineStateMachine.cs:line 72
--- 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.Engines.<StartAsync>d__23.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.Engines\Engines.cs:line 109

我尝试了大部分在网上搜索到的方法。我卸载了软件,关闭了电脑并以管理员身份重新安装;但都没有用。是的,我也启用了WSL2。

然后我再次卸载并清除了系统中所有的Docker文件夹,并重新安装、关闭和安装。但仍然没有任何改变。

3个回答

4

我在Windows 11家庭版遇到了同样的问题。

以下命令解决了这个问题:

  1. 停止Docker Desktop
  2. wsl --shutdown
  3. wsl
  4. 启动Docker Desktop

1
“--start” 实际上不是一个有效的参数,但你可以直接输入“wsl”,它会启动WSL。这个方法对我很有效,谢谢! - J. Scott Elblein

1

与之前的答案类似。在我的情况下,我关闭了Docker服务和Docker桌面,然后运行wsl --shutdown命令。

接着,我使用wsl --update命令更新了wsl,安装了版本2,并启动了Docker服务和Docker桌面,一切都正常工作了。


我试过了。仍然无法启动,但是wsl已经更新了。 - prabhuraaj
PS C:\Users\prabh> wsl --shutdown PS C:\Users\prabh> wsl --update 正在安装:Windows Subsystem for Linux 已成功安装 Windows Subsystem for Linux。 PS C:\Users\prabh> wsl 处理 fstab 时,使用 mount -a 失败。<3>WSL (17) ERROR: CreateProcessEntryCommon:358: getpwuid(0) failed 2 <3>WSL (17) ERROR: CreateProcessEntryCommon:362: getpwuid(0) failed 2 <3>WSL (17) ERROR: CreateProcessEntryCommon:570: execvpe /bin/sh failed 2 <3>WSL (17) ERROR: CreateProcessEntryCommon:579: 创建的进程不应该返回。 - prabhuraaj

1

请确保您正在使用WSL 2版本。您可以使用以下命令更新版本。

wsl --set-default-version 2

更新版本后重新启动系统,问题应该得到解决。

是的,我已经完成了,并且在主要问题中也提到了。 - prabhuraaj

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接