github.com/olljanat/moby@v1.13.1/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.authz/1.0**
    57  
    58      - **`socket`** *string*
    59  
    60        socket is the name of the socket the engine should use to communicate with the plugins.
    61        the socket will be created in `/run/docker/plugins`.
    62  
    63  
    64  - **`entrypoint`** *string array*
    65  
    66     entrypoint of the plugin, see [`ENTRYPOINT`](../reference/builder.md#entrypoint)
    67  
    68  - **`workdir`** *string*
    69  
    70     workdir of the plugin, see [`WORKDIR`](../reference/builder.md#workdir)
    71  
    72  - **`network`** *PluginNetwork*
    73  
    74     network of the plugin, struct consisting of the following fields
    75  
    76      - **`type`** *string*
    77  
    78        network type.
    79  
    80        currently supported:
    81  
    82        	- **bridge**
    83        	- **host**
    84        	- **none**
    85  
    86  - **`mounts`** *PluginMount array*
    87  
    88     mount of the plugin, struct consisting of the following fields, see [`MOUNTS`](https://github.com/opencontainers/runtime-spec/blob/master/config.md#mounts)
    89  
    90      - **`name`** *string*
    91  
    92  	  name of the mount.
    93  
    94      - **`description`** *string*
    95  
    96        description of the mount.
    97  
    98      - **`source`** *string*
    99  
   100  	  source of the mount.
   101  
   102      - **`destination`** *string*
   103  
   104  	  destination of the mount.
   105  
   106      - **`type`** *string*
   107  
   108        mount type.
   109  
   110      - **`options`** *string array*
   111  
   112  	  options of the mount.
   113  
   114  - **`propagatedMount`** *string*
   115  
   116     path to be mounted as rshared, so that mounts under that path are visible to docker. This is useful for volume plugins.
   117     This path will be bind-mounted outisde of the plugin rootfs so it's contents
   118     are preserved on upgrade.
   119  
   120  - **`env`** *PluginEnv array*
   121  
   122     env of the plugin, struct consisting of the following fields
   123  
   124      - **`name`** *string*
   125  
   126  	  name of the env.
   127  
   128      - **`description`** *string*
   129  
   130        description of the env.
   131  
   132      - **`value`** *string*
   133  
   134  	  value of the env.
   135  
   136  - **`args`** *PluginArgs*
   137  
   138     args of the plugin, struct consisting of the following fields
   139  
   140      - **`name`** *string*
   141  
   142  	  name of the args.
   143  
   144      - **`description`** *string*
   145  
   146        description of the args.
   147  
   148      - **`value`** *string array*
   149  
   150  	  values of the args.
   151  
   152  - **`linux`** *PluginLinux*
   153  
   154      - **`capabilities`** *string array*
   155  
   156            capabilities of the plugin (*Linux only*), see list [`here`](https://github.com/opencontainers/runc/blob/master/libcontainer/SPEC.md#security)
   157  
   158      - **`allowAllDevices`** *boolean*
   159  
   160  	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  
   162      - **`devices`** *PluginDevice array*
   163  
   164            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  
   166            - **`name`** *string*
   167  
   168  	      name of the device.
   169  
   170            - **`description`** *string*
   171  
   172                description of the device.
   173  
   174            - **`path`** *string*
   175  
   176                path of the device.
   177  
   178  ## Example Config
   179  
   180  *Example showing the 'tiborvass/sample-volume-plugin' plugin config.*
   181  
   182  ```json
   183  {
   184              "Args": {
   185                  "Description": "",
   186                  "Name": "",
   187                  "Settable": null,
   188                  "Value": null
   189              },
   190              "Description": "A sample volume plugin for Docker",
   191              "Documentation": "https://docs.docker.com/engine/extend/plugins/",
   192              "Entrypoint": [
   193                  "/usr/bin/sample-volume-plugin",
   194                  "/data"
   195              ],
   196              "Env": [
   197                  {
   198                      "Description": "",
   199                      "Name": "DEBUG",
   200                      "Settable": [
   201                          "value"
   202                      ],
   203                      "Value": "0"
   204                  }
   205              ],
   206              "Interface": {
   207                  "Socket": "plugin.sock",
   208                  "Types": [
   209                      "docker.volumedriver/1.0"
   210                  ]
   211              },
   212              "Linux": {
   213                  "Capabilities": null,
   214                  "AllowAllDevices": false,
   215                  "Devices": null
   216              },
   217              "Mounts": null,
   218              "Network": {
   219                  "Type": ""
   220              },
   221              "PropagatedMount": "/data",
   222              "User": {},
   223              "Workdir": ""
   224  }
   225  ```