启动Docker Desktop失败,无法安装Laravel求助(Win10+WSL2环境)
问题描述
- 系统环境:Windows 10
- 已完成安装项:WSL2、Docker Desktop、Ubuntu、XAMPP
- 故障表现:
- Docker Desktop启动失败,抛出IPC请求超时错误
- 无法创建Laravel项目,终端提示
docker is not running
完整错误日志
Docker.Core.HttpBadResponseException: {"message":"checking windows features: Post \"http://ipc/windowsfeatures/check\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"} at Docker.Core.Logging.HttpClientExceptionInterceptor.<InterceptResponseAsync>d__0.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.Core\Logging\HttpClientExceptionInterceptor.cs:line 26 --- 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.Core.IPC.Client.<SendAsync>d__5.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.Core\IPC\Client.cs:line 42 --- 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 System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() --- 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.Core.GoBackend.GoBackendClient.<WSLEngineCheckPreconditions>d__42.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.Core\GoBackend\GoBackendClient.cs:line 405 --- 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.<DoCheckPreconditionsAsync>d__19.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\LinuxWSL2Engine.cs:line 139 --- 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 86 --- 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
解决方案
1. 确认Windows必需功能启用
- 按下
Win + R,输入optionalfeatures.exe打开Windows功能窗口 - 确保以下功能已勾选:
- 适用于Linux的Windows子系统
- 虚拟机平台
- 未勾选则勾选后重启系统
2. 重置WSL2环境
- 打开管理员权限的PowerShell,依次执行命令:
wsl --shutdown wsl --unregister Ubuntu wsl --install -d Ubuntu - 重新设置Ubuntu的用户名和密码
3. 配置Docker Desktop与WSL2集成
- 卸载现有Docker Desktop,重新安装最新稳定版
- 启动Docker Desktop后进入
Settings > Resources > WSL Integration - 勾选你的Ubuntu发行版,点击
Apply & Restart
4. 验证Docker运行状态
- 打开Ubuntu终端,执行:
docker --version docker run hello-world - 能正常输出版本信息并运行测试容器,说明Docker已恢复正常
5. 创建Laravel项目
- 在Ubuntu终端执行Laravel Docker初始化命令:
curl -s https://laravel.build/example-app | bash cd example-app ./vendor/bin/sail up
内容的提问来源于stack exchange,提问作者lakshitha dilhan
相关产品推荐
相关产品推荐

