6

I started a docker image using

docker run --interactive --tty node_web_1

And the running server inside the container successfully prints

Running on http://localhost:8080

in the console. I have exposed port 8080 in the Dockerfile. So in my understanding, when I call http://localhost:8080 in the browser in windows, I should access the server in the container, right? I get no reply though....

How do I go about finding the error? I executed the command

docker-machine ls

as suggested here How to access Docker container's web server from host but apparently I have no docker-machines running? What are those machines? Do I need them? I have only docker for windows installed, no additionall packages or shells.

Community
  • 1
  • 1
Phil
  • 7,065
  • 8
  • 49
  • 91

1 Answers1

6

try to publish your port

docker run -p 8080:8080 -it node_web_1
stasovlas
  • 7,136
  • 2
  • 28
  • 29
  • Thank you. That helped. Could you tell me why EXPOSE is not sufficient though? Does it basically mean I can send requests from the dockerized server, but I cannot sent requests to it? So EXPOSE is just one-directional? Or what am I missing here? – Phil Dec 11 '16 at 18:19
  • 1
    @Phil i think it helps http://stackoverflow.com/questions/22111060/difference-between-expose-and-publish-in-docker – stasovlas Dec 11 '16 at 18:22