Depending on how you started Docker, this is unlikely to work. Docker Daemon runs on a virtual machine in OS X, which means that you really need to connect to this IP address (and not the local host). To find this IP address, enter the following:
docker-machine ip default
The IP address you return will tell you the IP address to connect.
source share