I have a problem with expose my .Net Core App on Docker.
My Dockerfile starts like that
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-bionic AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-bionic AS build
WORKDIR /src
I build it and run:
docker run -d -p 8080:80 --name test testapp
Container starts but I can not access the app on port 8080
In the container logs I can see that
warn: Microsoft.AspNetCore.Server.Kestrel[0]
Unable to bind to http://localhost:5000 on the IPv6 loopback interface: 'Cannot assign requested address'.
info: Microsoft.Hosting.Lifetime[0]
Now listening on: http://localhost:5000
but I was expecting:
Now listening on: http://[::]:80
Why can not understand why this is not 80 and I can not reach my app from outside, even if run it with 8080:5000
CURL to loclalhost:5000 from inside the container returns proper HTML

