?
This document uses PHP Chinese website manual Release
本文檔概述了 V0插件配置的格式。這里描述的插件配置是在v1.12.0版本的 Docker 守護(hù)進(jìn)程中引入的。
插件配置描述了 docker 插件的各種組件。插件配置可以使用以下媒體類型序列化為 JSON 格式:
配置類型 | 媒體類型 |
---|---|
配置 | “應(yīng)用程序/ vnd.docker.plugin.v1 + JSON” |
Config 提供了在注冊表中使用 V0插件格式的基本可訪問字段。
description
插件的字符串描述
documentation
字符串 鏈接到關(guān)于插件的文檔
interface
PluginInterface 接口由插件實(shí)現(xiàn),結(jié)構(gòu)由下列字段組成
- **`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
插件的字符串?dāng)?shù)組入口點(diǎn),請參閱ENTRYPOINT
workdir
插件的字符串 workdir,請參閱WORKDIR
network
插件的 PluginNetwork 網(wǎng)絡(luò),結(jié)構(gòu)由以下字段組成
- **`type`** _string_ network type. currently supported:**bridge** - **host** - **none**
mounts
插件的 PluginMount 數(shù)組裝載,結(jié)構(gòu)由以下字段組成,請參閱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
布爾型訪問主機(jī) ipc 命名空間。
pidhost
布爾訪問主機(jī) pid 名稱空間。
propagatedMount
字符串 路徑作為 rshared 掛載,以便在該路徑下掛載對 docker可見。這對于卷插件很有用。這條路徑將被綁定到插件 rootfs 的 outisde,所以它的內(nèi)容在升級時(shí)被保留。
env
插件的 PluginEnv 數(shù)組 env,結(jié)構(gòu)由以下字段組成
- **`name`** _string_ name of the env.
- **`description`** _string_ description of the env.
- **`value`** _string_ value of the env.
args
PluginArgs 插件的參數(shù),結(jié)構(gòu)由以下字段組成
- **`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": ""}