I have Microsoft Orleans application with .net8.0 framework
Project file myApp.csproj
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
also the docker file
# Stage 1: Build the application
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
# Set the working directory
WORKDIR /app
# Copy the project files and restore dependencies
COPY *.csproj ./
RUN dotnet restore
# Copy the remaining source files and build the application
COPY . ./
RUN dotnet publish -c Release -o out
# Stage 2: Build the runtime image
FROM mcr.microsoft.com/dotnet/runtime:8.0
# Set the working directory
WORKDIR /app
# Copy the build output from the build stage
COPY --from=build-env /app/out .
# Expose the gRPC port
EXPOSE 6565
# Define the entry point for the application
ENTRYPOINT ["dotnet", "myApp.dll"]
I am building docker image with the following command
docker build -t myApp:latest .
then to run docker container using following command
docker run -d -p 6565:6565 --name myApp myApp:latest
it gives me an error
You must install or update .NET to run this application.
App: /app/myApp.dll
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '8.0.0' (x64)
.NET location: /usr/share/dotnet/
The following frameworks were found:
6.0.31 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=8.0.0&arch=x64&rid=debian.11-x64
As my app exposing grpc endpoint on 6565 I tried to change to http but it is giving me same error.
any help on above error would be appreciated and I have very basic knowledge of docker.