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