Docker 启动失败

新手上路,请多包涵

我已经安装了 Docker,然后我启动了 Docker。 Docker 说“Docker 正在启动”。然后,Docker 说“Docker 无法启动”。拜托,你能帮帮我吗?

Docker 错误详情:

 System.InvalidOperationException:
Failed to deploy distro docker-desktop to C:\Users\---\AppData\Local\Docker\wsl\distro: exit code: -1
 stdout: The operation could not be started because a required feature is not installed.

 stderr:
   at Docker.ApiServices.WSL2.WslShortLivedCommandResult.LogAndThrowIfUnexpectedExitCode(String prefix, ILogger log, Int32 expectedExitCode) in C:\workspaces\PR-15138\src\github.com\docker\pinata\win\src\Docker.ApiServices\WSL2\WslCommand.cs:line 146
   at Docker.Engines.WSL2.WSL2Provisioning.<DeployDistroAsync>d__17.MoveNext() in C:\workspaces\PR-15138\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\WSL2Provisioning.cs:line 169
--- 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.WSL2Provisioning.<ProvisionAsync>d__8.MoveNext() in C:\workspaces\PR-15138\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\WSL2Provisioning.cs:line 78
--- 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__25.MoveNext() in C:\workspaces\PR-15138\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\LinuxWSL2Engine.cs:line 99
--- 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\PR-15138\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__5.MoveNext() in C:\workspaces\PR-15138\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.<DoRunAsync>d__5.MoveNext() in C:\workspaces\PR-15138\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 92
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Docker.Engines.Engines.<WaitCurrentTransitionsAsync>d__30.MoveNext() in C:\workspaces\PR-15138\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\Engines.cs:line 358
--- 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.<RestartAsync>d__26.MoveNext() in C:\workspaces\PR-15138\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\Engines.cs:line 250

原文由 Yavuz Yoldaş 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 2k
2 个回答

我的解决方案:

我已经检查了 Docker 的 先决条件。我已经应用了先决条件的第二步。 ( 带有手动安装步骤的 Linux 安装的 Windows 子系统)它为我修复了错误。


如果您收到这样的错误(在此安装过程中):

WslRegisterDistribution failed with error: 0x80370114 Error: 0x80370114 The operation could not be started because a required feature is not installed. (我遇到了这个错误。)请应用 这个

  These steps are quoted from the "this" named hyperlink above.
1. Open "Windows Security"
2. Open "App & Browser control"
3. Click "Exploit protection settings" at the bottom
4. Switch to "Program settings" tab
5. Locate "C:\WINDOWS\System32\vmcompute.exe" in the list and expand it
6. Click "Edit"
7. Scroll down to "Code flow guard (CFG)" and uncheck "Override system settings"
8. Start vmcompute from powershell "net start vmcompute"
9. Then go back and command wsl --set-default-version 2


我已经解决了这样的问题。祝你好运 :)

原文由 Yavuz Yoldaş 发布,翻译遵循 CC BY-SA 4.0 许可协议

在我的场景中,我需要安装 WSL 2 而我的计算机没有它。安装它使 docker 成功运行。如果您是第一次安装 docker,请尝试以下步骤。

首先,我们需要从 Windows 激活 WSL。

控制面板 -> 程序 -> 打开或关闭 Windows 功能

你需要检查

  • 适用于 Linux 的 Windows 子系统
  • Windows 管理程序平台
  • 虚拟机平台

然后点击确定

打开或关闭 Windows 功能

之后,您需要启用 WSL 1 并将其更新到 WSL 2 ( https://learn.microsoft.com/en-us/windows/wsl/install-win10#manual-installation-steps )

要安装内置的 WSL 1,请以管理员身份打开 PowerShell 并运行:

 dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

之后从 Microsoft 下载 WSL 2 更新。在下面使用: 用于 x64 机器的 WSL2 Linux 内核更新包

安装上述包后,需要将 WSL 2 设置为默认版本。

以管理员身份打开 PowerShell 并运行:

 wsl --set-default-version 2

现在重新启动您的计算机。现在你的 docker 应该可以工作了。

请注意,要更新到 WSL 2,您必须运行 Windows 10。

  • 对于 x64 系统:版本 1903 或更高版本,带有 Build 18362 或更高版本。
  • 对于 ARM64 系统:版本 2004 或更高版本,带有 Build 19041 或更高版本。

原文由 Menuka Ishan 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题