mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
92e809a680
Docker Desktop (on MAC and Windows hosts) allows containers running inside a Linux VM to connect to the host using the host.docker.internal DNS name, which is implemented by VPNkit (DNS proxy on the host) This PR allows containers to connect to Linux hosts by appending a special string "host-gateway" to --add-host e.g. "--add-host=host.docker.internal:host-gateway" which adds host.docker.internal DNS entry in /etc/hosts and maps it to host-gateway-ip This PR also add a daemon flag call host-gateway-ip which defaults to the default bridge IP Docker Desktop will need to set this field to the Host Proxy IP so DNS requests for host.docker.internal can be routed to VPNkit Addresses: https://github.com/docker/for-linux/issues/264 Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
8 lines
231 B
Go
8 lines
231 B
Go
package network
|
|
|
|
const (
|
|
// HostGatewayName is the string value that can be passed
|
|
// to the IPAddr section in --add-host that is replaced by
|
|
// the value of HostGatewayIP daemon config value
|
|
HostGatewayName = "host-gateway"
|
|
)
|