1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
|
---
description: "How to develop and use a plugin with the managed plugin system"
keywords: "API, Usage, plugins, documentation, developer"
title: Plugin Config Version 1 of Plugin V2
---
This document outlines the format of the V0 plugin configuration.
Plugin configs describe the various constituents of a Docker engine plugin.
Plugin configs can be serialized to JSON format with the following media types:
| Config Type | Media Type |
|-------------|-----------------------------------------|
| config | `application/vnd.docker.plugin.v1+json` |
## Config Field Descriptions
Config provides the base accessible fields for working with V0 plugin format in
the registry.
- `description` string
Description of the plugin
- `documentation` string
Link to the documentation about the plugin
- `interface` PluginInterface
Interface implemented by the plugins, struct consisting of the following fields:
- `types` string array
Types indicate what interface(s) the plugin currently implements.
Supported types:
- `docker.volumedriver/1.0`
- `docker.networkdriver/1.0`
- `docker.ipamdriver/1.0`
- `docker.authz/1.0`
- `docker.logdriver/1.0`
- `docker.metricscollector/1.0`
- `socket` string
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`](https://docs.docker.com/reference/dockerfile/#entrypoint)
- `workdir` string
Working directory of the plugin, see [`WORKDIR`](https://docs.docker.com/reference/dockerfile/#workdir)
- `network` PluginNetwork
Network of the plugin, struct consisting of the following fields:
- `type` string
Network type.
Supported types:
- `bridge`
- `host`
- `none`
- `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
Name of the mount.
- `description` string
Description of the mount.
- `source` string
Source of the mount.
- `destination` string
Destination of the mount.
- `type` string
Mount type.
- `options` string array
Options of the mount.
- `ipchost` Boolean
Access to host ipc namespace.
- `pidhost` Boolean
Access to host PID namespace.
- `propagatedMount` string
Path to be mounted as rshared, so that mounts under that path are visible to
Docker. This is useful for volume plugins. This path will be bind-mounted
outside of the plugin rootfs so it's contents are preserved on upgrade.
- `env` PluginEnv array
Environment variables of the plugin, struct consisting of the following fields:
- `name` string
Name of the environment variable.
- `description` string
Description of the environment variable.
- `value` string
Value of the environment variable.
- `args` PluginArgs
Arguments of the plugin, struct consisting of the following fields:
- `name` string
Name of the arguments.
- `description` string
Description of the arguments.
- `value` string array
Values of the arguments.
- `linux` PluginLinux
- `capabilities` string array
Capabilities of the plugin (Linux only), see list [`here`](https://github.com/opencontainers/runc/blob/master/libcontainer/SPEC.md#security)
- `allowAllDevices` Boolean
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.
- `devices` PluginDevice array
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).
- `name` string
Name of the device.
- `description` string
Description of the device.
- `path` string
Path of the device.
## Example Config
The following example shows the 'tiborvass/sample-volume-plugin' plugin config.
```json
{
"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": ""
}
```
|