File tree Expand file tree Collapse file tree
docs/reference/commandline Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2560,6 +2560,7 @@ _docker_daemon() {
25602560 --raw-logs
25612561 --selinux-enabled
25622562 --userland-proxy=false
2563+ --validate
25632564 --version -v
25642565 "
25652566 local options_with_args="
Original file line number Diff line number Diff line change @@ -2791,7 +2791,8 @@ __docker_subcommand() {
27912791 " ($help )--tlsverify[Use TLS and verify the remote]" \
27922792 " ($help )--userns-remap=[User/Group setting for user namespaces]:user\:group:->users-groups" \
27932793 " ($help )--userland-proxy[Use userland proxy for loopback traffic]" \
2794- " ($help )--userland-proxy-path=[Path to the userland proxy binary]:binary:_files" && ret=0
2794+ " ($help )--userland-proxy-path=[Path to the userland proxy binary]:binary:_files" \
2795+ " ($help )--validate[Validate daemon configuration and exit]" && ret=0
27952796
27962797 case $state in
27972798 (cluster-store)
Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ Options:
104104 --userland-proxy Use userland proxy for loopback traffic (default true)
105105 --userland-proxy-path string Path to the userland proxy binary
106106 --userns-remap string User/Group setting for user namespaces
107+ --validate Validate configuration file and exit
107108 -v, --version Print version information and quit
108109```
109110
@@ -1334,6 +1335,19 @@ For example, the daemon fails to start if you set daemon labels
13341335in the configuration file and also set daemon labels via the ` --label ` flag.
13351336Options that are not present in the file are ignored when the daemon starts.
13361337
1338+ The ` --validate ` option allows to validate a configuration file without
1339+ starting the Docker daemon.
1340+
1341+ ``` console
1342+ $ dockerd --validate --config-file=/tmp/valid-config.json
1343+ Config OK
1344+
1345+
1346+ $ dockerd --validate --config-file /tmp/invalid-config.json
1347+ unable to configure the Docker daemon with file /tmp/invalid-config.json: the following directives don't match any configuration option: unknown-option
1348+ ```
1349+
1350+
13371351##### On Linux
13381352
13391353The default location of the configuration file on Linux is
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ dockerd - Enable daemon mode
7575[ ** --userland-proxy** [ =* true* ]]
7676[ ** --userland-proxy-path** [ =* ""* ]]
7777[ ** --userns-remap** [ =* default* ]]
78+ [ ** --validate** ]
7879
7980# DESCRIPTION
8081** dockerd** is used for starting the Docker daemon (i.e., to command the daemon
@@ -411,6 +412,9 @@ unix://[/path/to/socket] to use.
411412 daemon to lookup the user and group's subordinate ID ranges for use as the
412413 user namespace mappings for contained processes.
413414
415+ ** --validate**
416+ Validate the daemon configuration and exit.
417+
414418# STORAGE DRIVER OPTIONS
415419
416420Docker uses storage backends (known as "graphdrivers" in the Docker
You can’t perform that action at this time.
0 commit comments