Azure pipeline failing to build image #405
-
I am hosting my own build-agent on my on-premises windows server. What I want, is to be able to build this image without the errors.
Please note that it also does not work on an agent from DevOps itself (windows-2022) Directories: FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
ENV ASPNETCORE_URLS=https://+:5005;http://+:5006
WORKDIR /app
EXPOSE 5005
EXPOSE 5006
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /
COPY ["src/Server/Server.csproj", "src/Server/"]
COPY ["src/Application/Application.csproj", "src/Application/"]
COPY ["src/Domain/Domain.csproj", "src/Domain/"]
COPY ["src/Shared/Shared.csproj", "src/Shared/"]
COPY ["src/Infrastructure.Shared/Infrastructure.Shared.csproj", "src/Infrastructure.Shared/"]
COPY ["src/Infrastructure/Infrastructure.csproj", "src/Infrastructure/"]
COPY ["src/Client/Client.csproj", "src/Client/"]
COPY ["src/Client.Infrastructure/Client.Infrastructure.csproj", "src/Client.Infrastructure/"]
RUN dotnet restore "src/Server/Server.csproj" --disable-parallel
COPY . .
WORKDIR "src/Server"
RUN dotnet build "Server.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Server.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
WORKDIR /app/Files
WORKDIR /app
ENTRYPOINT ["dotnet", "DeDenDannenburcht.Server.dll"] My Pipeline Pipeline Output
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I have found the answer by asking stackoverflow. With the help, we found that Azure DevOps does not like docker files that are in a nested directory for some reason. By moving the docker file to the root project folder (where the ignore files are), it was possible to successfully build the image from the build pipeline. |
Beta Was this translation helpful? Give feedback.
I have found the answer by asking stackoverflow. With the help, we found that Azure DevOps does not like docker files that are in a nested directory for some reason. By moving the docker file to the root project folder (where the ignore files are), it was possible to successfully build the image from the build pipeline.