Skip to content

Commit 4f78ffa

Browse files
authored
Merge pull request #5436 from thaJeztah/update_dockerd_docs
docs: add documentation for dockerd --feature flag
2 parents a18c896 + a42ca11 commit 4f78ffa

2 files changed

Lines changed: 44 additions & 1 deletion

File tree

docs/reference/dockerd.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Options:
5757
--exec-opt list Runtime execution options
5858
--exec-root string Root directory for execution state files (default "/var/run/docker")
5959
--experimental Enable experimental features
60+
--feature map Enable feature in the daemon
6061
--fixed-cidr string IPv4 subnet for fixed IPs
6162
--fixed-cidr-v6 string IPv6 subnet for fixed IPs
6263
-G, --group string Group for the unix socket (default "docker")
@@ -971,6 +972,36 @@ Example of usage:
971972
}
972973
```
973974

975+
### <a name="feature"></a> Enable feature in the daemon (--feature)
976+
977+
The `--feature` option lets you enable or disable a feature in the daemon.
978+
This option corresponds with the "features" field in the [daemon.json configuration file](#daemon-configuration-file).
979+
Features should only be configured either through the `--feature` command line
980+
option or through the "features" field in the configuration file; using both
981+
the command-line option and the "features" field in the configuration
982+
file produces an error. The feature option can be specified multiple times
983+
to configure multiple features. The `--feature` option accepts a name and
984+
optional boolean value. When omitting the value, the default is `true`.
985+
986+
The following example runs the daemon with the `cdi` and `containerd-snapshotter`
987+
features enabled. The `cdi` option is provided with a value;
988+
989+
```console
990+
$ dockerd --feature cdi=true --feature containerd-snapshotter
991+
```
992+
993+
The following example is the equivalent using the `daemon.json` configuration
994+
file;
995+
996+
```json
997+
{
998+
"features": {
999+
"cdi": true,
1000+
"containerd-snapshotter": true
1001+
}
1002+
}
1003+
```
1004+
9741005
### Daemon configuration file
9751006

9761007
The `--config-file` option allows you to set any configuration option
@@ -1065,7 +1096,10 @@ The following is a full example of the allowed configuration options on Linux:
10651096
"exec-opts": [],
10661097
"exec-root": "",
10671098
"experimental": false,
1068-
"features": {},
1099+
"features": {
1100+
"cdi": true,
1101+
"containerd-snapshotter": true
1102+
},
10691103
"fixed-cidr": "",
10701104
"fixed-cidr-v6": "",
10711105
"group": "",

man/dockerd.8.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ dockerd - Enable daemon mode
3131
[**--exec-opt**[=*[]*]]
3232
[**--exec-root**[=*/var/run/docker*]]
3333
[**--experimental**[=**false**]]
34+
[**--feature**[=*NAME*[=**true**|**false**]]
3435
[**--fixed-cidr**[=*FIXED-CIDR*]]
3536
[**--fixed-cidr-v6**[=*FIXED-CIDR-V6*]]
3637
[**-G**|**--group**[=*docker*]]
@@ -222,6 +223,14 @@ $ sudo dockerd --add-runtime runc=runc --add-runtime custom=/usr/local/bin/my-ru
222223
**--experimental**=""
223224
Enable the daemon experimental features.
224225

226+
**--feature**=*NAME*[=**true**|**false**]
227+
Enable or disable a feature in the daemon. This option corresponds
228+
with the "features" field in the daemon.json configuration file. Using
229+
both the command-line option and the "features" field in the configuration
230+
file produces an error. The feature option can be specified multiple times
231+
to configure multiple features.
232+
Usage example: `--feature containerd-snapshotter` or `--feature containerd-snapshotter=true`.
233+
225234
**--fixed-cidr**=""
226235
IPv4 subnet for fixed IPs (e.g., 10.20.0.0/16); this subnet must be nested in
227236
the bridge subnet (which is defined by \-b or \-\-bip).

0 commit comments

Comments
 (0)