2016-10-14 18:30:36 -04:00
---
description: "How develop and use a plugin with the managed plugin system"
2016-11-03 17:21:33 -04:00
keywords: "API, Usage, plugins, documentation, developer"
2016-10-14 18:30:36 -04:00
---
2016-10-12 19:23:01 -04:00
2017-10-04 13:03:55 -04:00
<!-- This file is maintained within the docker/cli GitHub
2017-07-28 13:28:23 -04:00
repository at https://github.com/docker/cli/. Make all
2016-10-19 13:25:45 -04:00
pull requests against that repo. If you see this file in
another repository, consider it read-only there, as it will
periodically be overwritten by the definitive file. Pull
requests which include edits to this file in other repositories
will be rejected.
-->
2016-11-22 16:42:11 -05:00
2016-12-07 20:35:09 -05:00
# Plugin Config Version 1 of Plugin V2
2016-10-12 19:23:01 -04:00
2016-11-09 20:49:09 -05:00
This document outlines the format of the V0 plugin configuration. The plugin
config described herein was introduced in the Docker daemon in the [v1.12.0
2016-10-12 19:23:01 -04:00
release](https://github.com/docker/docker/commit/f37117045c5398fd3dca8016ea8ca0cb47e7312b).
2016-11-07 21:51:47 -05:00
Plugin configs describe the various constituents of a docker plugin. Plugin
configs can be serialized to JSON format with the following media types:
2016-10-12 19:23:01 -04:00
2016-11-07 21:51:47 -05:00
Config Type | Media Type
2016-10-12 19:23:01 -04:00
------------- | -------------
2016-12-07 20:35:09 -05:00
config | "application/vnd.docker.plugin.v1+json"
2016-10-12 19:23:01 -04:00
2016-11-07 21:51:47 -05:00
## *Config* Field Descriptions
2016-10-12 19:23:01 -04:00
2016-11-07 21:51:47 -05:00
Config provides the base accessible fields for working with V0 plugin format
2016-10-12 19:23:01 -04:00
in the registry.
- **`description`** *string*
2020-05-28 11:28:43 -04:00
description of the plugin
2016-10-12 19:23:01 -04:00
- **`documentation`** *string*
2020-05-28 11:28:43 -04:00
link to the documentation about the plugin
2016-10-12 19:23:01 -04:00
- **`interface`** *PluginInterface*
interface implemented by the plugins, struct consisting of the following fields
2016-10-14 18:30:36 -04:00
2016-10-12 19:23:01 -04:00
- **`types`** *string array*
types indicate what interface(s) the plugin currently implements.
currently supported:
2016-11-23 08:27:09 -05:00
- **docker.volumedriver/1.0**
2016-10-14 18:30:36 -04:00
2016-11-23 08:27:09 -05:00
- **docker.networkdriver/1.0**
- **docker.ipamdriver/1.0**
- **docker.authz/1.0**
2016-10-25 16:39:04 -04:00
2016-11-14 13:53:53 -05:00
- **docker.logdriver/1.0**
2017-04-13 21:56:50 -04:00
- **docker.metricscollector/1.0**
2016-10-12 19:23:01 -04:00
- **`socket`** *string*
2016-10-14 18:30:36 -04:00
2016-10-12 19:23:01 -04:00
socket is the name of the socket the engine should use to communicate with the plugins.
the socket will be created in `/run/docker/plugins` .
- **`entrypoint`** *string array*
entrypoint of the plugin, see [`ENTRYPOINT` ](../reference/builder.md#entrypoint )
- **`workdir`** *string*
workdir of the plugin, see [`WORKDIR` ](../reference/builder.md#workdir )
- **`network`** *PluginNetwork*
network of the plugin, struct consisting of the following fields
2016-10-14 18:30:36 -04:00
2016-10-12 19:23:01 -04:00
- **`type`** *string*
network type.
currently supported:
- **bridge**
- **host**
- **none**
2016-10-14 18:30:36 -04:00
2016-10-12 19:23:01 -04:00
- **`mounts`** *PluginMount array*
mount of the plugin, struct consisting of the following fields, see [`MOUNTS` ](https://github.com/opencontainers/runtime-spec/blob/master/config.md#mounts )
- **`name`** *string*
2020-05-28 11:28:43 -04:00
name of the mount.
2016-10-14 18:30:36 -04:00
2016-10-12 19:23:01 -04:00
- **`description`** *string*
2016-10-14 18:30:36 -04:00
2016-10-12 19:23:01 -04:00
description of the mount.
2016-10-14 18:30:36 -04:00
2016-10-12 19:23:01 -04:00
- **`source`** *string*
2020-05-28 11:28:43 -04:00
source of the mount.
2016-10-14 18:30:36 -04:00
2016-10-12 19:23:01 -04:00
- **`destination`** *string*
2020-05-28 11:28:43 -04:00
destination of the mount.
2016-10-14 18:30:36 -04:00
2016-10-12 19:23:01 -04:00
- **`type`** *string*
mount type.
2016-10-14 18:30:36 -04:00
2016-10-12 19:23:01 -04:00
- **`options`** *string array*
2020-05-28 11:28:43 -04:00
options of the mount.
2016-10-14 18:30:36 -04:00
2017-03-07 21:26:09 -05:00
- **`ipchost`** *boolean*
Access to host ipc namespace.
2017-03-10 17:17:24 -05:00
- **`pidhost`** *boolean*
Access to host pid namespace.
2017-03-07 21:26:09 -05:00
2016-11-22 14:21:34 -05:00
- **`propagatedMount`** *string*
path to be mounted as rshared, so that mounts under that path are visible to docker. This is useful for volume plugins.
2017-10-31 06:21:09 -04:00
This path will be bind-mounted outside of the plugin rootfs so it's contents
2017-02-02 23:08:35 -05:00
are preserved on upgrade.
2016-11-22 14:21:34 -05:00
2016-10-12 19:23:01 -04:00
- **`env`** *PluginEnv array*
env of the plugin, struct consisting of the following fields
- **`name`** *string*
2020-05-28 11:28:43 -04:00
name of the env.
2016-10-14 18:30:36 -04:00
2016-10-12 19:23:01 -04:00
- **`description`** *string*
2016-10-14 18:30:36 -04:00
2016-10-12 19:23:01 -04:00
description of the env.
2016-10-14 18:30:36 -04:00
2016-10-12 19:23:01 -04:00
- **`value`** *string*
2020-05-28 11:28:43 -04:00
value of the env.
2016-10-14 18:30:36 -04:00
2016-10-12 19:23:01 -04:00
- **`args`** *PluginArgs*
args of the plugin, struct consisting of the following fields
- **`name`** *string*
2020-05-28 11:28:43 -04:00
name of the args.
2016-10-14 18:30:36 -04:00
2016-10-12 19:23:01 -04:00
- **`description`** *string*
2016-10-14 18:30:36 -04:00
2016-12-12 04:24:12 -05:00
description of the args.
2016-10-14 18:30:36 -04:00
2016-10-12 19:23:01 -04:00
- **`value`** *string array*
2020-05-28 11:28:43 -04:00
values of the args.
2016-10-14 18:30:36 -04:00
2016-11-22 16:42:11 -05:00
- **`linux`** *PluginLinux*
- **`capabilities`** *string array*
2017-04-27 13:59:39 -04:00
capabilities of the plugin (*Linux only*), see list [`here` ](https://github.com/opencontainers/runc/blob/master/libcontainer/SPEC.md#security )
2016-11-22 16:42:11 -05:00
2017-01-10 14:00:57 -05:00
- **`allowAllDevices`** *boolean*
2020-05-28 11:28:43 -04:00
If `/dev` is bind mounted from the host, and allowAllDevices is set to true, the plugin will have `rwm` access to all devices on the host.
2017-01-10 14:00:57 -05:00
2016-11-22 16:42:11 -05:00
- **`devices`** *PluginDevice array*
2017-04-27 13:59:39 -04:00
device of the plugin, (*Linux only*), struct consisting of the following fields, see [`DEVICES` ](https://github.com/opencontainers/runtime-spec/blob/master/config-linux.md#devices )
2016-11-22 16:42:11 -05:00
2017-04-27 13:59:39 -04:00
- **`name`** *string*
2016-11-22 16:42:11 -05:00
2020-05-28 11:28:43 -04:00
name of the device.
2016-11-22 16:42:11 -05:00
2017-04-27 13:59:39 -04:00
- **`description`** *string*
2016-11-22 16:42:11 -05:00
2017-04-27 13:59:39 -04:00
description of the device.
2016-11-22 16:42:11 -05:00
2017-04-27 13:59:39 -04:00
- **`path`** *string*
2016-11-22 16:42:11 -05:00
2017-04-27 13:59:39 -04:00
path of the device.
2016-10-14 18:30:36 -04:00
2016-11-07 21:51:47 -05:00
## Example Config
2016-10-12 19:23:01 -04:00
2016-12-14 03:35:34 -05:00
*Example showing the 'tiborvass/sample-volume-plugin' plugin config.*
2016-10-12 19:23:01 -04:00
2016-11-23 18:22:02 -05:00
```json
2016-10-12 19:23:01 -04:00
{
2020-05-28 11:28:43 -04:00
"Args": {
"Description": "",
"Name": "",
"Settable": null,
"Value": null
},
"Description": "A sample volume plugin for Docker",
"Documentation": "https://docs.docker.com/engine/extend/plugins/",
"Entrypoint": [
"/usr/bin/sample-volume-plugin",
"/data"
],
"Env": [
{
"Description": "",
"Name": "DEBUG",
"Settable": [
"value"
],
"Value": "0"
}
],
"Interface": {
"Socket": "plugin.sock",
"Types": [
"docker.volumedriver/1.0"
]
},
"Linux": {
"Capabilities": null,
"AllowAllDevices": false,
"Devices": null
},
"Mounts": null,
"Network": {
"Type": ""
},
"PropagatedMount": "/data",
"User": {},
"Workdir": ""
2016-10-12 19:23:01 -04:00
}
```