mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
clarify docker plugin set docs
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
This commit is contained in:
parent
4a1a64c677
commit
a412ad41a5
1 changed files with 56 additions and 3 deletions
|
@ -34,6 +34,60 @@ The settings currently supported are:
|
|||
* path of devices
|
||||
* args
|
||||
|
||||
## What is settable ?
|
||||
|
||||
Look at the plugin manifest, it's easy to see what fields are settable,
|
||||
by looking at the `Settable` field.
|
||||
|
||||
Here is an extract of a plugin manifest:
|
||||
|
||||
```
|
||||
{
|
||||
"config": {
|
||||
...
|
||||
"args": {
|
||||
"name": "myargs",
|
||||
"settable": ["value"],
|
||||
"value": ["foo", "bar"]
|
||||
},
|
||||
"env": [
|
||||
{
|
||||
"name": "DEBUG",
|
||||
"settable": ["value"],
|
||||
"value": "0"
|
||||
},
|
||||
{
|
||||
"name": "LOGGING",
|
||||
"value": "1"
|
||||
}
|
||||
],
|
||||
"devices": [
|
||||
{
|
||||
"name": "mydevice",
|
||||
"path": "/dev/foo",
|
||||
"settable": ["path"]
|
||||
}
|
||||
],
|
||||
"mounts": [
|
||||
{
|
||||
"destination": "/baz",
|
||||
"name": "mymount",
|
||||
"options": ["rbind"],
|
||||
"settable": ["source"],
|
||||
"source": "/foo",
|
||||
"type": "bind"
|
||||
}
|
||||
],
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
In this example, we can see that the `value` of the `DEBUG` environment variable is settable,
|
||||
the `source` of the `mymount` mount is also settable. Same for the `path` of `mydevice` and `value` of `myargs`.
|
||||
|
||||
On the contrary, the `LOGGING` environment variable doesn't have any settable field, which implies that user cannot tweak it.
|
||||
|
||||
## Examples
|
||||
|
||||
### Change an environment variable
|
||||
|
@ -43,7 +97,6 @@ The following example change the env variable `DEBUG` on the
|
|||
|
||||
```bash
|
||||
$ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin
|
||||
|
||||
[DEBUG=0]
|
||||
|
||||
$ docker plugin set tiborvass/sample-volume-plugin DEBUG=1
|
||||
|
@ -90,13 +143,13 @@ $ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$devi
|
|||
|
||||
### Change the source of the arguments
|
||||
|
||||
The following example change the source of the args on the `myplugin` plugin.
|
||||
The following example change the value of the args on the `myplugin` plugin.
|
||||
|
||||
```bash
|
||||
$ docker plugin inspect -f '{{.Settings.Args}}' myplugin
|
||||
["foo", "bar"]
|
||||
|
||||
$ docker plugins set myplugin args="foo bar baz"
|
||||
$ docker plugins set myplugin myargs="foo bar baz"
|
||||
|
||||
$ docker plugin inspect -f '{{.Settings.Args}}' myplugin
|
||||
["foo", "bar", "baz"]
|
||||
|
|
Loading…
Add table
Reference in a new issue