Browse Source

clarify docker plugin set docs

Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Victor Vieux 8 years ago
parent
commit
a412ad41a5
1 changed files with 56 additions and 3 deletions
  1. 56 3
      docs/reference/commandline/plugin_set.md

+ 56 - 3
docs/reference/commandline/plugin_set.md

@@ -34,6 +34,60 @@ The settings currently supported are:
  * path of devices
  * path of devices
  * args
  * 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
 ## Examples
 
 
 ### Change an environment variable
 ### Change an environment variable
@@ -43,7 +97,6 @@ The following example change the env variable `DEBUG` on the
 
 
 ```bash
 ```bash
 $ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin
 $ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin
-
 [DEBUG=0]
 [DEBUG=0]
 
 
 $ docker plugin set tiborvass/sample-volume-plugin DEBUG=1
 $ 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
 ### 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
 ```bash
 $ docker plugin inspect -f '{{.Settings.Args}}' myplugin
 $ docker plugin inspect -f '{{.Settings.Args}}' myplugin
 ["foo", "bar"]
 ["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
 $ docker plugin inspect -f '{{.Settings.Args}}' myplugin
 ["foo", "bar", "baz"]
 ["foo", "bar", "baz"]