On Docker for Mac what would be the host ip as seen from the container? [duplicate]

This question already has an answer here:

  • How to get the IP address of the docker host from inside a docker container

    7 answers

  • Docker inspect with unix:///var/run/docker.sock (in Java or Scala)
  • Service host/port undefined, Kubernetes/Google Container Engine
  • Docker: Refer to registry by ip address
  • How to run yum inside a docker container on a partially isolated host?
  • How to test a docker volume?
  • Error response from daemon: getsockopt: connection refused
  • How to connect to remote Spark cluster from python in docker
  • Creating/Running a docker container from within a c# program (under mono)
  • Multi Host : Docker Networking
  • specifying network ip docker
  • blktrace output error in docker container
  • sharing docker.sock or docker in docker (dind)
  • One Solution collect form web for “On Docker for Mac what would be the host ip as seen from the container? [duplicate]”

    You can get the ip of the host from within the container by running this command:

    /sbin/ip route|awk '/default/ { print $3 }'
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.