4.8 KiB
| description | keywords | title |
|---|---|---|
| How to develop and use a plugin with the managed plugin system | API, Usage, plugins, documentation, developer | 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.
-
descriptionstringDescription of the plugin
-
documentationstringLink to the documentation about the plugin
-
interfacePluginInterfaceInterface implemented by the plugins, struct consisting of the following fields:
-
typesstring arrayTypes 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
-
-
socketstringSocket is the name of the socket the engine should use to communicate with the plugins. the socket will be created in
/run/docker/plugins.
-
-
entrypointstring arrayEntrypoint of the plugin, see
ENTRYPOINT -
workdirstringWorking directory of the plugin, see
WORKDIR -
networkPluginNetworkNetwork of the plugin, struct consisting of the following fields:
-
typestringNetwork type.
Supported types:
bridgehostnone
-
-
mountsPluginMount arrayMount of the plugin, struct consisting of the following fields. See
MOUNTS.-
namestringName of the mount.
-
descriptionstringDescription of the mount.
-
sourcestringSource of the mount.
-
destinationstringDestination of the mount.
-
typestringMount type.
-
optionsstring arrayOptions of the mount.
-
-
ipchostBooleanAccess to host ipc namespace.
-
pidhostBooleanAccess to host PID namespace.
-
propagatedMountstringPath 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.
-
envPluginEnv arrayEnvironment variables of the plugin, struct consisting of the following fields:
-
namestringName of the environment variable.
-
descriptionstringDescription of the environment variable.
-
valuestringValue of the environment variable.
-
-
argsPluginArgsArguments of the plugin, struct consisting of the following fields:
-
namestringName of the arguments.
-
descriptionstringDescription of the arguments.
-
valuestring arrayValues of the arguments.
-
-
linuxPluginLinux-
capabilitiesstring arrayCapabilities of the plugin (Linux only), see list
here -
allowAllDevicesBooleanIf
/devis bind mounted from the host, and allowAllDevices is set to true, the plugin will haverwmaccess to all devices on the host. -
devicesPluginDevice arrayDevice of the plugin, (Linux only), struct consisting of the following fields. See
DEVICES.-
namestringName of the device.
-
descriptionstringDescription of the device.
-
pathstringPath of the device.
-
-
Example Config
The following example shows the 'tiborvass/sample-volume-plugin' plugin config.
{
"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": ""
}