2016-10-31 20:07:05 -04:00
|
|
|
---
|
|
|
|
title: "plugin set"
|
|
|
|
description: "the plugin set command description and usage"
|
|
|
|
keywords: "plugin, set"
|
|
|
|
---
|
|
|
|
|
2017-07-28 13:28:23 -04:00
|
|
|
<!-- This file is maintained within the docker/cli Github
|
|
|
|
repository at https://github.com/docker/cli/. Make all
|
2016-10-31 20:07:05 -04:00
|
|
|
pull requests against that repo. If you see this file in
|
|
|
|
another repository, consider it read-only there, as it will
|
|
|
|
periodically be overwritten by the definitive file. Pull
|
|
|
|
requests which include edits to this file in other repositories
|
|
|
|
will be rejected.
|
|
|
|
-->
|
|
|
|
|
2016-11-09 20:49:09 -05:00
|
|
|
# plugin set
|
2016-10-31 20:07:05 -04:00
|
|
|
|
|
|
|
```markdown
|
2016-11-07 20:43:11 -05:00
|
|
|
Usage: docker plugin set PLUGIN KEY=VALUE [KEY=VALUE...]
|
2016-10-31 20:07:05 -04:00
|
|
|
|
|
|
|
Change settings for a plugin
|
|
|
|
|
|
|
|
Options:
|
|
|
|
--help Print usage
|
|
|
|
```
|
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
## Description
|
|
|
|
|
2016-10-31 20:07:05 -04:00
|
|
|
Change settings for a plugin. The plugin must be disabled.
|
|
|
|
|
2016-11-10 13:15:16 -05:00
|
|
|
The settings currently supported are:
|
|
|
|
* env variables
|
|
|
|
* source of mounts
|
|
|
|
* path of devices
|
|
|
|
* args
|
2016-10-31 20:07:05 -04:00
|
|
|
|
2017-03-24 19:44:37 -04:00
|
|
|
## 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.
|
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
## Examples
|
|
|
|
|
|
|
|
### Change an environment variable
|
|
|
|
|
2016-11-10 13:15:16 -05:00
|
|
|
The following example change the env variable `DEBUG` on the
|
2016-12-14 03:35:34 -05:00
|
|
|
`sample-volume-plugin` plugin.
|
2016-10-31 20:07:05 -04:00
|
|
|
|
|
|
|
```bash
|
2016-12-14 03:35:34 -05:00
|
|
|
$ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin
|
2016-10-31 20:07:05 -04:00
|
|
|
[DEBUG=0]
|
|
|
|
|
2016-12-14 03:35:34 -05:00
|
|
|
$ docker plugin set tiborvass/sample-volume-plugin DEBUG=1
|
2016-10-31 20:07:05 -04:00
|
|
|
|
2016-12-14 03:35:34 -05:00
|
|
|
$ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin
|
2016-10-31 20:07:05 -04:00
|
|
|
[DEBUG=1]
|
|
|
|
```
|
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
### Change the source of a mount
|
|
|
|
|
2016-11-10 13:15:16 -05:00
|
|
|
The following example change the source of the `mymount` mount on
|
|
|
|
the `myplugin` plugin.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ docker plugin inspect -f '{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}' myplugin
|
|
|
|
/foo
|
|
|
|
|
|
|
|
$ docker plugins set myplugin mymount.source=/bar
|
|
|
|
|
|
|
|
$ docker plugin inspect -f '{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}' myplugin
|
|
|
|
/bar
|
|
|
|
```
|
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
> **Note**: Since only `source` is settable in `mymount`,
|
|
|
|
> `docker plugins set mymount=/bar myplugin` would work too.
|
|
|
|
|
|
|
|
### Change a device path
|
2016-11-10 13:15:16 -05:00
|
|
|
|
|
|
|
The following example change the path of the `mydevice` device on
|
|
|
|
the `myplugin` plugin.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$device.Path}}{{end}}' myplugin
|
2017-04-27 17:24:49 -04:00
|
|
|
|
2016-11-10 13:15:16 -05:00
|
|
|
/dev/foo
|
|
|
|
|
|
|
|
$ docker plugins set myplugin mydevice.path=/dev/bar
|
|
|
|
|
|
|
|
$ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$device.Path}}{{end}}' myplugin
|
2017-04-27 17:24:49 -04:00
|
|
|
|
2016-11-10 13:15:16 -05:00
|
|
|
/dev/bar
|
|
|
|
```
|
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
> **Note**: Since only `path` is settable in `mydevice`,
|
|
|
|
> `docker plugins set mydevice=/dev/bar myplugin` would work too.
|
|
|
|
|
|
|
|
### Change the source of the arguments
|
2016-11-10 13:15:16 -05:00
|
|
|
|
2017-03-24 19:44:37 -04:00
|
|
|
The following example change the value of the args on the `myplugin` plugin.
|
2016-11-10 13:15:16 -05:00
|
|
|
|
|
|
|
```bash
|
|
|
|
$ docker plugin inspect -f '{{.Settings.Args}}' myplugin
|
2017-04-27 17:24:49 -04:00
|
|
|
|
2016-11-10 13:15:16 -05:00
|
|
|
["foo", "bar"]
|
|
|
|
|
2017-03-24 19:44:37 -04:00
|
|
|
$ docker plugins set myplugin myargs="foo bar baz"
|
2016-11-10 13:15:16 -05:00
|
|
|
|
|
|
|
$ docker plugin inspect -f '{{.Settings.Args}}' myplugin
|
2017-04-27 17:24:49 -04:00
|
|
|
|
2016-11-10 13:15:16 -05:00
|
|
|
["foo", "bar", "baz"]
|
|
|
|
```
|
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
## Related commands
|
2016-10-31 20:07:05 -04:00
|
|
|
|
2016-10-04 15:01:19 -04:00
|
|
|
* [plugin create](plugin_create.md)
|
2016-10-31 20:07:05 -04:00
|
|
|
* [plugin disable](plugin_disable.md)
|
2016-11-14 11:38:06 -05:00
|
|
|
* [plugin enable](plugin_enable.md)
|
2016-10-31 20:07:05 -04:00
|
|
|
* [plugin inspect](plugin_inspect.md)
|
|
|
|
* [plugin install](plugin_install.md)
|
2016-11-14 11:38:06 -05:00
|
|
|
* [plugin ls](plugin_ls.md)
|
|
|
|
* [plugin push](plugin_push.md)
|
2016-10-31 20:07:05 -04:00
|
|
|
* [plugin rm](plugin_rm.md)
|
2017-04-27 17:24:49 -04:00
|
|
|
* [plugin upgrade](plugin_upgrade.md)
|