[英]Docker Desktop cannot switch to Windows Container
You need windows 10 Pro or Enterprise to have access to Windows containers.您需要 windows 10 Pro 或 Enterprise 才能访问 Windows 容器。
The other answer will indeed switch your daemon mode to Windows, but you will not be able to pull any Windows container.另一个答案确实会将您的守护程序模式切换到 Windows,但您将无法拉出任何 Windows 容器。
Update 2022 : The link above now mentions that it should work for 2022 年更新:上面的链接现在提到它应该适用于
I had spent hours debugging this issue and have to purchase win 10 pro license as well but still faced the same issue, by default it takes linux containers, switching to windows shows waiting forever, anyway here is how I fixed:我花了几个小时调试这个问题,也不得不购买 win 10 专业版许可证,但仍然面临同样的问题,默认情况下它需要 linux 个容器,切换到 windows 显示永远等待,无论如何我是这样解决的:
Windows Pro Windows 亲
Close/Shutt down the client by right clicking on the tiny icon on taskbar, and wait for a minute or two to have it close itself.通过右键单击任务栏上的小图标关闭/关闭客户端,然后等待一两分钟让它自行关闭。 3.Open command prompt with Administrative rights 3.打开具有管理权限的命令提示符
Type in this command:键入此命令:
c:\Program Files\Docker\Docker\resources>dockerd.exe c:\Program Files\Docker\Docker\resources>dockerd.exe
Open another command prompt with Administrative rights使用管理权限打开另一个命令提示符
C:\Program Files\Docker\Docker>DockerCli.exe -SwitchDaemon C:\Program Files\Docker\Docker>DockerCli.exe -SwitchDaemon
Type "C:\Program Files\Docker\Docker>docker version" command to make sure it has switched to windows containers, it should look like attached screenshot键入“C:\Program Files\Docker\Docker>docker version”命令以确保它已切换到 windows 容器,它应该看起来像附件截图 as per the latest Docker Desktop version, your settings should look like this根据最新的 Docker 桌面版,您的设置应该如下所示
Quit Docker Desktop, and open again, Hope it helps some.退出Docker桌面,重新打开,希望对大家有所帮助。
I could not switch it easily, even using Altaf's approach.即使使用 Altaf 的方法,我也无法轻松切换它。 Eventually I went to Services (services.msc) and disabled Docker Desktop Service and updated docker service (Docker Engine) to make sure it can automatically start (for example, make sure the daemon.json config file exists in the location as the service command specified).最后我去了服务(services.msc)并禁用了 Docker 桌面服务并更新了 docker 服务(Docker 引擎)以确保它可以自动启动(例如,确保 daemon.json 配置文件作为服务命令存在于该位置指定的)。 Then I can verify the result by typing docker version (in non-Administrative command prompt).然后我可以通过键入 docker 版本(在非管理命令提示符下)来验证结果。
https://kontext.tech/article/1216/how-to-change-docker-data-root-path-on-windows-10#h-switch-to-windows-containers https://kontext.tech/article/1216/how-to-change-docker-data-root-path-on-windows-10#h-switch-to-windows-containers
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.