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. docker-machine ip will tell you. It is frequently 192.168.99.100.

This isn’t prominent in Docker’s documentation, but it does at least show up in the excellent Get Started, Part 2: Containers tutorial. (I couldn’t find this rather important note anywhere around Toolbox Overview, for instance.)

8 Likes