user16695025
user16695025

Reputation:

Docker multistage build error c# (v20.10.8)

I have a microservice project and it includes docker. I am using .Net and .Net Framework. .Net 5.0 and .Net Framework 4.7.2 I don't get an error while building the project, but when I need to upload it to docker, I get an error. What is the solution ?

WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["Services/Customers/Wise.Customers/Wise.Customers.csproj", 
"Services/Customers/Wise.Customers/"]
COPY ["Services/Customers/Wise.Customers.Application/Wise.Customers.Application.csproj", 
"Services/Customers/Wise.Customers.Application/"]
COPY ["Services/Customers/Wise.Customers.Domain/Wise.Customers.Domain.csproj", 
"Services/Customers/Wise.Customers.Domain/"]
COPY ["Services/Wise.Core/Wise.Core.csproj", "Services/Wise.Core/"]
COPY ["Services/Customers/Wise.Customers.Infrastructure/Wise.Customers.Infrastructure.csproj", 
"Services/Customers/Wise.Customers.Infrastructure/"]
RUN dotnet restore "Services/Customers/Wise.Customers/Wise.Customers.csproj"
COPY . .
WORKDIR "/src/Services/Customers/Wise.Customers"
RUN dotnet build "Wise.Customers.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Wise.Customers.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Wise.Customers.dll"]

error; enter image description here

Upvotes: 0

Views: 43

Answers (0)

Related Questions