Merge pull request #3108 from aiordache/validate_dockerd_config
Document option for daemon config validation
This commit is contained in:
@ -104,6 +104,7 @@ Options:
|
||||
--userland-proxy Use userland proxy for loopback traffic (default true)
|
||||
--userland-proxy-path string Path to the userland proxy binary
|
||||
--userns-remap string User/Group setting for user namespaces
|
||||
--validate Validate daemon configuration and exit
|
||||
-v, --version Print version information and quit
|
||||
```
|
||||
|
||||
@ -1334,6 +1335,25 @@ For example, the daemon fails to start if you set daemon labels
|
||||
in the configuration file and also set daemon labels via the `--label` flag.
|
||||
Options that are not present in the file are ignored when the daemon starts.
|
||||
|
||||
The `--validate` option allows to validate a configuration file without
|
||||
starting the Docker daemon. A non-zero exit code is returned for invalid
|
||||
configuration files.
|
||||
|
||||
```console
|
||||
$ dockerd --validate --config-file=/tmp/valid-config.json
|
||||
configuration OK
|
||||
|
||||
$ echo $?
|
||||
0
|
||||
|
||||
$ dockerd --validate --config-file /tmp/invalid-config.json
|
||||
unable to configure the Docker daemon with file /tmp/invalid-config.json: the following directives don't match any configuration option: unknown-option
|
||||
|
||||
$ echo $?
|
||||
1
|
||||
```
|
||||
|
||||
|
||||
##### On Linux
|
||||
|
||||
The default location of the configuration file on Linux is
|
||||
|
||||
Reference in New Issue
Block a user