What is my container's IP number using Docker beta for mac?

Solution 1:

You're looking at the IP address inside the container which is 172.17.0.2 and only exists "inside" the docker containers (and between them).

The IP address you want to connect to is your host machines IP address. Do an ifconfig on your Mac and find the right one (typically 192.168.x.y or 10.x.y.z). Localhost should also work from outside the container.

Solution 2:

type following command and you will get your docker container ip

$docker inspect <docker-container-name>

Scroll down and you will get IP-address under "NetworkSettings"

Solution 3:

Docker for Mac runs on IP address 127.0.0.1