Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker Toolbox - Localhost not working

So I'm using Docker Toolbox because I don't have Hyper-V on my machine since it's not Windows 10 pro. Everything seems to work fine, but when I try to go on my browser 0.0.0.0:80 it always returns me: This site can’t be reached

But when I run the command: docker container ps I get the following: 0.0.0.0:80->80/tcp meaning that this address should work. I searched across stackoverflow and github issues. Now I'm stuck.

Am I missing something?

Thanks, Mark

EDIT:

Using docker-machine ip default returns me 192.168.99.100. I run that on port 80. I still get the same result except that the address becomes the container id: https://fd677edg12

I run that command on cmd to find my ipv4: cmd /k ipconfig /all. Put the result with the port and it returns the same thing: https://fd677edg12

like image 573
Mark Avatar asked Mar 17 '17 19:03

Mark


1 Answers

Docker Toolbox doesn't get as many conveniences as Docker for Windows, but you're correct in using it since you're on Home edition.

In Toolbox, nothing will be localhost, and will be 192.168.99.100 by default, since it's running a Linux VM in VirtualBox.

So if you run docker run -p 80:80 nginx

(notice I had to publish a port for 192.168.99.100 to listen on that port)

Then going to http://192.168.99.100 should work.

like image 197
Bret Fisher Avatar answered Oct 12 '22 13:10

Bret Fisher