我已经能够从Azure Build Pipeline进行构建和推送,但是相同的dockerfile在Azure Release Pipeline中不起作用。我的应用程序是.Net Core 2.2,它没有任何其他特殊要求,因此我可以更改基本映像版本。
我当前的docker文件:
# ignore-caching-for-signing
我的管道任务的Yaml是:
FROM mcr.microsoft.com/dotnet/core/runtime:2.2-stretch-slim AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch AS build
WORKDIR /src
COPY ["CoffeeFix.Console/CoffeeFix.Console.csproj", "CoffeeFix.Console/"]
RUN dotnet restore "CoffeeFix.Console/CoffeeFix.Console.csproj"
COPY . .
WORKDIR "/src/XX.Console"
RUN dotnet build "XX.Console.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "XX.Console.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "XX.Console.dll"]
构建进行到 步骤6/21:运行dotnet还原“ XX.Console / XX.Console.csproj”
,但随后出现失败容器的操作系统与主机的操作系统不匹配。
有关此信息,我需要为docker run命令指定一个参数:-isolation = hyperv
“发布管道”任务似乎没有添加参数和/或编辑基础yaml文件的方法。我只是在DevOps门户中缺少什么吗?
是否有办法和/或没有人有使Azure DevOps Release Pipeline buildandpush任务正常工作的示例?