I am trying to run an asp.net core web application from Dockers container without using Visual Studio but it is not running. I am following the steps listed in this tutorial on Microsoft site.
I have successfully done everything which are:
- Creating Image.
- Creating and running container with the ASP.NET Core Application.
The Dockers desktop shows that the image and container are both running.
The image (testn) screenshot:
The container (myapp) screenshot:
Now when I open the app url in the browser which is "http://localhost:8080/. I get "This page isn’t working" message. See below image:
My Dockerfile code is:
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build-env
WORKDIR /app
# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore
# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out
# Build runtime image
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "Testn.dll"]
I am using Lixus container in Dockers Desktop. My laptop OS is Windows 10 Home.
What I am missing?