moby/cmd/dockerd
Aaron Lehmann 762a73bf7f Split advertised address from listen address
There are currently problems with "swarm init" and "swarm join" when an
explicit --listen-addr flag is not provided. swarmkit defaults to
finding the IP address associated with the default route, and in cloud
setups this is often the wrong choice.

Introduce a notion of "advertised address", with the client flag
--advertise-addr, and the daemon flag --swarm-default-advertise-addr to
provide a default. The default listening address is now 0.0.0.0, but a
valid advertised address must be detected or specified.

If no explicit advertised address is specified, error out if there is
more than one usable candidate IP address on the system. This requires a
user to explicitly choose instead of letting swarmkit make the wrong
choice. For the purposes of this autodetection, we ignore certain
interfaces that are unlikely to be relevant (currently docker*).

The user is also required to choose a listen address on swarm init if
they specify an explicit advertise address that is a hostname or an IP
address that's not local to the system. This is a requirement for
overlay networking.

Also support specifying interface names to --listen-addr,
--advertise-addr, and the daemon flag --swarm-default-advertise-addr.
This will fail if the interface has multiple IP addresses (unless it has
a single IPv4 address and a single IPv6 address - then we resolve the
tie in favor of IPv4).

This change also exposes the node's externally-reachable address in
docker info, as requested by #24017.

Make corresponding API and CLI docs changes.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit a0ccd0d42f)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:03 -07:00
..
hack fix flaky test TestImportFileWithMessage 2016-05-27 23:19:29 +08:00
daemon.go Split advertised address from listen address 2016-07-25 23:18:03 -07:00
daemon_freebsd.go Make dockerd debuggable 2016-04-26 09:35:22 -07:00
daemon_linux.go plugins: experimental support for new plugin management 2016-06-14 14:20:27 -07:00
daemon_no_plugin_support.go plugins: experimental support for new plugin management 2016-06-14 14:20:27 -07:00
daemon_plugin_support.go Remove use of exec-root in plugins due to socket pathname limits. 2016-07-25 23:15:25 -07:00
daemon_solaris.go Get the Docker Engine to build clean on Solaris 2016-05-23 16:37:12 -07:00
daemon_test.go Cleanup the structure of the cli package. 2016-04-27 14:25:47 -04:00
daemon_unix.go Add --oom-score-adjust to daemon 2016-07-25 23:14:57 -07:00
daemon_unix_test.go Cleanup the structure of the cli package. 2016-04-27 14:25:47 -04:00
daemon_windows.go Ignore invalid host header between go1.6 and old docker clients 2016-05-19 21:07:45 +02:00
docker.go Improve flag help consistency, and update docs 2016-07-25 23:15:24 -07:00
docker_windows.go Windows: work around Go 1.6.2/Nano Server TP5 issue 2016-05-25 11:59:28 +02:00
README.md Make dockerd debuggable 2016-04-26 09:35:22 -07:00
routes.go plugins: experimental support for new plugin management 2016-06-14 14:20:27 -07:00
routes_experimental.go plugins: experimental support for new plugin management 2016-06-14 14:20:27 -07:00
service_unsupported.go Windows: Support running dockerd as a service 2016-04-26 14:04:47 -07:00
service_windows.go Fix typo in error message 2016-06-12 23:22:26 +02:00

docker.go contains Docker's main function.

This file provides first line CLI argument parsing and environment variable setting.