2016-10-14 18:30:36 -04:00
|
|
|
---
|
2022-06-06 08:22:38 -04:00
|
|
|
description: "How to develop and use a plugin with the managed plugin system"
|
2016-11-03 17:21:33 -04:00
|
|
|
keywords: "API, Usage, plugins, documentation, developer"
|
2024-01-10 04:38:42 -05:00
|
|
|
title: Plugin Config Version 1 of Plugin V2
|
2016-10-14 18:30:36 -04:00
|
|
|
---
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2022-06-06 08:22:38 -04:00
|
|
|
This document outlines the format of the V0 plugin configuration.
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Plugin configs describe the various constituents of a Docker engine plugin.
|
|
|
|
Plugin configs can be serialized to JSON format with the following media types:
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2022-06-06 08:22:38 -04:00
|
|
|
| Config Type | Media Type |
|
|
|
|
|-------------|-----------------------------------------|
|
2024-01-10 04:38:42 -05:00
|
|
|
| config | `application/vnd.docker.plugin.v1+json` |
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
## Config Field Descriptions
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Config provides the base accessible fields for working with V0 plugin format in
|
|
|
|
the registry.
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `description` string
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Description of the plugin
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `documentation` string
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Link to the documentation about the plugin
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `interface` PluginInterface
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Interface implemented by the plugins, struct consisting of the following fields:
|
2016-10-14 18:30:36 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `types` string array
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Types indicate what interface(s) the plugin currently implements.
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Supported types:
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `docker.volumedriver/1.0`
|
2016-10-14 18:30:36 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `docker.networkdriver/1.0`
|
2016-11-23 08:27:09 -05:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `docker.ipamdriver/1.0`
|
2016-11-23 08:27:09 -05:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `docker.authz/1.0`
|
2016-10-25 16:39:04 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `docker.logdriver/1.0`
|
2016-11-14 13:53:53 -05:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `docker.metricscollector/1.0`
|
2017-04-13 21:56:50 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `socket` string
|
2016-10-14 18:30:36 -04:00
|
|
|
|
2024-01-10 04:38:42 -05: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`.
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `entrypoint` string array
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-02-13 07:40:53 -05:00
|
|
|
Entrypoint of the plugin, see [`ENTRYPOINT`](https://docs.docker.com/reference/dockerfile/#entrypoint)
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `workdir` string
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-02-13 07:40:53 -05:00
|
|
|
Working directory of the plugin, see [`WORKDIR`](https://docs.docker.com/reference/dockerfile/#workdir)
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `network` PluginNetwork
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Network of the plugin, struct consisting of the following fields:
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `type` string
|
2016-10-14 18:30:36 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Network type.
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Supported types:
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `bridge`
|
|
|
|
- `host`
|
|
|
|
- `none`
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `mounts` PluginMount array
|
2016-10-14 18:30:36 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Mount of the plugin, struct consisting of the following fields.
|
|
|
|
See [`MOUNTS`](https://github.com/opencontainers/runtime-spec/blob/master/config.md#mounts).
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `name` string
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Name of the mount.
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `description` string
|
2016-10-14 18:30:36 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Description of the mount.
|
2016-10-14 18:30:36 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `source` string
|
2016-10-14 18:30:36 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Source of the mount.
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `destination` string
|
2016-10-14 18:30:36 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Destination of the mount.
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `type` string
|
2016-10-14 18:30:36 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Mount type.
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `options` string array
|
2016-10-14 18:30:36 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Options of the mount.
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `ipchost` Boolean
|
2016-10-14 18:30:36 -04:00
|
|
|
|
2017-03-07 21:26:09 -05:00
|
|
|
Access to host ipc namespace.
|
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `pidhost` Boolean
|
|
|
|
|
|
|
|
Access to host PID namespace.
|
|
|
|
|
|
|
|
- `propagatedMount` string
|
2016-11-22 14:21:34 -05:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
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.
|
2016-11-22 14:21:34 -05:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `env` PluginEnv array
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Environment variables of the plugin, struct consisting of the following fields:
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `name` string
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Name of the environment variable.
|
2016-10-14 18:30:36 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `description` string
|
2016-10-14 18:30:36 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Description of the environment variable.
|
2016-10-14 18:30:36 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `value` string
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Value of the environment variable.
|
2016-10-14 18:30:36 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `args` PluginArgs
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Arguments of the plugin, struct consisting of the following fields:
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `name` string
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Name of the arguments.
|
2016-10-14 18:30:36 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `description` string
|
2016-10-14 18:30:36 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Description of the arguments.
|
2016-10-14 18:30:36 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `value` string array
|
2016-10-12 19:23:01 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Values of the arguments.
|
2016-10-14 18:30:36 -04:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `linux` PluginLinux
|
2016-11-22 16:42:11 -05:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `capabilities` string array
|
2016-11-22 16:42:11 -05:00
|
|
|
|
2024-01-10 04:38:42 -05: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
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `allowAllDevices` Boolean
|
2017-01-10 14:00:57 -05:00
|
|
|
|
2024-01-10 04:38:42 -05: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
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `devices` PluginDevice array
|
2016-11-22 16:42:11 -05:00
|
|
|
|
2024-01-10 04:38:42 -05: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
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `name` string
|
2016-11-22 16:42:11 -05:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Name of the device.
|
2016-11-22 16:42:11 -05:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `description` string
|
2016-11-22 16:42:11 -05:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
Description of the device.
|
2016-11-22 16:42:11 -05:00
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
- `path` string
|
2016-11-22 16:42:11 -05:00
|
|
|
|
2024-01-10 04:38:42 -05: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
|
|
|
|
2024-01-10 04:38:42 -05:00
|
|
|
The following example shows 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
|
|
|
}
|
|
|
|
```
|