file not found in build context or excluded by .dockerignore

Viewed 44

enter image description here

when I'm running docker build. then I shows this error can anyone please help me to fix that error

FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base 
WORKDIR /app 
EXPOSE 80 

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build 
WORKDIR /src 
COPY ["examroom.itembanking-main.csproj", "./"] 
RUN dotnet restore "examroom.itembanking-main.csproj" 
COPY . . 
WORKDIR "/src/." 
RUN dotnet build "examroom.itembanking-main.csproj" -c Release -o /app/build 

FROM build AS publish 
RUN dotnet publish "examroom.itembanking-main.csproj" -c Release -o /app/publish 

FROM base AS final 
WORKDIR /app 
COPY --from=publish /app/publish . 
ENTRYPOINT ["dotnet", "examroom.itembanking-main.dll"]
0 Answers
Related