Docker friendlyhello 构建失败
Docker friendlyhello failing to build
我已经创建了 Getting Started 文档中描述的 Docker 文件。构建步骤失败如下:
PS > docker build -t friendly-hello .
Sending build context to Docker daemon 60.93kB
Step 1/7 : FROM python:2.7-slim
2.7-slim: Pulling from library/python
no matching manifest for windows/amd64 in the manifest list entries
我怀疑是因为我正在使用 Windows 容器,而文档尚未更新以包含此内容。
我该如何纠正这个错误?
对于为什么经常使用 Docker 的人来说,解决方案可能是显而易见的,但是,对于像我这样的新手,这里是错误的原因和解决方案。
我正在使用 Windows 个容器,而不是文档所针对的 Linux 个容器。
# Use an official Python runtime as a parent image
FROM python:2.7-slim
这告诉 Docker Docker 集线器中名为 python
并标记为 2.7-slim
的图像存在依赖性。您可以通过浏览至 https://hub.docker.com and searching for python
. Clicking on the python will take you to the python repository page.
找到
标签上的信息并没有清楚地表明哪些标签支持哪些架构,但是有些标签名称中有 windowsservercore
,这非常强烈地表明这些标签支持 windows.
将请求 python:2-7-slim
的行更改为 python:2.7.15-windowsservercore
解决了问题,即:
FROM python:2.7.15-windowsservercore
我已经创建了 Getting Started 文档中描述的 Docker 文件。构建步骤失败如下:
PS > docker build -t friendly-hello .
Sending build context to Docker daemon 60.93kB
Step 1/7 : FROM python:2.7-slim
2.7-slim: Pulling from library/python
no matching manifest for windows/amd64 in the manifest list entries
我怀疑是因为我正在使用 Windows 容器,而文档尚未更新以包含此内容。
我该如何纠正这个错误?
对于为什么经常使用 Docker 的人来说,解决方案可能是显而易见的,但是,对于像我这样的新手,这里是错误的原因和解决方案。
我正在使用 Windows 个容器,而不是文档所针对的 Linux 个容器。
# Use an official Python runtime as a parent image
FROM python:2.7-slim
这告诉 Docker Docker 集线器中名为 python
并标记为 2.7-slim
的图像存在依赖性。您可以通过浏览至 https://hub.docker.com and searching for python
. Clicking on the python will take you to the python repository page.
标签上的信息并没有清楚地表明哪些标签支持哪些架构,但是有些标签名称中有 windowsservercore
,这非常强烈地表明这些标签支持 windows.
将请求 python:2-7-slim
的行更改为 python:2.7.15-windowsservercore
解决了问题,即:
FROM python:2.7.15-windowsservercore