Signed-off-by: Victor Vieux <victorvieux@gmail.com> cleanup whitespace formatting Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
5 KiB
title | description | keywords |
---|---|---|
Plugin config | How develop and use a plugin with the managed plugin system | API, Usage, plugins, documentation, developer |
Plugin Config Version 0 of Plugin V2
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 release.
Plugin configs describe the various constituents of a docker plugin. Plugin configs can be serialized to JSON format with the following media types:
Config Type | Media Type |
---|---|
config | "application/vnd.docker.plugin.v0+json" |
Config Field Descriptions
Config provides the base accessible fields for working with V0 plugin format in the registry.
-
description
stringdescription of the plugin
-
documentation
stringlink to the documentation about the plugin
-
interface
PluginInterfaceinterface implemented by the plugins, struct consisting of the following fields
-
types
string arraytypes indicate what interface(s) the plugin currently implements.
currently supported:
- docker.volumedriver/1.0
- docker.authz/1.0
-
socket
stringsocket 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 arrayentrypoint of the plugin, see
ENTRYPOINT
-
workdir
stringworkdir of the plugin, see
WORKDIR
-
network
PluginNetworknetwork of the plugin, struct consisting of the following fields
-
type
stringnetwork type.
currently supported:
- bridge - host - none
-
-
mounts
PluginMount arraymount of the plugin, struct consisting of the following fields, see
MOUNTS
-
name
stringname of the mount.
-
description
stringdescription of the mount.
-
source
stringsource of the mount.
-
destination
stringdestination of the mount.
-
type
stringmount type.
-
options
string arrayoptions of the mount.
-
-
env
PluginEnv arrayenv of the plugin, struct consisting of the following fields
-
name
stringname of the env.
-
description
stringdescription of the env.
-
value
stringvalue of the env.
-
-
args
PluginArgsargs of the plugin, struct consisting of the following fields
-
name
stringname of the env.
-
description
stringdescription of the env.
-
value
string arrayvalues of the args.
-
-
linux
PluginLinux-
capabilities
string arraycapabilities of the plugin (*Linux only*), see list [`here`](https://github.com/opencontainers/runc/blob/master/libcontainer/SPEC.md#security)
-
devices
PluginDevice arraydevice 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
Example showing the 'tiborvass/no-remove' plugin config.
{
"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"
}
],
"linux": {
"devices": [
{
"name": "device",
"description": "a host device to mount",
"path": "/dev/cpu_dma_latency"
}
]
}
}