I wanna be a Craftsman. Thoughts about software engineering. by Roy Tsabari

Access from container to host


docker run has a networking configuration you can specify. If you pass: --network=host the container will use the host network stack.

It doesn’t work on OSX. Whell, it actually does work, but you can’t really use it. Docker deamon on osx runs on a virtual machine, so passing --network=host use the VM network.

The simplest workaround I found is released in version 17.06 of docker-for-mac. Just use docker.for.mac.localhost as the host name.