github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/cli/docs/extend/config.md (about) 1 --- 2 description: "How to develop and use a plugin with the managed plugin system" 3 keywords: "API, Usage, plugins, documentation, developer" 4 --- 5 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 This document outlines the format of the V0 plugin configuration. 19 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: 22 23 | Config Type | Media Type | 24 |-------------|-----------------------------------------| 25 | config | "application/vnd.docker.plugin.v1+json" | 26 27 ## *Config* Field Descriptions 28 29 Config provides the base accessible fields for working with V0 plugin format 30 in the registry. 31 32 - **`description`** *string* 33 34 description of the plugin 35 36 - **`documentation`** *string* 37 38 link to the documentation about the plugin 39 40 - **`interface`** *PluginInterface* 41 42 interface implemented by the plugins, struct consisting of the following fields 43 44 - **`types`** *string array* 45 46 types indicate what interface(s) the plugin currently implements. 47 48 currently supported: 49 50 - **docker.volumedriver/1.0** 51 52 - **docker.networkdriver/1.0** 53 54 - **docker.ipamdriver/1.0** 55 56 - **docker.authz/1.0** 57 58 - **docker.logdriver/1.0** 59 60 - **docker.metricscollector/1.0** 61 62 - **`socket`** *string* 63 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`. 66 67 68 - **`entrypoint`** *string array* 69 70 entrypoint of the plugin, see [`ENTRYPOINT`](../reference/builder.md#entrypoint) 71 72 - **`workdir`** *string* 73 74 workdir of the plugin, see [`WORKDIR`](../reference/builder.md#workdir) 75 76 - **`network`** *PluginNetwork* 77 78 network of the plugin, struct consisting of the following fields 79 80 - **`type`** *string* 81 82 network type. 83 84 currently supported: 85 86 - **bridge** 87 - **host** 88 - **none** 89 90 - **`mounts`** *PluginMount array* 91 92 mount of the plugin, struct consisting of the following fields, see [`MOUNTS`](https://github.com/opencontainers/runtime-spec/blob/master/config.md#mounts) 93 94 - **`name`** *string* 95 96 name of the mount. 97 98 - **`description`** *string* 99 100 description of the mount. 101 102 - **`source`** *string* 103 104 source of the mount. 105 106 - **`destination`** *string* 107 108 destination of the mount. 109 110 - **`type`** *string* 111 112 mount type. 113 114 - **`options`** *string array* 115 116 options of the mount. 117 118 - **`ipchost`** *boolean* 119 Access to host ipc namespace. 120 - **`pidhost`** *boolean* 121 Access to host pid namespace. 122 123 - **`propagatedMount`** *string* 124 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. 128 129 - **`env`** *PluginEnv array* 130 131 env of the plugin, struct consisting of the following fields 132 133 - **`name`** *string* 134 135 name of the env. 136 137 - **`description`** *string* 138 139 description of the env. 140 141 - **`value`** *string* 142 143 value of the env. 144 145 - **`args`** *PluginArgs* 146 147 args of the plugin, struct consisting of the following fields 148 149 - **`name`** *string* 150 151 name of the args. 152 153 - **`description`** *string* 154 155 description of the args. 156 157 - **`value`** *string array* 158 159 values of the args. 160 161 - **`linux`** *PluginLinux* 162 163 - **`capabilities`** *string array* 164 165 capabilities of the plugin (*Linux only*), see list [`here`](https://github.com/opencontainers/runc/blob/master/libcontainer/SPEC.md#security) 166 167 - **`allowAllDevices`** *boolean* 168 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. 170 171 - **`devices`** *PluginDevice array* 172 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) 174 175 - **`name`** *string* 176 177 name of the device. 178 179 - **`description`** *string* 180 181 description of the device. 182 183 - **`path`** *string* 184 185 path of the device. 186 187 ## Example Config 188 189 *Example showing the 'tiborvass/sample-volume-plugin' plugin config.* 190 191 ```json 192 { 193 "Args": { 194 "Description": "", 195 "Name": "", 196 "Settable": null, 197 "Value": null 198 }, 199 "Description": "A sample volume plugin for Docker", 200 "Documentation": "https://docs.docker.com/engine/extend/plugins/", 201 "Entrypoint": [ 202 "/usr/bin/sample-volume-plugin", 203 "/data" 204 ], 205 "Env": [ 206 { 207 "Description": "", 208 "Name": "DEBUG", 209 "Settable": [ 210 "value" 211 ], 212 "Value": "0" 213 } 214 ], 215 "Interface": { 216 "Socket": "plugin.sock", 217 "Types": [ 218 "docker.volumedriver/1.0" 219 ] 220 }, 221 "Linux": { 222 "Capabilities": null, 223 "AllowAllDevices": false, 224 "Devices": null 225 }, 226 "Mounts": null, 227 "Network": { 228 "Type": "" 229 }, 230 "PropagatedMount": "/data", 231 "User": {}, 232 "Workdir": "" 233 } 234 ```