84036d3e18
Use a strong type for the DNS IP-addresses so that we can use flags.IPSliceVar, instead of implementing our own option-type and validation. Behavior should be the same, although error-messages have slightly changed: Before this patch: dockerd --dns 1.1.1.1oooo --validate Status: invalid argument "1.1.1.1oooo" for "--dns" flag: 1.1.1.1oooo is not an ip address See 'dockerd --help'., Code: 125 cat /etc/docker/daemon.json {"dns": ["1.1.1.1"]} dockerd --dns 2.2.2.2 --validate unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives are specified both as a flag and in the configuration file: dns: (from flag: [2.2.2.2], from file: [1.1.1.1]) cat /etc/docker/daemon.json {"dns": ["1.1.1.1oooo"]} dockerd --validate unable to configure the Docker daemon with file /etc/docker/daemon.json: merged configuration validation from file and command line flags failed: 1.1.1.1ooooo is not an ip address With this patch: dockerd --dns 1.1.1.1oooo --validate Status: invalid argument "1.1.1.1oooo" for "--dns" flag: invalid string being converted to IP address: 1.1.1.1oooo See 'dockerd --help'., Code: 125 cat /etc/docker/daemon.json {"dns": ["1.1.1.1"]} dockerd --dns 2.2.2.2 --validate unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives are specified both as a flag and in the configuration file: dns: (from flag: [2.2.2.2], from file: [1.1.1.1]) cat /etc/docker/daemon.json {"dns": ["1.1.1.1oooo"]} dockerd --validate unable to configure the Docker daemon with file /etc/docker/daemon.json: invalid IP address: 1.1.1.1oooo Signed-off-by: Sebastiaan van Stijn <github@gone.nl> |
||
---|---|---|
.. | ||
trap | ||
cobra.go | ||
config.go | ||
config_unix.go | ||
config_unix_test.go | ||
config_windows.go | ||
daemon.go | ||
daemon_freebsd.go | ||
daemon_linux.go | ||
daemon_linux_test.go | ||
daemon_test.go | ||
daemon_unix.go | ||
daemon_unix_test.go | ||
daemon_windows.go | ||
docker.go | ||
docker_unix.go | ||
docker_windows.go | ||
error.go | ||
genwinres_windows.go | ||
grpclog.go | ||
main_linux_test.go | ||
metrics.go | ||
options.go | ||
options_test.go | ||
README.md | ||
required.go | ||
service_unsupported.go | ||
service_windows.go |
docker.go contains Docker daemon's main function.
This file provides first line CLI argument parsing and environment variable setting.