在线文档教程

插件配置(引擎) | Plugin configuration (Engine)

插件配置

Plugin V2的插件配置版本1

本文档概述了 V0插件配置的格式。这里描述的插件配置是在v1.12.0版本的 Docker 守护进程中引入的。

插件配置描述了 docker 插件的各种组件。插件配置可以使用以下媒体类型序列化为 JSON 格式:

配置类型媒体类型
配置“应用程序/ vnd.docker.plugin.v1 + JSON”

配置字段说明

Config 提供了在注册表中使用 V0插件格式的基本可访问字段。

  • description 插件的字符串描述

- **`types`** _string array_ types indicate what interface(s) the plugin currently implements. currently supported:

- **docker.volumedriver/1.0**

- **docker.networkdriver/1.0**

- **docker.ipamdriver/1.0**

- **docker.authz/1.0**

- **docker.logdriver/1.0**

- **docker.metricscollector/1.0**

- **`socket`** _string_ socket is the name of the socket the engine should use to communicate with the plugins. the socket will be created in /run/docker/plugins.

  • entrypoint 插件的字符串数组入口点,请参阅ENTRYPOINT

- **`type`** _string_ network type. currently supported:**bridge** - **host** - **none**

  • mounts 插件的 PluginMount 数组装载,结构由以下字段组成,请参阅MOUNTS

- **`name`** _string_ name of the mount.

- **`description`** _string_ description of the mount.

- **`source`** _string_ source of the mount.

- **`destination`** _string_ destination of the mount.

- **`type`** _string_ mount type.

- **`options`** _string array_ options of the mount.

  • ipchost 布尔型访问主机 ipc 命名空间。

- **`name`** _string_ name of the env.

- **`description`** _string_ description of the env.

- **`value`** _string_ value of the env.

  • args PluginArgs 插件的参数,结构由以下字段组成

- **`name`** _string_ name of the args.

- **`description`** _string_ description of the args.

- **`value`** _string array_ values of the args.

  • linux PluginLinux

- **`capabilities`** _string array_ capabilities of the plugin (Linux only), see list here

- **`allowAllDevices`** _boolean_ 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.

- **`devices`** _PluginDevice array_ device of the plugin, (Linux only), struct consisting of the following fields, see DEVICES

- **`name`** _string_ name of the device.

- **`description`** _string_ description of the device.

- **`path`** _string_ path of the device.

示例配置

显示'tiborvass / sample-volume-plugin'插件配置的示例。

{ "Args": { "Description": "", "Name": "", "Settable": null, "Value": null }, "Description": "A sample volume plugin for Docker", "Documentation": "https://docs.docker.com/engine/extend/plugins/", "Entrypoint": [ "/usr/bin/sample-volume-plugin", "/data" ], "Env": [ { "Description": "", "Name": "DEBUG", "Settable": [ "value" ], "Value": "0" } ], "Interface": { "Socket": "plugin.sock", "Types": [ "docker.volumedriver/1.0" ] }, "Linux": { "Capabilities": null, "AllowAllDevices": false, "Devices": null }, "Mounts": null, "Network": { "Type": "" }, "PropagatedMount": "/data", "User": {}, "Workdir": "" }