github.com/fabiokung/docker@v0.11.2-0.20170222101415-4534dcd49497/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      - **`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  - **`propagatedMount`** *string*
   119  
   120     path to be mounted as rshared, so that mounts under that path are visible to docker. This is useful for volume plugins.
   121     This path will be bind-mounted outisde of the plugin rootfs so it's contents
   122     are preserved on upgrade.
   123  
   124  - **`env`** *PluginEnv array*
   125  
   126     env of the plugin, struct consisting of the following fields
   127  
   128      - **`name`** *string*
   129  
   130  	  name of the env.
   131  
   132      - **`description`** *string*
   133  
   134        description of the env.
   135  
   136      - **`value`** *string*
   137  
   138  	  value of the env.
   139  
   140  - **`args`** *PluginArgs*
   141  
   142     args of the plugin, struct consisting of the following fields
   143  
   144      - **`name`** *string*
   145  
   146  	  name of the args.
   147  
   148      - **`description`** *string*
   149  
   150        description of the args.
   151  
   152      - **`value`** *string array*
   153  
   154  	  values of the args.
   155  
   156  - **`linux`** *PluginLinux*
   157  
   158      - **`capabilities`** *string array*
   159  
   160            capabilities of the plugin (*Linux only*), see list [`here`](https://github.com/opencontainers/runc/blob/master/libcontainer/SPEC.md#security)
   161  
   162      - **`allowAllDevices`** *boolean*
   163  
   164  	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.
   165  
   166      - **`devices`** *PluginDevice array*
   167  
   168            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)
   169  
   170            - **`name`** *string*
   171  
   172  	      name of the device.
   173  
   174            - **`description`** *string*
   175  
   176                description of the device.
   177  
   178            - **`path`** *string*
   179  
   180                path of the device.
   181  
   182  ## Example Config
   183  
   184  *Example showing the 'tiborvass/sample-volume-plugin' plugin config.*
   185  
   186  ```json
   187  {
   188              "Args": {
   189                  "Description": "",
   190                  "Name": "",
   191                  "Settable": null,
   192                  "Value": null
   193              },
   194              "Description": "A sample volume plugin for Docker",
   195              "Documentation": "https://docs.docker.com/engine/extend/plugins/",
   196              "Entrypoint": [
   197                  "/usr/bin/sample-volume-plugin",
   198                  "/data"
   199              ],
   200              "Env": [
   201                  {
   202                      "Description": "",
   203                      "Name": "DEBUG",
   204                      "Settable": [
   205                          "value"
   206                      ],
   207                      "Value": "0"
   208                  }
   209              ],
   210              "Interface": {
   211                  "Socket": "plugin.sock",
   212                  "Types": [
   213                      "docker.volumedriver/1.0"
   214                  ]
   215              },
   216              "Linux": {
   217                  "Capabilities": null,
   218                  "AllowAllDevices": false,
   219                  "Devices": null
   220              },
   221              "Mounts": null,
   222              "Network": {
   223                  "Type": ""
   224              },
   225              "PropagatedMount": "/data",
   226              "User": {},
   227              "Workdir": ""
   228  }
   229  ```