容器映像不支持指定的OS' linux'用于容器组
我试图将容器部署到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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当前,Azure容器实例不支持某些特定图像。您可以尝试在Azure门户网站上创建此图像,即使您也会获得相同的错误日志,例如
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
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