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