'Dockerize compatible framework version
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.
- The following frameworks were found: 6.0.3 at [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] You can resolve the problem by installing the specified framework and/or SDK. The specified framework can be found at:
- https://aka.ms/dotnet-core-applaunch?framework=Microsoft.AspNetCore.App&framework_version=5.0.0&arch=x64&rid=debian.11-x64
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
