1

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

docker pull microsoft/dotnet:latest

and

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
2

I found the solution I added the line

.UseUrls("http://0.0.0.0:5000")

to the main method

in the "Program.cs" file

Now it works.

https://github.com/aspnet/Templates/issues/394

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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