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