Skip to content

Commit cf1442d

Browse files
author
Anca Iordache
committed
Document --validate daemon option
Signed-off-by: Anca Iordache <[email protected]>
1 parent 6b4d2e8 commit cf1442d

4 files changed

Lines changed: 21 additions & 1 deletion

File tree

contrib/completion/bash/docker

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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="

contrib/completion/zsh/_docker

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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)

docs/reference/commandline/dockerd.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff 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
13341335
in the configuration file and also set daemon labels via the `--label` flag.
13351336
Options 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

13391353
The default location of the configuration file on Linux is

man/dockerd.8.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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

416420
Docker uses storage backends (known as "graphdrivers" in the Docker

0 commit comments

Comments
 (0)