首页 > 解决方案 > 在 ECS 中使用哪个 ASP.NET Windows 容器镜像?基本映像中的 Windows Docker 容器与 Amazon ECS 的兼容性问题

问题描述

我已经创建了一个像这样的 Dockerfile,用于部署我的 ASP.NET 应用程序:

# The `FROM` instruction specifies the base image. You are
# extending the `microsoft/aspnet` image.

FROM microsoft/aspnet:4.7.2-windowsservercore-1709

#WORKDIR /inetpub/wwwroot

# The final instruction copies the site you published earlier into the container.
COPY ./bin/Release/Publish/ /inetpub/wwwroot

现在根据文档,这应该使用 Windows Server build 10.0.14393。但是,当我构建此容器,将其推送到 Amazon Elastic Container Registry,然后将此容器映像部署到 Amazon Elastic Container Service [ECS](在 Windows EC2 机器上运行)时,我收到此错误:

CannotPullContainerError:基于 Windows 版本 10.0.16299 的映像与 10.0.14393 主机不兼容

有没有人成功地将 ASP.NET Windows Docker 容器部署到 Amazon ECS?如果是这样,您使用了哪个基础映像?

提前致谢!

更新:也尝试了这个基本图像,它给出了同样的错误:microsoft/aspnet:4.6.2-windowsservercore-ltsc2016

标签: asp.netwindowsdockercontainersamazon-ecs

解决方案


1709 图像与 sac-2016 主机操作系统不兼容。您需要将主机操作系统升级到 1709 或将容器映像降级到 sac-2016


推荐阅读