简体   繁体   English

Docker Desktop无法切换到Windows Container

[英]Docker Desktop cannot switch to Windows Container

I have installed latest Docker Desktop.我已经安装了最新的 Docker 桌面。 Currently unable to switch to Windows container.目前无法切换到 Windows 容器。 The option is blocked from task bar:该选项被任务栏阻止: 选项已从 Docker Desktop 中禁用

I am running Windows 10 Home 64-bit Build 19042.我正在运行 Windows 10 Home 64 位 Build 19042。

在此处输入图像描述

This command will change from windows to linux and vice versa.此命令将从 windows 更改为 linux,反之亦然。 在此处输入图像描述

You need windows 10 Pro or Enterprise to have access to Windows containers.您需要 windows 10 Pro 或 Enterprise 才能访问 Windows 容器。

Source 资源

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 年更新:上面的链接现在提到它应该适用于

  • Windows 11 64-bit: Home or Pro version 21H2 or higher, or Enterprise or Education version 21H2 or higher. Windows 11 64 位:家庭版或专业版 21H2 或更高版本,或者企业版或教育版 21H2 或更高版本。
  • Windows 10 64-bit: Home or Pro 21H1 (build 19043) or higher, or Enterprise or Education 20H2 (build 19042) or higher. Windows 10 64 位:家庭或 Pro 21H1(内部版本 19043)或更高版本,或企业或教育版 20H2(内部版本 19042)或更高版本。

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 显示永远等待,无论如何我是这样解决的:

  1. Windows Pro Windows 亲

  2. 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.打开具有管理权限的命令提示符

  3. Type in this command:键入此命令:

    c:\Program Files\Docker\Docker\resources>dockerd.exe c:\Program Files\Docker\Docker\resources>dockerd.exe

  4. Open another command prompt with Administrative rights使用管理权限打开另一个命令提示符

    C:\Program Files\Docker\Docker>DockerCli.exe -SwitchDaemon C:\Program Files\Docker\Docker>DockerCli.exe -SwitchDaemon

  5. 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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM