容器映像不支持指定的OS' linux'用于容器组

发布于 2025-02-03 21:24:17 字数 709 浏览 3 评论 0原文

我试图将容器部署到Azure,并说它不支持Linux。以下是我的Docker文件代码

FROM mcr.microsoft.com/dotnet/aspnet:3.1 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build
WORKDIR /src
COPY [".csproj", "/"]
COPY [".csproj", "/"]
COPY [".csproj", "/"]
COPY [".csproj", "/"]
COPY [".csproj", "/"]
COPY [".csproj", "/"]
COPY [".csproj", "/"]
COPY [".csproj", "/"]
COPY ["T.csproj", "/"]
RUN dotnet restore "/.csproj"
COPY . .
WORKDIR "/src/E"
RUN dotnet build ".csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish ".csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "EinrideGRPCService.dll"]

I a trying to deploy the container to azure and it says it doesn't support linux. Below is my docker file code

FROM mcr.microsoft.com/dotnet/aspnet:3.1 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build
WORKDIR /src
COPY [".csproj", "/"]
COPY [".csproj", "/"]
COPY [".csproj", "/"]
COPY [".csproj", "/"]
COPY [".csproj", "/"]
COPY [".csproj", "/"]
COPY [".csproj", "/"]
COPY [".csproj", "/"]
COPY ["T.csproj", "/"]
RUN dotnet restore "/.csproj"
COPY . .
WORKDIR "/src/E"
RUN dotnet build ".csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish ".csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "EinrideGRPCService.dll"]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小帐篷 2025-02-10 21:24:17

当前,Azure容器实例不支持某些特定图像。您可以尝试在Azure门户网站上创建此图像,即使您也会获得相同的错误日志,例如

    {
    "error":{
    "code":"ImageOsTypeNotMatchContainerGroups",
    "message"; "The OS type'<null>'of image 'sagemath/sagemath-jupyter'doesnot match the OS type 'Linux' of container group 'test1'."
    }
    }

azure容器实例具有用于在隔离容器中运行的许多情况的解决方案,并且OS容器适合您的需求。但是,如果您的需求仅作为组件应用程序,则不需要将OS用作您的

场景图像,我建议您可以使用 azure容器服务(AKS)

或者,

如果要运行.NET Core,则可以使用Linux或Windows容器。如果要运行.NET框架,则需要使用Windows容器。请参阅以下 ,因此有关更多信息,请参阅

指定的-os-linux-for-container-group“>容器映像不支持针对容器组的指定OS'linux'

https://learn.microsoft.com/en-us/ap/azure/app-service/quickstart-custom-custom-container? tabs =点

Currently, Azure Container instance does not support some specific image. You could try to create this image on Azure Portal, even you will get same error log like

    {
    "error":{
    "code":"ImageOsTypeNotMatchContainerGroups",
    "message"; "The OS type'<null>'of image 'sagemath/sagemath-jupyter'doesnot match the OS type 'Linux' of container group 'test1'."
    }
    }

Azure Container Instances has solution for many scenario operate in isolated containers, and OS containers are suitable with your need. But if your need is only application as components, it doesn't necessary to use OS as your image

For your scenario, I suggest you could use Azure Container Service(aks).

Or

If you want to run .Net core you can use a Linux or Windows Container. If you want to run .Net Framework you need to use a Windows Container. Please refer the following SO thread for more information

The container image doesn`t support specified OS 'Linux' for container group

https://learn.microsoft.com/en-us/azure/app-service/quickstart-custom-container?tabs=dot

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文