Docker Community Forums

Share and learn in the Docker community.

Problem forwarding port on Windows


(Deeptowncitizen) #1

Packed ASP Core web service with docker. This service works correctly without Docker.
Service uses port 5000. In Dockerfile I exposed port 5000.
Launched docker with:

docker run -itd -p 127.0.0.1:8081:5000 <name>

Connected to the docker:

  • port is opened

    tcp 0 0 localhost:5000 : LISTEN

  • lynx can navigate 127.0.0.1:5000

Now trying to navigate service from client side to the 127.0.0.1:8081, or even using the port from docker-machine ip.
Service can’t be reached.
netstat shows that there is no opened port 8081


(Michael Friis) #2

You probably need to make sure the server process is listening for external requests vs. just localhost ones. Details here: http://stackoverflow.com/a/37617426/2942