Home:ALL Converter>Dockerize compatible framework version

Dockerize compatible framework version

Ask Time:2022-04-12T20:20:30         Author:Ferhat Arslan

Json Formatter

i want to dockerize my microservices. But i getting this error.

It was not possible to find any compatible framework version The framework 'Microsoft.AspNetCore.App', version '5.0.0' (x64) was not found.

And this is my Dockerfile.

FROM mcr.microsoft.com/dotnet/sdk:6.0.3 as build
WORKDIR /app
EXPOSE 80
COPY Shared/FreeCourse.Shared/*.csproj Shared/FreeCourse.Shared/
COPY Services/Catalog/FreeCourse.Services.Catalog/*.csproj Services/Catalog/FreeCourse.Services.Catalog/
RUN dotnet restore Services/Catalog/FreeCourse.Services.Catalog/*.csproj 
COPY . .
RUN dotnet publish Services/Catalog/FreeCourse.Services.Catalog/*.csproj -c Release -o out
FROM mcr.microsoft.com/dotnet/aspnet:6.0.3 as runtime
WORKDIR /app
COPY --from=build /app/out .
ENTRYPOINT ["dotnet","FreeCourse.Services.Catalog.dll"]

Can you help me ?

Thank you.

Author:Ferhat Arslan,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/71842620/dockerize-compatible-framework-version
yy