I have installed the official .net core docker container from Microsoft with the followed commands on my debian machine:

docker pull microsoft/dotnet:latest


docker run -it microsoft/dotnet:latest

Then I wanted to make a new test website

mkdir test

cd test

dotnet new -t web

dotnet restore

dotnet run

Then I committed the changes:

docker commit 0240ad83aae4 dotnet_core

And made a port forwarding, so I could access the website from outside the docker container.

docker run -itp 8080:5000 dotnet_core:latest /bin/bash

But when I try to access the website over port 8080 nothing happened.

Could anyone help me?

  • When I try to access localhost over port 5000 in the .net core docker container over curl it works. But when I try to connect from outside the docker container over port 8080 it does not work, although I made portforwarding. – Wubi Nov 25 '16 at 8:04

I found the solution I added the line


to the main method

in the "Program.cs" file

Now it works.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.