ASPNETCORE 容器在 linux 服务器上加载,但 "image operating system "windows“无法在此平台上使用”

ASPNETCORE containers loading on linux server, but "image operating system "windows" cannot be used on this platform"

另一天,另一个 docker 问题。 我目前正在一个容器中开发一个 aspnetcore 应用程序,我想在 Ubuntu 18.04 上 运行。 这是我的 Dockerfile:

FROM microsoft/aspnetcore:2.0 AS base
WORKDIR /app
EXPOSE 80

FROM microsoft/aspnetcore-build:2.0 AS build
RUN dotnet restore FOLDER
RUN dotnet build FOLDER
FROM build AS publish
RUN dotnet publish
(I didn't put names or some steps as copy)

在我的部署CI中,它returns图像操作系统"windows"无法在此平台上使用。我已经直接在服务器上拉取了那 2 个图像,它们拉得很好。

我最初使用 --isolation=hyperv 构建。

我对 linux 容器和服务器很陌生,因此我不确定问题出在哪里...

感谢您的帮助!

基本上,您不能在 Linux 中 运行 windows 个容器。

取自

容器不用于虚拟化,它们正在使用主机的资源。因此,目前 windows 容器不能 运行 "as-is" 在 linux 机器上。 但是 - 您可以使用 VM 来完成 - 因为它适用于 windows。您可以在 linux 主机上安装 windows VM,这将允许 运行 windows 个容器。