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

  • Boot2Docker: can't get ports forwarding to work
  • Why does MySQL Docker container complain that MYSQL_ROOT_PASSWORD env must be defined when using Docker 17.03 secrets?
  • Jenkins Docker plugin is showing offline
  • How to forward hostname based request to a specific docker container
  • Docker Images Hierarchy
  • Resize container resources online
  • Docker installation on Ubuntu 12.04 -> cannot connect to daemon
  • Running Scrapy in a docker container
  • docker-compose network_mode: “host” doesn't seem to work
  • What is the difference between volumes-from and volumes?
  • Windows Docker Toolbox won't start
  • How can you write a docker daemon that can kick off other docker containers as needed?
  • 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.