下面是我使用gitlab和Kubernetes将应用程序部署到AWS EKS的docker文件
FROM mcr.microsoft.com/dotnet/aspnet:4.8 AS base
ARG BUILD_ENV
ENV ASPNETCORE_ENVIRONMENT=$BUILD_ENV
WORKDIR /app
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build
WORKDIR /src
COPY . /src
RUN dotnet build "WebSite2..sln" -o /app/build
FROM build AS publish
RUN dotnet publish "WebSite2..sln" -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "WebSite2.dll"]
EXPOSE 80
字符串
错误:无法解决:mcr.microsoft.com/dotnet/framework/sdk:4.8:清单中的平台不匹配
我试着把它改为4.7和4.6,但我得到了同样的错误
1条答案
按热度按时间jpfvwuh41#
您似乎在Windows上使用WSL。
如果您需要安装Windows Docker镜像而不是Linux镜像,则需要先切换到Windows镜像容器。您可以使用Docker通知图标执行此操作。之后,尝试重新安装。