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

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

Dockerfile:

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

PS

 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 

您的Docker主机被configuration为在虚拟机内运行Linux容器。 要运行Windows容器,需要在Docker菜单中“切换到Windows容器”。 这方面的文档可以在这里find 。

你需要去任务栏 – >右键单击泊坞窗图标 – >使用选项切换到Windows容器…
https://docs.docker.com/docker-for-windows/ 在这里输入图像说明