Can not ping docker in macOS

I have docker installed on my local but I can not ping it in Mac but I can ping on Ubuntu for same thing.

$ docker inspect -f '{{ .NetworkSettings.IPAddress }}' n1

$ ping
PING ( 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
--- ping statistics ---
7 packets transmitted, 0 packets received, 100.0% packet loss

I installed docker on mac following

  • How to prevent a Docker Container to turn on while another Container in the same Service is trying to?
  • dockerfile with windows path
  • How to add information to
  • How can I run a complex docker command from host machine that runs in the docker host?
  • how to diagnose blocked service responses
  • Docker nginx redirect HTTP to HTTPS
  • Chronos framework connect and disconnect from Mesos
  • How to push docker images into a private registry with a full URL?
  • How do I record RAM usage over time on Google Compute Engine?
  • Strategy for arangodb data backup in docker container
  • max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
  • Docker local repository deletion does not free space
  • 2 Solutions collect form web for “Can not ping docker in macOS”

    It is not just ping. As commented in issue 155

    xhyve vm inside Docker for Mac hasn’t no Network Adapter. Or routable IP like boot2docker ( like that)

    With boot2docker and a route command its possible to Route all the Container ips to the vm Network.

    We need this for xhyve.

    (there are a lot of threads on this topic in Docker for Mac forum)

    That’s normal.

    Take a look at your Mac’s interface config – there is no 172.x.x.x network on the Mac itself. Those live in the xhyve Linux VM that is actually hosting Docker.

    Network connections are mapped through when you use port maps (e.g. docker run -p ...) but ping will not work like this.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.