Phil
Phil

Reputation: 7566

Cannot access server in docker container

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.

Upvotes: 6

Views: 1697

Answers (1)

stasovlas
stasovlas

Reputation: 7406

try to publish your port

docker run -p 8080:8080 -it node_web_1

Upvotes: 7

Related Questions