编程技术网

关注微信公众号,定时推送前沿、专业、深度的编程技术资料。

 找回密码
 立即注册

QQ登录

只需一步,快速开始

极客时间

我的Docker无法在Windows 10 Pro上启动:My Docker is failing to launch on my Windows 10 Pro

mmatloka 云计算 2022-5-10 15:05 7人围观

腾讯云服务器
我的Docker无法在Windows 10 Pro上启动的处理方法

我在Windows 10专业版PC上设置Docker时遇到了一些问题.当我尝试打开它时,我得到了这个崩溃报告:

您会看到Debian/Ubuntu/kali-linux的版本设置为2.

但是docker-desktop也在使用版本2.

我的解决方法是

  1. 打开开始"菜单并卸载Debian/Ubuntu/kali-linux
  1. 卸载Docker
  2. 转到控制面板>程序>程序和功能,并禁用Linux的Windows子系统
  1. 现在重新启动计算机.
  2. 重新登录,再次启用Linux的Windows子系统,然后重新安装Debian/Ubuntu/kali-linux
  3. 现在再次安装Docker,但这一次取消选中为WSL 2安装所需的Windows组件"

..我知道这不是一个好消息,但这是我如何解决的.

将WSL2降级为WSL1将无济于事.

I have had some problems with setting up Docker on my Windows 10 pro PC. I get this crash report when I try to open it up:

Crash Report screenshot

This is the text that is inside of the box:

System.InvalidOperationException:
Failed to deploy distro docker-desktop to C:\Users\Imogen\AppData\Local\Docker\wsl\distro: exit code: -1
 stdout: Access is denied.


 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

I have checked my visualization settings and it is enabled. My BIOS is legacy, not sure if UEFI Firmware settings are needed for Docker. My Hyper-V is also enabled in Windows Features. I have also been accessing docker with an authorized cmd. Any advice or suggestions will be much appreciated!

解决方案

This is happening because there is an incompatibility between WSL2 and Docker.

If you run wsl -l -v I'm quite sure you will see this:

As you can see the VERSION for Debian/Ubuntu/kali-linux is set to 2.

But also docker-desktop is using version 2.

My solution was to

  1. open the Start menu and uninstall Debian/Ubuntu/kali-linux
  1. Uninstall Docker
  2. Go to Control Panel > Programs > Programs and Features and disable Windows Subsystem for Linux
  1. Now reboot your machine.
  2. Log back in, enable once again Windows Subsystem for Linux and reinstall Debian/Ubuntu/kali-linux
  3. Now install Docker again but this time at this step untick "Install required Windows components for WSL 2"

..I know this is not a good news but this is how I fixed it.

Downgrading WSL2 to WSL1 won't help.

这篇关于我的Docker无法在Windows 10 Pro上启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程技术网(www.editcode.net)!

腾讯云服务器 阿里云服务器
关注微信
^