Signed-off-by: Victor Vieux <victorvieux@gmail.com>
| ... | ... |
@@ -34,6 +34,60 @@ The settings currently supported are: |
| 34 | 34 |
* path of devices |
| 35 | 35 |
* args |
| 36 | 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 |
+ |
|
| 37 | 91 |
## Examples |
| 38 | 92 |
|
| 39 | 93 |
### Change an environment variable |
| ... | ... |
@@ -43,7 +97,6 @@ The following example change the env variable `DEBUG` on the |
| 43 | 43 |
|
| 44 | 44 |
```bash |
| 45 | 45 |
$ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin
|
| 46 |
- |
|
| 47 | 46 |
[DEBUG=0] |
| 48 | 47 |
|
| 49 | 48 |
$ docker plugin set tiborvass/sample-volume-plugin DEBUG=1 |
| ... | ... |
@@ -90,13 +143,13 @@ $ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$devi
|
| 90 | 90 |
|
| 91 | 91 |
### Change the source of the arguments |
| 92 | 92 |
|
| 93 |
-The following example change the source of the args on the `myplugin` plugin. |
|
| 93 |
+The following example change the value of the args on the `myplugin` plugin. |
|
| 94 | 94 |
|
| 95 | 95 |
```bash |
| 96 | 96 |
$ docker plugin inspect -f '{{.Settings.Args}}' myplugin
|
| 97 | 97 |
["foo", "bar"] |
| 98 | 98 |
|
| 99 |
-$ docker plugins set myplugin args="foo bar baz" |
|
| 99 |
+$ docker plugins set myplugin myargs="foo bar baz" |
|
| 100 | 100 |
|
| 101 | 101 |
$ docker plugin inspect -f '{{.Settings.Args}}' myplugin
|
| 102 | 102 |
["foo", "bar", "baz"] |