1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #29431 from vieux/update_plugin_examples

replace no-remove by sample-volume-plugin in docs
This commit is contained in:
Victor Vieux 2017-01-03 18:05:44 -08:00 committed by GitHub
commit 355f2ae972
11 changed files with 109 additions and 182 deletions

View file

@ -1498,74 +1498,39 @@ definitions:
type: "string" type: "string"
example: example:
Id: "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078" Id: "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078"
Name: "tiborvass/no-remove" Name: "tiborvass/sample-volume-plugin"
Tag: "latest" Tag: "latest"
Active: true Active: true
Config: Settings:
Mounts:
- Name: ""
Description: ""
Settable: null
Source: "/data"
Destination: "/data"
Type: "bind"
Options:
- "shared"
- "rbind"
- Name: ""
Description: ""
Settable: null
Source: null
Destination: "/foobar"
Type: "tmpfs"
Options: null
Env: Env:
- "DEBUG=1" - "DEBUG=0"
Args: null Args: null
Devices: null Devices: null
Manifest: Config:
ManifestVersion: "v0" Description: "A sample volume plugin for Docker"
Description: "A test plugin for Docker"
Documentation: "https://docs.docker.com/engine/extend/plugins/" Documentation: "https://docs.docker.com/engine/extend/plugins/"
Interface: Interface:
Types: Types:
- "docker.volumedriver/1.0" - "docker.volumedriver/1.0"
Socket: "plugins.sock" Socket: "plugins.sock"
Entrypoint: Entrypoint:
- "plugin-no-remove" - "/usr/bin/sample-volume-plugin"
- "/data" - "/data"
WorkDir: "" WorkDir: ""
User: {} User: {}
Network: Network:
Type: "host" Type: ""
Capabilities: null Linux:
Mounts: Capabilities: null
- Name: "" DeviceCreation: false
Description: "" Devices: null
Settable: null Mounts: null
Source: "/data" PropagatedMount: "/data"
Destination: "/data"
Type: "bind"
Options:
- "shared"
- "rbind"
- Name: ""
Description: ""
Settable: null
Source: null
Destination: "/foobar"
Type: "tmpfs"
Options: null
Devices:
- Name: "device"
Description: "a host device to mount"
Settable: null
Path: "/dev/cpu_dma_latency"
Env: Env:
- Name: "DEBUG" - Name: "DEBUG"
Description: "If set, prints debug messages" Description: "If set, prints debug messages"
Settable: null Settable: null
Value: "1" Value: "0"
Args: Args:
Name: "args" Name: "args"
Description: "command line arguments" Description: "command line arguments"
@ -6374,74 +6339,39 @@ paths:
$ref: "#/definitions/Plugin" $ref: "#/definitions/Plugin"
example: example:
- Id: "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078" - Id: "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078"
Name: "tiborvass/no-remove" Name: "tiborvass/sample-volume-plugin"
Tag: "latest" Tag: "latest"
Active: true Active: true
Config: Settings:
Mounts:
- Name: ""
Description: ""
Settable: null
Source: "/data"
Destination: "/data"
Type: "bind"
Options:
- "shared"
- "rbind"
- Name: ""
Description: ""
Settable: null
Source: null
Destination: "/foobar"
Type: "tmpfs"
Options: null
Env: Env:
- "DEBUG=1" - "DEBUG=0"
Args: null Args: null
Devices: null Devices: null
Manifest: Config:
ManifestVersion: "v0" Description: "A sample volume plugin for Docker"
Description: "A test plugin for Docker"
Documentation: "https://docs.docker.com/engine/extend/plugins/" Documentation: "https://docs.docker.com/engine/extend/plugins/"
Interface: Interface:
Types: Types:
- "docker.volumedriver/1.0" - "docker.volumedriver/1.0"
Socket: "plugins.sock" Socket: "plugins.sock"
Entrypoint: Entrypoint:
- "plugin-no-remove" - "/usr/bin/sample-volume-plugin"
- "/data" - "/data"
WorkDir: "" WorkDir: ""
User: {} User: {}
Network: Network:
Type: "host" Type: ""
Capabilities: null Linux:
Mounts: Capabilities: null
- Name: "" DeviceCreation: false
Description: "" Devices: null
Settable: null Mounts: null
Source: "/data" PropagatedMount: "/data"
Destination: "/data"
Type: "bind"
Options:
- "shared"
- "rbind"
- Name: ""
Description: ""
Settable: null
Source: null
Destination: "/foobar"
Type: "tmpfs"
Options: null
Devices:
- Name: "device"
Description: "a host device to mount"
Settable: null
Path: "/dev/cpu_dma_latency"
Env: Env:
- Name: "DEBUG" - Name: "DEBUG"
Description: "If set, prints debug messages" Description: "If set, prints debug messages"
Settable: null Settable: null
Value: "1" Value: "0"
Args: Args:
Name: "args" Name: "args"
Description: "command line arguments" Description: "command line arguments"

View file

@ -171,52 +171,49 @@ Config provides the base accessible fields for working with V0 plugin format
## Example Config ## Example Config
*Example showing the 'tiborvass/no-remove' plugin config.* *Example showing the 'tiborvass/sample-volume-plugin' plugin config.*
```json ```json
{ {
"description": "A test plugin for Docker", "Args": {
"documentation": "https://docs.docker.com/engine/extend/plugins/", "Description": "",
"entrypoint": ["plugin-no-remove", "/data"], "Name": "",
"interface": { "Settable": null,
"types": ["docker.volumedriver/1.0"], "Value": null
"socket": "plugins.sock" },
}, "Description": "A sample volume plugin for Docker",
"network": { "Documentation": "https://docs.docker.com/engine/extend/plugins/",
"type": "host" "Entrypoint": [
}, "/usr/bin/sample-volume-plugin",
"mounts": [ "/data"
{ ],
"source": "/data", "Env": [
"destination": "/data", {
"type": "bind", "Description": "",
"options": ["shared", "rbind"] "Name": "DEBUG",
}, "Settable": [
{ "value"
"destination": "/foobar", ],
"type": "tmpfs" "Value": "0"
} }
], ],
"args": { "Interface": {
"name": "args", "Socket": "plugin.sock",
"description": "command line arguments", "Types": [
"value": [] "docker.volumedriver/1.0"
}, ]
"env": [ },
{ "Linux": {
"name": "DEBUG", "Capabilities": null,
"description": "If set, prints debug messages", "DeviceCreation": false,
"value": "1" "Devices": null
} },
], "Mounts": null,
"linux": { "Network": {
"devices": [ "Type": ""
{ },
"name": "device", "PropagatedMount": "/data",
"description": "a host device to mount", "User": {},
"path": "/dev/cpu_dma_latency" "Workdir": ""
}
]
}
} }
``` ```

View file

@ -194,8 +194,8 @@ relative to the current time on the client machine:
2015-12-23T21:38:25.119625123Z network connect 8b111217944ba0ba844a65b13efcd57dc494932ee2527577758f939315ba2c5b (name=test-event-network-local, container=b4be644031a3d90b400f88ab3d4bdf4dc23adb250e696b6328b85441abe2c54e, type=bridge) 2015-12-23T21:38:25.119625123Z network connect 8b111217944ba0ba844a65b13efcd57dc494932ee2527577758f939315ba2c5b (name=test-event-network-local, container=b4be644031a3d90b400f88ab3d4bdf4dc23adb250e696b6328b85441abe2c54e, type=bridge)
$ docker events --filter 'type=plugin' (experimental) $ docker events --filter 'type=plugin' (experimental)
2016-07-25T17:30:14.825557616Z plugin pull ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/no-remove:latest) 2016-07-25T17:30:14.825557616Z plugin pull ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/sample-volume-plugin:latest)
2016-07-25T17:30:14.888127370Z plugin enable ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/no-remove:latest) 2016-07-25T17:30:14.888127370Z plugin enable ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/sample-volume-plugin:latest)
**Format:** **Format:**

View file

@ -30,27 +30,27 @@ see [`docker plugin install`](plugin_install.md). Without the `-f` option,
a plugin that has references (eg, volumes, networks) cannot be disabled. a plugin that has references (eg, volumes, networks) cannot be disabled.
The following example shows that the `no-remove` plugin is installed The following example shows that the `sample-volume-plugin` plugin is installed
and enabled: and enabled:
```bash ```bash
$ docker plugin ls $ docker plugin ls
ID NAME TAG DESCRIPTION ENABLED ID NAME TAG DESCRIPTION ENABLED
69553ca1d123 tiborvass/no-remove latest A test plugin for Docker true 69553ca1d123 tiborvass/sample-volume-plugin latest A test plugin for Docker true
``` ```
To disable the plugin, use the following command: To disable the plugin, use the following command:
```bash ```bash
$ docker plugin disable tiborvass/no-remove $ docker plugin disable tiborvass/sample-volume-plugin
tiborvass/no-remove tiborvass/sample-volume-plugin
$ docker plugin ls $ docker plugin ls
ID NAME TAG DESCRIPTION ENABLED ID NAME TAG DESCRIPTION ENABLED
69553ca1d123 tiborvass/no-remove latest A test plugin for Docker false 69553ca1d123 tiborvass/sample-volume-plugin latest A test plugin for Docker false
``` ```
## Related information ## Related information

View file

@ -29,27 +29,27 @@ Enables a plugin. The plugin must be installed before it can be enabled,
see [`docker plugin install`](plugin_install.md). see [`docker plugin install`](plugin_install.md).
The following example shows that the `no-remove` plugin is installed, The following example shows that the `sample-volume-plugin` plugin is installed,
but disabled: but disabled:
```bash ```bash
$ docker plugin ls $ docker plugin ls
ID NAME TAG DESCRIPTION ENABLED ID NAME TAG DESCRIPTION ENABLED
69553ca1d123 tiborvass/no-remove latest A test plugin for Docker false 69553ca1d123 tiborvass/sample-volume-plugin latest A test plugin for Docker false
``` ```
To enable the plugin, use the following command: To enable the plugin, use the following command:
```bash ```bash
$ docker plugin enable tiborvass/no-remove $ docker plugin enable tiborvass/sample-volume-plugin
tiborvass/no-remove tiborvass/sample-volume-plugin
$ docker plugin ls $ docker plugin ls
ID NAME TAG DESCRIPTION ENABLED ID NAME TAG DESCRIPTION ENABLED
69553ca1d123 tiborvass/no-remove latest A test plugin for Docker true 69553ca1d123 tiborvass/sample-volume-plugin latest A test plugin for Docker true
``` ```
## Related information ## Related information

View file

@ -31,12 +31,12 @@ in a JSON array.
Example output: Example output:
```bash ```bash
$ docker plugin inspect tiborvass/no-remove:latest $ docker plugin inspect tiborvass/sample-volume-plugin:latest
``` ```
```JSON ```JSON
{ {
"Id": "8c74c978c434745c3ade82f1bc0acf38d04990eaf494fa507c16d9f1daa99c21", "Id": "8c74c978c434745c3ade82f1bc0acf38d04990eaf494fa507c16d9f1daa99c21",
"Name": "tiborvass/no-remove:latest", "Name": "tiborvass/sample-volume-plugin:latest",
"Enabled": true, "Enabled": true,
"Config": { "Config": {
"Mounts": [ "Mounts": [
@ -79,7 +79,7 @@ $ docker plugin inspect tiborvass/no-remove:latest
"Socket": "plugins.sock" "Socket": "plugins.sock"
}, },
"Entrypoint": [ "Entrypoint": [
"plugin-no-remove", "plugin-sample-volume-plugin",
"/data" "/data"
], ],
"Workdir": "", "Workdir": "",
@ -143,7 +143,7 @@ $ docker plugin inspect tiborvass/no-remove:latest
```bash ```bash
$ docker plugin inspect -f '{{.Id}}' tiborvass/no-remove:latest $ docker plugin inspect -f '{{.Id}}' tiborvass/sample-volume-plugin:latest
``` ```
``` ```
8c74c978c434745c3ade82f1bc0acf38d04990eaf494fa507c16d9f1daa99c21 8c74c978c434745c3ade82f1bc0acf38d04990eaf494fa507c16d9f1daa99c21

View file

@ -33,20 +33,20 @@ the registry. Note that the minimum required registry version to distribute
plugins is 2.3.0 plugins is 2.3.0
The following example installs `no-remove` plugin and [set](plugin_set.md) it's env variable The following example installs `vieus/sshfs` plugin and [set](plugin_set.md) it's env variable
`DEBUG` to 1. Install consists of pulling the plugin from Docker Hub, prompting `DEBUG` to 1. Install consists of pulling the plugin from Docker Hub, prompting
the user to accept the list of privileges that the plugin needs, settings parameters the user to accept the list of privileges that the plugin needs, settings parameters
and enabling the plugin. and enabling the plugin.
```bash ```bash
$ docker plugin install tiborvass/no-remove DEBUG=1 $ docker plugin install vieux/sshfs DEBUG=1
Plugin "tiborvass/no-remove" is requesting the following privileges: Plugin "vieux/sshfs" is requesting the following privileges:
- network: [host] - network: [host]
- mount: [/data] - device: [/dev/fuse]
- device: [/dev/cpu_dma_latency] - capabilities: [CAP_SYS_ADMIN]
Do you grant the above permissions? [y/N] y Do you grant the above permissions? [y/N] y
tiborvass/no-remove vieux/sshfs
``` ```
After the plugin is installed, it appears in the list of plugins: After the plugin is installed, it appears in the list of plugins:
@ -55,7 +55,7 @@ After the plugin is installed, it appears in the list of plugins:
$ docker plugin ls $ docker plugin ls
ID NAME TAG DESCRIPTION ENABLED ID NAME TAG DESCRIPTION ENABLED
69553ca1d123 tiborvass/no-remove latest A test plugin for Docker true 69553ca1d123 vieux/sshfs latest sshFS plugin for Docker true
``` ```
## Related information ## Related information

View file

@ -36,8 +36,8 @@ Example output:
```bash ```bash
$ docker plugin ls $ docker plugin ls
ID NAME TAG DESCRIPTION ENABLED ID NAME TAG DESCRIPTION ENABLED
69553ca1d123 tiborvass/no-remove latest A test plugin for Docker true 69553ca1d123 tiborvass/sample-volume-plugin latest A test plugin for Docker true
``` ```
## Related information ## Related information

View file

@ -33,14 +33,14 @@ a plugin using the [`docker plugin disable`](plugin_disable.md) before removing
it (or use --force, use of force is not recommended, since it can affect it (or use --force, use of force is not recommended, since it can affect
functioning of running containers using the plugin). functioning of running containers using the plugin).
The following example disables and removes the `no-remove:latest` plugin; The following example disables and removes the `sample-volume-plugin:latest` plugin;
```bash ```bash
$ docker plugin disable tiborvass/no-remove $ docker plugin disable tiborvass/sample-volume-plugin
tiborvass/no-remove tiborvass/sample-volume-plugin
$ docker plugin rm tiborvass/no-remove:latest $ docker plugin rm tiborvass/sample-volume-plugin:latest
tiborvass/no-remove tiborvass/sample-volume-plugin
``` ```
## Related information ## Related information

View file

@ -33,15 +33,15 @@ The settings currently supported are:
* args * args
The following example change the env variable `DEBUG` on the The following example change the env variable `DEBUG` on the
`no-remove` plugin. `sample-volume-plugin` plugin.
```bash ```bash
$ docker plugin inspect -f {{.Settings.Env}} tiborvass/no-remove $ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin
[DEBUG=0] [DEBUG=0]
$ docker plugin set tiborvass/no-remove DEBUG=1 $ docker plugin set tiborvass/sample-volume-plugin DEBUG=1
$ docker plugin inspect -f {{.Settings.Env}} tiborvass/no-remove $ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin
[DEBUG=1] [DEBUG=1]
``` ```

View file

@ -129,6 +129,6 @@ Lines. For information about JSON Lines, please refer to http://jsonlines.org/ .
2015-12-23T21:38:25.119625123Z network connect 8b111217944ba0ba844a65b13efcd57dc494932ee2527577758f939315ba2c5b (name=test-event-network-local, container=b4be644031a3d90b400f88ab3d4bdf4dc23adb250e696b6328b85441abe2c54e, type=bridge) 2015-12-23T21:38:25.119625123Z network connect 8b111217944ba0ba844a65b13efcd57dc494932ee2527577758f939315ba2c5b (name=test-event-network-local, container=b4be644031a3d90b400f88ab3d4bdf4dc23adb250e696b6328b85441abe2c54e, type=bridge)
$ docker events --filter 'type=plugin' (experimental) $ docker events --filter 'type=plugin' (experimental)
2016-07-25T17:30:14.825557616Z plugin pull ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/no-remove:latest) 2016-07-25T17:30:14.825557616Z plugin pull ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/sample-volume-plugin:latest)
2016-07-25T17:30:14.888127370Z plugin enable ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/no-remove:latest) 2016-07-25T17:30:14.888127370Z plugin enable ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/sample-volume-plugin:latest)