Docker Community Forums

Share and learn in the Docker community.

IP's inaccessible from local env

(Chrisclevercoding) #1

I’m new to docker and I’m going through the tutorial. Part 4 tells me to run docker-machine create --driver virtualbox myvm1 so I did and it worked as I have VB installed. I’ve gone through the rest of Part 4 and when I try to access the IP’s that docker setup I get an error saying the site can’t be reached. Why is this not working and how can I fix it? Do I need to edit my hosts file?

$ docker-machine ls
NAME    ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER        ERRORS
myvm1   *        virtualbox   Running   tcp://           v18.05.0-ce
myvm2   -        virtualbox   Running   tcp://           v18.05.0-ce

(Chrisclevercoding) #2

I think i figured it out. I had to add port 4000 to the IP. This is because I ported port 80 to port 4000 in the docker-compose.yml file, right? So the IP in the browser looks like

(Vathesaustin) #3

Thank you for posting this question and for posting an update once you found an answer. I just ran into the same issue, and your solution saved me!