Docker - 镜像操作系统“windows”不能在这个平台上使用

新手上路,请多包涵

我在我的 Windows 10 机器上试过这个:

Dockerfile:

 From microsoft/nanoserver
CMD ["echo", "Hello World"]

附言

C:\FSD\Docker\Trial1> docker build -t lea/leatest .
Sending build context to Docker daemon  2.048kB
Step 1/2 : FROM microsoft/nanoserver
latest: Pulling from microsoft/nanoserver
bce2fbc256ea: Pulling fs layer
58f68fa0ceda: Pulling fs layer
image operating system "windows" cannot be used on this platform

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

阅读 1.4k
1 个回答

您的 Docker 主机配置为在 VM 内运行 Linux 容器。要运行 Windows 容器,您需要右键单击系统托盘中的 Docker 图标,然后在 Docker 菜单中选择“切换到 Windows 容器…”。此选项在 Windows 的“家庭”版本中不可用。文档 可在此处获得


显示任务栏中 Docker 图标位置的屏幕截图

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

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