Skip to content

Commit

Permalink
17.06: improve the Docker for Mac networking workaround
Browse files Browse the repository at this point in the history
Rather than manually creating a custom IP alas on the host, a container
can connect to the host by resolving the DNS name `docker.for.mac.localhost`.

Signed-off-by: David Scott <dave.scott@docker.com>
  • Loading branch information
djs55 committed May 11, 2017
1 parent 9758285 commit ed3d755
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions docker-for-mac/networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,10 @@ There are two scenarios that the above limitations will affect:

#### I want to connect from a container to a service on the host

The Mac has a changing IP address (or none if you have no network access). Our
current recommendation is to attach an unused IP to the `lo0` interface on the
Mac; for example: `sudo ifconfig lo0 alias 10.200.10.1/24`, and make sure that
your service is listening on this address or `0.0.0.0` (ie not `127.0.0.1`).
Then containers can connect to this address.
The Mac has a changing IP address (or none if you have no network access). From
17.06 onwards our recommendation is to connect to the special Mac-only DNS
name `docker.for.mac.localhost` which will resolve to the internal IP address
used by the host.

#### I want to connect to a container from the Mac

Expand Down

0 comments on commit ed3d755

Please sign in to comment.