2016-10-14 18:30:36 -04:00
---
aliases: [
2016-09-07 05:34:57 -04:00
"/engine/extend/"
]
2016-11-07 21:51:47 -05:00
title: "Plugin config"
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-09-07 05:34:57 -04:00
2016-10-19 13:25:45 -04:00
<!-- This file is maintained within the docker/docker Github
repository at https://github.com/docker/docker/. Make all
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-07 21:51:47 -05:00
# Plugin Config Version 0 of Plugin V2
2016-09-07 05:34:57 -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-09-07 05:34:57 -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-09-07 05:34:57 -04:00
2016-11-07 21:51:47 -05:00
Config Type | Media Type
2016-09-07 05:34:57 -04:00
------------- | -------------
2016-11-07 21:51:47 -05:00
config | "application/vnd.docker.plugin.v0+json"
2016-09-07 05:34:57 -04:00
2016-11-07 21:51:47 -05:00
## *Config* Field Descriptions
2016-09-07 05:34:57 -04:00
2016-11-07 21:51:47 -05:00
Config provides the base accessible fields for working with V0 plugin format
2016-09-07 05:34:57 -04:00
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
2016-10-14 18:30:36 -04:00
2016-09-07 05:34:57 -04:00
- **`types`** *string array*
types indicate what interface(s) the plugin currently implements.
currently supported:
- **docker.volumedriver/1.0**
2016-10-14 18:30:36 -04:00
2016-09-07 05:34:57 -04:00
- **`socket`** *string*
2016-10-14 18:30:36 -04:00
2016-09-07 05:34:57 -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-09-07 05:34:57 -04:00
- **`type`** *string*
network type.
currently supported:
- **bridge**
- **host**
- **none**
2016-10-14 18:30:36 -04:00
2016-09-07 05:34:57 -04:00
- **`capabilities`** *array*
capabilities of the plugin (*Linux only*), see list [`here` ](https://github.com/opencontainers/runc/blob/master/libcontainer/SPEC.md#security )
2016-10-14 18:30:36 -04:00
2016-09-07 05:34:57 -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*
name of the mount.
2016-10-14 18:30:36 -04:00
2016-09-07 05:34:57 -04:00
- **`description`** *string*
2016-10-14 18:30:36 -04:00
2016-09-07 05:34:57 -04:00
description of the mount.
2016-10-14 18:30:36 -04:00
2016-09-07 05:34:57 -04:00
- **`source`** *string*
source of the mount.
2016-10-14 18:30:36 -04:00
2016-09-07 05:34:57 -04:00
- **`destination`** *string*
destination of the mount.
2016-10-14 18:30:36 -04:00
2016-09-07 05:34:57 -04:00
- **`type`** *string*
mount type.
2016-10-14 18:30:36 -04:00
2016-09-07 05:34:57 -04:00
- **`options`** *string array*
options of the mount.
2016-10-14 18:30:36 -04:00
2016-09-07 05:34:57 -04:00
- **`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.
2016-10-14 18:30:36 -04:00
2016-09-07 05:34:57 -04:00
- **`description`** *string*
description of the device.
2016-10-14 18:30:36 -04:00
2016-09-07 05:34:57 -04:00
- **`path`** *string*
path of the device.
- **`env`** *PluginEnv array*
env of the plugin, struct consisting of the following fields
- **`name`** *string*
name of the env.
2016-10-14 18:30:36 -04:00
2016-09-07 05:34:57 -04:00
- **`description`** *string*
2016-10-14 18:30:36 -04:00
2016-09-07 05:34:57 -04:00
description of the env.
2016-10-14 18:30:36 -04:00
2016-09-07 05:34:57 -04:00
- **`value`** *string*
value of the env.
2016-10-14 18:30:36 -04:00
2016-09-07 05:34:57 -04:00
- **`args`** *PluginArgs*
args of the plugin, struct consisting of the following fields
- **`name`** *string*
name of the env.
2016-10-14 18:30:36 -04:00
2016-09-07 05:34:57 -04:00
- **`description`** *string*
2016-10-14 18:30:36 -04:00
2016-09-07 05:34:57 -04:00
description of the env.
2016-10-14 18:30:36 -04:00
2016-09-07 05:34:57 -04:00
- **`value`** *string array*
values of the args.
2016-10-14 18:30:36 -04:00
2016-11-07 21:51:47 -05:00
## Example Config
2016-09-07 05:34:57 -04:00
2016-11-07 21:51:47 -05:00
*Example showing the 'tiborvass/no-remove' plugin config.*
2016-09-07 05:34:57 -04:00
```
{
"description": "A test plugin for Docker",
"documentation": "https://docs.docker.com/engine/extend/plugins/",
"entrypoint": ["plugin-no-remove", "/data"],
"interface" : {
"types": ["docker.volumedriver/1.0"],
"socket": "plugins.sock"
},
"network": {
"type": "host"
},
"mounts": [
{
"source": "/data",
"destination": "/data",
"type": "bind",
"options": ["shared", "rbind"]
},
{
"destination": "/foobar",
"type": "tmpfs"
}
],
"args": {
"name": "args",
"description": "command line arguments",
"value": []
},
"env": [
{
"name": "DEBUG",
"description": "If set, prints debug messages",
"value": "1"
}
],
"devices": [
{
"name": "device",
"description": "a host device to mount",
"path": "/dev/cpu_dma_latency"
}
]
}
```