Docker——镜像操作系统“windows"不能在这个平台上使用 [英] Docker - image operating system "windows" cannot be used on this platform

查看:33
本文介绍了Docker——镜像操作系统“windows"不能在这个平台上使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Dockerfile:

来自 microsoft/nanoserverCMD [回声",你好世界"]

PS

C:FSDDockerTrial1>docker build -t lea/leatest .将构建上下文发送到 Docker 守护进程 2.048kB第 1/2 步:来自 microsoft/nanoserver最新:从 microsoft/nanoserver 拉取bce2fbc256ea: 拉取 fs 层58f68fa0ceda: 拉取 fs 层图像操作系统windows"不能在这个平台上使用

解决方案

您的 Docker 主机配置为在 VM 内运行 Linux 容器.要运行 Windows 容器,您需要在 Docker 菜单中切换到 Windows 容器".相关文档

I tried this on my Windows 10 machine:

Dockerfile:

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

PS

C:FSDDockerTrial1> 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

解决方案

Your Docker host is configured to run Linux containers inside of a VM. To run Windows containers, you need to "Switch to Windows containers" in the Docker menu. Documentation on that is available here.


这篇关于Docker——镜像操作系统“windows"不能在这个平台上使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆