title: How to tell docker on mac to use host network for all purpose?
body: <p>How to tell docker on mac to use host network for all purpose such that my docker container can connect to any service running on host machine via localhost or 127.0.0.1 ?</p>
  
  <p>Ran <code>docker run --net=host -it myimage</code> and the container cannot connect to anything running on host machine via localhost. I get connection refused error.</p>
  
  <pre><code>docker version
  Client:
   Version:      18.03.1-ce
   API version:  1.37
   Go version:   go1.9.5
   Git commit:   9ee9f40
   Built:        Thu Apr 26 07:13:02 2018
   OS/Arch:      darwin/amd64
   Experimental: false
   Orchestrator: swarm
  
  Server:
   Engine:
    Version:      18.03.1-ce
    API version:  1.37 (minimum version 1.12)
    Go version:   go1.9.5
    Git commit:   9ee9f40
    Built:        Thu Apr 26 07:22:38 2018
    OS/Arch:      linux/amd64
    Experimental: true
  </code></pre>