While following the guide Installing ASP.NET 5 On Linux - Using Docker I was unable to view the ASP.NET 5 application on the host, even though Docker was exposing the correct port, no response was being returned.
Looking into the issue, what was happening was Docker was forwarding requests to the Container on the 0.0.0.0 network interface, but Kestrel only listens on localhost by default.
So the requests were being passed off to the docker container, but they were not being accepted by the Kestrel webserver. To solve the problem I had to override the server.urls property within my Dockerfile, as shown below and then build and re-run the Container.
FROM microsoft/aspnet:latest
COPY . /app
WORKDIR /app
RUN ["dnu", "restore"]
EXPOSE 5000
ENTRYPOINT ["dnx", "web", "--server.urls", "http://0.0.0.0:5000"]
docker build -t myapp .
docker run -t -d -p 8080:5000 myapp