github.com/pwn-term/docker@v0.0.0-20210616085119-6e977cce2565/cli/docs/extend/config.md (about)

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