Why is the aspnet kernel running on port 80 from Docker?

TL DR: Why is the underlying aspnet application running on port 80 from the Docker image, but 5000 outside the docker image.

Elaborate

I got acquainted with the aspnet core / docker tutorial: https://docs.microsoft.com/en-us/dotnet/core/docker/building-net-docker-images

Halfway through the page, I launch the application as prescribed:

dotnet run

Above all else, it prints this:

Now Listening on: http://localhost:5000

Great. This is what I expected. The next thing to do in the tutorial is to run the same application from the Docker image.

docker build -t aspnetapp .
docker run -it --rm -p 5000:80 --name aspnetcore_sample aspnetapp

The result is

Now listening on: http://[::]:80

. Wat? aspnet 80?. 5000, . .

, - , , .

+4
1

microsoft/aspnetcore-build microsoft/aspnetcore. dockerhub :

ASPNETCORE_URLS http://+:80, , URL- ,.UseUrl Program.cs, 80 .

, , 80. , , Dockerfile:

ENV ASPNETCORE_URLS = http://+:5000

, , - docker, , http://localhost:5000, .

+6

Source: https://habr.com/ru/post/1693328/


All Articles