Error in building docker image from .Net application

Viewed 36

I am trying to build up docker image through simple .Net application but it gives error :

[build-env 5/5] RUN dotnet publish -c Release -o out:

#12 0.772 MSBuild version 17.3.1+2badb37d1 for .NET
#12 1.451   Determining projects to restore...
#12 1.753   All projects are up-to-date for restore.
#12 1.812 /app/WebApplication1.csproj(144,3): error MSB4019:

**My docker file : **

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
WORKDIR /app


COPY . ./

RUN dotnet restore

RUN dotnet publish -c Release -o out

FROM mcr.microsoft.com/dotnet/aspnet:6.0
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "WebApplication1.dll"]
0 Answers
Related