Docker build can’t find NETFramework Version 5

  asp.net, centos, docker

I use a system with CentOS to host my ASP.NET Core API. I wanted to realise this with Docker. I then installed the necessary SDKs on my server.

sudo dnf install dotnet-sdk-5.0

This is the current State.

enter image description here

Then i created a Dockerfile that looks like this.

FROM microsoft/dotnet:latest

COPY ./coinz-api /app
WORKDIR /app

RUN ["dotnet", "restore"]
RUN ["dotnet", "build"]

ENV ASPNETCORE_URLS http://*:5001

EXPOSE 5001

ENTRYPOINT ["dotnet", "run"] 

When I try to build the Docker container this happens.

enter image description here

In my opinion, the required SDK and its runtimes are installed. So where is the error? Do I have the wrong versions?

EDIT: Here is my target. (Sorry its in German…)

enter image description here

Source: Docker Questions

LEAVE A COMMENT