1、docker plugin inspect 简介
docker plugin inspect
命令用于显示一个或多个 Docker 插件的详细信息。使用该命令可以查看插件的配置、状态和元数据等信息。返回插件的信息。默认情况下,此命令将所有结果渲染为JSON数组。
参考文档:https://docs.docker.com/engine/reference/commandline/plugin_inspect/
2、docker plugin inspect 语法
docker plugin inspect [OPTIONS] PLUGIN [PLUGIN...]
3、docker plugin inspect 命令
1)检查插件
docker plugin inspect tiborvass/sample-volume-plugin:latest
输出为JSON格式(为了可读性,下面的输出是格式化的):
{ "Id": "8c74c978c434745c3ade82f1bc0acf38d04990eaf494fa507c16d9f1daa99c21", "Name": "tiborvass/sample-volume-plugin:latest", "PluginReference": "tiborvas/sample-volume-plugin:latest", "Enabled": true, "Config": { "Mounts": [ { "Name": "", "Description": "", "Settable": null, "Source": "/data", "Destination": "/data", "Type": "bind", "Options": [ "shared", "rbind" ] }, { "Name": "", "Description": "", "Settable": null, "Source": null, "Destination": "/foobar", "Type": "tmpfs", "Options": null } ], "Env": [ "DEBUG=1" ], "Args": null, "Devices": null }, "Manifest": { "ManifestVersion": "v0", "Description": "A test plugin for Docker", "Documentation": "/engine/extend/plugins/", "Interface": { "Types": [ "docker.volumedriver/1.0" ], "Socket": "plugins.sock" }, "Entrypoint": [ "plugin-sample-volume-plugin", "/data" ], "Workdir": "", "User": { }, "Network": { "Type": "host" }, "Capabilities": null, "Mounts": [ { "Name": "", "Description": "", "Settable": null, "Source": "/data", "Destination": "/data", "Type": "bind", "Options": [ "shared", "rbind" ] }, { "Name": "", "Description": "", "Settable": null, "Source": null, "Destination": "/foobar", "Type": "tmpfs", "Options": null } ], "Devices": [ { "Name": "device", "Description": "a host device to mount", "Settable": null, "Path": "/dev/cpu_dma_latency" } ], "Env": [ { "Name": "DEBUG", "Description": "If set, prints debug messages", "Settable": null, "Value": "1" } ], "Args": { "Name": "args", "Description": "command line arguments", "Settable": null, "Value": [ ] } } }
2)格式化输出
docker plugin inspect -f '{{.Id}}' tiborvass/sample-volume-plugin:latest 8c74c978c434745c3ade82f1bc0acf38d04990eaf494fa507c16d9f1daa99c21
4、命令选项
选项 | 默认 | 描述 |
--format , -f | 使用自定义模板格式化输出: ‘json’:以 JSON 格式输出 ‘TEMPLATE’:使用给定的 Go 模板输出。 请参考 https://docs.docker.com/go/formatting/ 了解有关使用模板格式化输出的更多信息。 |
5、子命令
命令 | 描述 |
docker plugin create | 从根文件系统和配置文件创建插件。 插件数据目录必须包含config.json和 rootfs目录。 |
docker plugin disable | 禁用一个插件。 |
docker plugin enable | 启用一个插件。 |
docker plugin inspect | 显示一个或多个插件的详细信息。 |
docker plugin install | 安装一个插件。 |
docker plugin ls | 列出所有安装的插件。 |
docker plugin push | 将一个插件推送到registry。 |
docker plugin rm | 删除一个或多个插件。 |
docker plugin set | 更改插件的设置。 |
docker plugin upgrade | 升级一个已经存在的插件。 |