github.com/jiasir/docker@v1.3.3-0.20170609024000-252e610103e7/docs/extend/config.md (about) 1 --- 2 title: "Plugin config" 3 description: "How develop and use a plugin with the managed plugin system" 4 keywords: "API, Usage, plugins, documentation, developer" 5 --- 6 7 <!-- This file is maintained within the docker/docker Github 8 repository at https://github.com/docker/docker/. Make all 9 pull requests against that repo. If you see this file in 10 another repository, consider it read-only there, as it will 11 periodically be overwritten by the definitive file. Pull 12 requests which include edits to this file in other repositories 13 will be rejected. 14 --> 15 16 17 # Plugin Config Version 1 of Plugin V2 18 19 This document outlines the format of the V0 plugin configuration. The plugin 20 config described herein was introduced in the Docker daemon in the [v1.12.0 21 release](https://github.com/docker/docker/commit/f37117045c5398fd3dca8016ea8ca0cb47e7312b). 22 23 Plugin configs describe the various constituents of a docker plugin. Plugin 24 configs can be serialized to JSON format with the following media types: 25 26 Config Type | Media Type 27 ------------- | ------------- 28 config | "application/vnd.docker.plugin.v1+json" 29 30 31 ## *Config* Field Descriptions 32 33 Config provides the base accessible fields for working with V0 plugin format 34 in the registry. 35 36 - **`description`** *string* 37 38 description of the plugin 39 40 - **`documentation`** *string* 41 42 link to the documentation about the plugin 43 44 - **`interface`** *PluginInterface* 45 46 interface implemented by the plugins, struct consisting of the following fields 47 48 - **`types`** *string array* 49 50 types indicate what interface(s) the plugin currently implements. 51 52 currently supported: 53 54 - **docker.volumedriver/1.0** 55 56 - **docker.networkdriver/1.0** 57 58 - **docker.ipamdriver/1.0** 59 60 - **docker.authz/1.0** 61 62 - **docker.logdriver/1.0** 63 64 - **docker.metricscollector/1.0** 65 66 - **`socket`** *string* 67 68 socket is the name of the socket the engine should use to communicate with the plugins. 69 the socket will be created in `/run/docker/plugins`. 70 71 72 - **`entrypoint`** *string array* 73 74 entrypoint of the plugin, see [`ENTRYPOINT`](../reference/builder.md#entrypoint) 75 76 - **`workdir`** *string* 77 78 workdir of the plugin, see [`WORKDIR`](../reference/builder.md#workdir) 79 80 - **`network`** *PluginNetwork* 81 82 network of the plugin, struct consisting of the following fields 83 84 - **`type`** *string* 85 86 network type. 87 88 currently supported: 89 90 - **bridge** 91 - **host** 92 - **none** 93 94 - **`mounts`** *PluginMount array* 95 96 mount of the plugin, struct consisting of the following fields, see [`MOUNTS`](https://github.com/opencontainers/runtime-spec/blob/master/config.md#mounts) 97 98 - **`name`** *string* 99 100 name of the mount. 101 102 - **`description`** *string* 103 104 description of the mount. 105 106 - **`source`** *string* 107 108 source of the mount. 109 110 - **`destination`** *string* 111 112 destination of the mount. 113 114 - **`type`** *string* 115 116 mount type. 117 118 - **`options`** *string array* 119 120 options of the mount. 121 122 - **`ipchost`** *boolean* 123 Access to host ipc namespace. 124 - **`pidhost`** *boolean* 125 Access to host pid namespace. 126 127 - **`propagatedMount`** *string* 128 129 path to be mounted as rshared, so that mounts under that path are visible to docker. This is useful for volume plugins. 130 This path will be bind-mounted outisde of the plugin rootfs so it's contents 131 are preserved on upgrade. 132 133 - **`env`** *PluginEnv array* 134 135 env of the plugin, struct consisting of the following fields 136 137 - **`name`** *string* 138 139 name of the env. 140 141 - **`description`** *string* 142 143 description of the env. 144 145 - **`value`** *string* 146 147 value of the env. 148 149 - **`args`** *PluginArgs* 150 151 args of the plugin, struct consisting of the following fields 152 153 - **`name`** *string* 154 155 name of the args. 156 157 - **`description`** *string* 158 159 description of the args. 160 161 - **`value`** *string array* 162 163 values of the args. 164 165 - **`linux`** *PluginLinux* 166 167 - **`capabilities`** *string array* 168 169 capabilities of the plugin (*Linux only*), see list [`here`](https://github.com/opencontainers/runc/blob/master/libcontainer/SPEC.md#security) 170 171 - **`allowAllDevices`** *boolean* 172 173 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. 174 175 - **`devices`** *PluginDevice array* 176 177 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) 178 179 - **`name`** *string* 180 181 name of the device. 182 183 - **`description`** *string* 184 185 description of the device. 186 187 - **`path`** *string* 188 189 path of the device. 190 191 ## Example Config 192 193 *Example showing the 'tiborvass/sample-volume-plugin' plugin config.* 194 195 ```json 196 { 197 "Args": { 198 "Description": "", 199 "Name": "", 200 "Settable": null, 201 "Value": null 202 }, 203 "Description": "A sample volume plugin for Docker", 204 "Documentation": "https://docs.docker.com/engine/extend/plugins/", 205 "Entrypoint": [ 206 "/usr/bin/sample-volume-plugin", 207 "/data" 208 ], 209 "Env": [ 210 { 211 "Description": "", 212 "Name": "DEBUG", 213 "Settable": [ 214 "value" 215 ], 216 "Value": "0" 217 } 218 ], 219 "Interface": { 220 "Socket": "plugin.sock", 221 "Types": [ 222 "docker.volumedriver/1.0" 223 ] 224 }, 225 "Linux": { 226 "Capabilities": null, 227 "AllowAllDevices": false, 228 "Devices": null 229 }, 230 "Mounts": null, 231 "Network": { 232 "Type": "" 233 }, 234 "PropagatedMount": "/data", 235 "User": {}, 236 "Workdir": "" 237 } 238 ```