From 900e708577a7b8aaebe3a49f0a481daec554bb46 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Wed, 27 Sep 2017 16:49:23 -0700 Subject: [PATCH 1/2] Properly autodetect Docker IP in Windows Our Docker network plugin autodetection code was erroneously treating Window's default network `nat` as a plugin and defaulting to it instead of the host. Fixes #3218 --- client/driver/docker.go | 5 +++-- website/source/docs/job-specification/service.html.md | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/client/driver/docker.go b/client/driver/docker.go index 01c89838f..4c4e73b40 100644 --- a/client/driver/docker.go +++ b/client/driver/docker.go @@ -744,8 +744,9 @@ func (d *DockerDriver) detectIP(c *docker.Container) (string, bool) { ip = net.IPAddress ipName = name - // Don't auto-advertise bridge IPs - if name != "bridge" { + // Don't auto-advertise IPs for default networks (bridge on + // Linux, nat on Windows) + if name != "bridge" && name != "nat" { auto = true } diff --git a/website/source/docs/job-specification/service.html.md b/website/source/docs/job-specification/service.html.md index 5d4fc6775..b90f99fe6 100644 --- a/website/source/docs/job-specification/service.html.md +++ b/website/source/docs/job-specification/service.html.md @@ -106,6 +106,7 @@ does not automatically enable service discovery. behaves the same as `host` unless the driver determines its IP should be used. This setting was added in Nomad 0.6 and only supported by the Docker driver. It will advertise the container IP if a network plugin is used (e.g. weave). + Support was added to the rkt driver in 0.7. ### `check` Parameters From a7a5d5f9d1958ddff670009b62dc361ab4574699 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Wed, 27 Sep 2017 17:24:30 -0700 Subject: [PATCH 2/2] Cleanup versioning doc --- website/source/docs/job-specification/service.html.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/website/source/docs/job-specification/service.html.md b/website/source/docs/job-specification/service.html.md index b90f99fe6..50b29d50e 100644 --- a/website/source/docs/job-specification/service.html.md +++ b/website/source/docs/job-specification/service.html.md @@ -104,9 +104,8 @@ does not automatically enable service discovery. and port. `driver` advertises the IP used in the driver (e.g. Docker's internal IP) and uses the ports specified in the port map. The default is `auto` which behaves the same as `host` unless the driver determines its IP should be used. - This setting was added in Nomad 0.6 and only supported by the Docker driver. - It will advertise the container IP if a network plugin is used (e.g. weave). - Support was added to the rkt driver in 0.7. + This setting supported Docker since Nomad 0.6 and rkt since Nomad 0.7. It + will advertise the container IP if a network plugin is used (e.g. weave). ### `check` Parameters