Can't connect to container on localhost with port mapping

If you’re using (Docker Toolbox), then any port you publish with (docker run -p) will be published on the Toolbox VM’s private IP address. Command (docker-machine ip) will tell you the correct IP address to use. It is frequently 192.168.99.100. Then you can browse to (192.168.99.100:8080) instead of (localhost:8080).

6 Likes