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