I have create asp.net core web api and I am trying to build the docker image using azure devops but it’s throwing error on the copy command.
**Erros:
#8 ERROR: failed to calculate checksum of ref e47e7669-35e6-4532-94ca-a2b577895d60::t0eq4p4a1jx7z8dkx4wqsmjq2: “/Weather.Library/Weather.Library.csproj”: not found
#9 ERROR: failed to calculate checksum of ref e47e7669-35e6-4532-94ca-a2b577895d60::t0eq4p4a1jx7z8dkx4wqsmjq2: “/Weather.API/Weather.API.csproj”: not found**
Docker file:
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["Weather.API/Weather.API.csproj", "Weather.API/"]
COPY ["Weather.Library/Weather.Library.csproj", "Weather.Library/"]
RUN dotnet restore "./Weather.API/Weather.API.csproj"
COPY . .
WORKDIR "/src/Weather.API"
RUN dotnet build "./Weather.API.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./Weather.API.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Weather.API.dll"]