Skip to content

Commit

Permalink
Document --validate daemon option
Browse files Browse the repository at this point in the history
Signed-off-by: Anca Iordache <anca.iordache@docker.com>
  • Loading branch information
aiordache committed Jun 24, 2021
1 parent 6b4d2e8 commit 64b2e95
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions contrib/completion/bash/docker
Original file line number Diff line number Diff line change
Expand Up @@ -2560,6 +2560,7 @@ _docker_daemon() {
--raw-logs
--selinux-enabled
--userland-proxy=false
--validate
--version -v
"
local options_with_args="
Expand Down
3 changes: 2 additions & 1 deletion contrib/completion/zsh/_docker
Original file line number Diff line number Diff line change
Expand Up @@ -2791,7 +2791,8 @@ __docker_subcommand() {
"($help)--tlsverify[Use TLS and verify the remote]" \
"($help)--userns-remap=[User/Group setting for user namespaces]:user\:group:->users-groups" \
"($help)--userland-proxy[Use userland proxy for loopback traffic]" \
"($help)--userland-proxy-path=[Path to the userland proxy binary]:binary:_files" && ret=0
"($help)--userland-proxy-path=[Path to the userland proxy binary]:binary:_files" \
"($help)--validate[Validate daemon configuration and exit]" && ret=0

case $state in
(cluster-store)
Expand Down
20 changes: 20 additions & 0 deletions docs/reference/commandline/dockerd.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions man/dockerd.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ dockerd - Enable daemon mode
[**--userland-proxy**[=*true*]]
[**--userland-proxy-path**[=*""*]]
[**--userns-remap**[=*default*]]
[**--validate**]

# DESCRIPTION
**dockerd** is used for starting the Docker daemon (i.e., to command the daemon
Expand Down Expand Up @@ -411,6 +412,9 @@ unix://[/path/to/socket] to use.
daemon to lookup the user and group's subordinate ID ranges for use as the
user namespace mappings for contained processes.

**--validate**
Validate daemon configuration and exit.

# STORAGE DRIVER OPTIONS

Docker uses storage backends (known as "graphdrivers" in the Docker
Expand Down

0 comments on commit 64b2e95

Please sign in to comment.