首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

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

Plugin V2的插件配置版本1

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

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

配置类型

媒体类型

配置

“应用程序/ vnd.docker.plugin.v1 + JSON”

配置字段说明

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

  • description 插件的字符串描述
  • documentation 字符串 链接到关于插件的文档
  • interface PluginInterface 接口由插件实现,结构由下列字段组成
代码语言:txt
复制
-  **`types`** _string array_ types indicate what interface(s) the plugin currently implements.
 currently supported:
 
代码语言:txt
复制
    -  **docker.volumedriver/1.0**
代码语言:txt
复制
    -  **docker.networkdriver/1.0**
代码语言:txt
复制
    -  **docker.ipamdriver/1.0**
代码语言:txt
复制
    -  **docker.authz/1.0**
代码语言:txt
复制
    -  **docker.logdriver/1.0**
代码语言:txt
复制
    -  **docker.metricscollector/1.0**
代码语言:txt
复制
-  **`socket`** _string_ socket is the name of the socket the engine should use to communicate with the plugins. the socket will be created in 
  • entrypoint 插件的字符串数组入口点,请参阅ENTRYPOINT
  • workdir 插件的字符串 workdir,请参阅WORKDIR
  • network 插件的 PluginNetwork 网络,结构由以下字段组成
代码语言:txt
复制
-  **`type`** _string_ network type.
 currently supported:**bridge** - **host** - **none**
  • mounts 插件的 PluginMount 数组装载,结构由以下字段组成,请参阅MOUNTS
代码语言:txt
复制
-  **`name`** _string_ name of the mount.
 
代码语言:txt
复制
-  **`description`** _string_ description of the mount.
 
代码语言:txt
复制
-  **`source`** _string_ source of the mount.
 
代码语言:txt
复制
-  **`destination`** _string_ destination of the mount.
 
代码语言:txt
复制
-  **`type`** _string_ mount type.
 
代码语言:txt
复制
-  **`options`** _string array_ options of the mount.
 
  • ipchost 布尔型访问主机 ipc 命名空间。
  • pidhost 布尔访问主机 pid 名称空间。
  • propagatedMount 字符串 路径作为 rshared 挂载,以便在该路径下挂载对 docker可见。这对于卷插件很有用。这条路径将被绑定到插件 rootfs 的 outisde,所以它的内容在升级时被保留。
  • env 插件的 PluginEnv 数组 env,结构由以下字段组成
代码语言:txt
复制
-  **`name`** _string_ name of the env.
 
代码语言:txt
复制
-  **`description`** _string_ description of the env.
 
代码语言:txt
复制
-  **`value`** _string_ value of the env.
 
  • args PluginArgs 插件的参数,结构由以下字段组成
代码语言:txt
复制
-  **`name`** _string_ name of the args.
 
代码语言:txt
复制
-  **`description`** _string_ description of the args.
 
代码语言:txt
复制
-  **`value`** _string array_ values of the args.
 
  • linux PluginLinux
代码语言:txt
复制
-  **`capabilities`** _string array_ capabilities of the plugin (
代码语言:txt
复制
-  **`allowAllDevices`** _boolean_ If 
代码语言:txt
复制
-  **`devices`** _PluginDevice array_ device of the plugin, (
代码语言:txt
复制
    -  **`name`** _string_ name of the device.
 
代码语言:txt
复制
    -  **`description`** _string_ description of the device.
 
代码语言:txt
复制
    -  **`path`** _string_ path of the device.
 

示例配置

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

代码语言:javascript
复制
{
            "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": ""
}

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com