github.com/pwn-term/docker@v0.0.0-20210616085119-6e977cce2565/cli/docs/reference/commandline/plugin_set.md (about) 1 --- 2 title: "plugin set" 3 description: "the plugin set command description and usage" 4 keywords: "plugin, set" 5 --- 6 7 # plugin set 8 9 ```markdown 10 Usage: docker plugin set PLUGIN KEY=VALUE [KEY=VALUE...] 11 12 Change settings for a plugin 13 14 Options: 15 --help Print usage 16 ``` 17 18 ## Description 19 20 Change settings for a plugin. The plugin must be disabled. 21 22 The settings currently supported are: 23 * env variables 24 * source of mounts 25 * path of devices 26 * args 27 28 ## What is settable ? 29 30 Look at the plugin manifest, it's easy to see what fields are settable, 31 by looking at the `Settable` field. 32 33 Here is an extract of a plugin manifest: 34 35 ```json 36 { 37 "config": { 38 "args": { 39 "name": "myargs", 40 "settable": ["value"], 41 "value": ["foo", "bar"] 42 }, 43 "env": [ 44 { 45 "name": "DEBUG", 46 "settable": ["value"], 47 "value": "0" 48 }, 49 { 50 "name": "LOGGING", 51 "value": "1" 52 } 53 ], 54 "devices": [ 55 { 56 "name": "mydevice", 57 "path": "/dev/foo", 58 "settable": ["path"] 59 } 60 ], 61 "mounts": [ 62 { 63 "destination": "/baz", 64 "name": "mymount", 65 "options": ["rbind"], 66 "settable": ["source"], 67 "source": "/foo", 68 "type": "bind" 69 } 70 ] 71 } 72 } 73 ``` 74 75 In this example, we can see that the `value` of the `DEBUG` environment variable is settable, 76 the `source` of the `mymount` mount is also settable. Same for the `path` of `mydevice` and `value` of `myargs`. 77 78 On the contrary, the `LOGGING` environment variable doesn't have any settable field, which implies that user cannot tweak it. 79 80 ## Examples 81 82 ### Change an environment variable 83 84 The following example change the env variable `DEBUG` on the 85 `sample-volume-plugin` plugin. 86 87 ```bash 88 $ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin 89 [DEBUG=0] 90 91 $ docker plugin set tiborvass/sample-volume-plugin DEBUG=1 92 93 $ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin 94 [DEBUG=1] 95 ``` 96 97 ### Change the source of a mount 98 99 The following example change the source of the `mymount` mount on 100 the `myplugin` plugin. 101 102 ```bash 103 $ docker plugin inspect -f '{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}' myplugin 104 /foo 105 106 $ docker plugins set myplugin mymount.source=/bar 107 108 $ docker plugin inspect -f '{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}' myplugin 109 /bar 110 ``` 111 112 > **Note** 113 > 114 > Since only `source` is settable in `mymount`, 115 > `docker plugins set mymount=/bar myplugin` would work too. 116 117 ### Change a device path 118 119 The following example change the path of the `mydevice` device on 120 the `myplugin` plugin. 121 122 ```bash 123 $ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$device.Path}}{{end}}' myplugin 124 125 /dev/foo 126 127 $ docker plugins set myplugin mydevice.path=/dev/bar 128 129 $ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$device.Path}}{{end}}' myplugin 130 131 /dev/bar 132 ``` 133 134 > **Note** 135 > Since only `path` is settable in `mydevice`, 136 > `docker plugins set mydevice=/dev/bar myplugin` would work too. 137 138 ### Change the source of the arguments 139 140 The following example change the value of the args on the `myplugin` plugin. 141 142 ```bash 143 $ docker plugin inspect -f '{{.Settings.Args}}' myplugin 144 145 ["foo", "bar"] 146 147 $ docker plugins set myplugin myargs="foo bar baz" 148 149 $ docker plugin inspect -f '{{.Settings.Args}}' myplugin 150 151 ["foo", "bar", "baz"] 152 ``` 153 154 ## Related commands 155 156 * [plugin create](plugin_create.md) 157 * [plugin disable](plugin_disable.md) 158 * [plugin enable](plugin_enable.md) 159 * [plugin inspect](plugin_inspect.md) 160 * [plugin install](plugin_install.md) 161 * [plugin ls](plugin_ls.md) 162 * [plugin push](plugin_push.md) 163 * [plugin rm](plugin_rm.md) 164 * [plugin upgrade](plugin_upgrade.md)