mirror of https://github.com/docker/cli.git
rename plugin manifest
Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
parent
ebacbb50ae
commit
fdfcbe778a
|
@ -2,7 +2,7 @@
|
|||
aliases: [
|
||||
"/engine/extend/"
|
||||
]
|
||||
title: "Plugin manifest"
|
||||
title: "Plugin config"
|
||||
description: "How develop and use a plugin with the managed plugin system"
|
||||
keywords: "API, Usage, plugins, documentation, developer"
|
||||
advisory: "experimental"
|
||||
|
@ -17,29 +17,25 @@ advisory: "experimental"
|
|||
will be rejected.
|
||||
-->
|
||||
|
||||
# Plugin Manifest Version 0 of Plugin V2
|
||||
# Plugin Config Version 0 of Plugin V2
|
||||
|
||||
This document outlines the format of the V0 plugin manifest. The plugin
|
||||
manifest described herein was introduced in the Docker daemon (experimental version) in the [v1.12.0
|
||||
This document outlines the format of the V0 plugin config. The plugin
|
||||
config described herein was introduced in the Docker daemon (experimental version) in the [v1.12.0
|
||||
release](https://github.com/docker/docker/commit/f37117045c5398fd3dca8016ea8ca0cb47e7312b).
|
||||
|
||||
Plugin manifests describe the various constituents of a docker plugin. Plugin
|
||||
manifests can be serialized to JSON format with the following media types:
|
||||
Plugin configs describe the various constituents of a docker plugin. Plugin
|
||||
configs can be serialized to JSON format with the following media types:
|
||||
|
||||
Manifest Type | Media Type
|
||||
Config Type | Media Type
|
||||
------------- | -------------
|
||||
manifest | "application/vnd.docker.plugin.v0+json"
|
||||
config | "application/vnd.docker.plugin.v0+json"
|
||||
|
||||
|
||||
## *Manifest* Field Descriptions
|
||||
## *Config* Field Descriptions
|
||||
|
||||
Manifest provides the base accessible fields for working with V0 plugin format
|
||||
Config provides the base accessible fields for working with V0 plugin format
|
||||
in the registry.
|
||||
|
||||
- **`manifestVersion`** *string*
|
||||
|
||||
version of the plugin manifest (This version uses V0)
|
||||
|
||||
- **`description`** *string*
|
||||
|
||||
description of the plugin
|
||||
|
@ -169,13 +165,13 @@ Manifest provides the base accessible fields for working with V0 plugin format
|
|||
values of the args.
|
||||
|
||||
|
||||
## Example Manifest
|
||||
## Example Config
|
||||
|
||||
*Example showing the 'tiborvass/no-remove' plugin manifest.*
|
||||
*Example showing the 'tiborvass/no-remove' plugin config.*
|
||||
|
||||
```
|
||||
{
|
||||
"manifestVersion": "v0",
|
||||
"configVersion": "v0",
|
||||
"description": "A test plugin for Docker",
|
||||
"documentation": "https://docs.docker.com/engine/extend/plugins/",
|
||||
"entrypoint": ["plugin-no-remove", "/data"],
|
|
@ -141,7 +141,7 @@ a `plugins.json` with a single plugin installed.
|
|||
{
|
||||
"cd851ce43a403": {
|
||||
"plugin": {
|
||||
"Manifest": {
|
||||
"Config": {
|
||||
"Args": {
|
||||
"Value": null,
|
||||
"Settable": null,
|
||||
|
@ -154,7 +154,6 @@ a `plugins.json` with a single plugin installed.
|
|||
"Capabilities": [
|
||||
"CAP_SYS_ADMIN"
|
||||
],
|
||||
"ManifestVersion": "v0",
|
||||
"Description": "sshFS plugin for Docker",
|
||||
"Documentation": "https://docs.docker.com/engine/extend/plugins/",
|
||||
"Interface": {
|
||||
|
@ -196,8 +195,8 @@ and two JSON files.
|
|||
# ls -la /var/lib/docker/plugins/cd851ce43a403
|
||||
total 12
|
||||
drwx------ 19 root root 4096 Aug 8 17:56 rootfs
|
||||
-rw-r--r-- 1 root root 50 Aug 8 17:56 plugin-config.json
|
||||
-rw------- 1 root root 347 Aug 8 17:56 manifest.json
|
||||
-rw-r--r-- 1 root root 50 Aug 8 17:56 plugin-settings.json
|
||||
-rw------- 1 root root 347 Aug 8 17:56 config.json
|
||||
```
|
||||
|
||||
#### The rootfs directory
|
||||
|
@ -219,17 +218,16 @@ $ docker rm -vf "$id"
|
|||
$ docker rmi rootfs
|
||||
```
|
||||
|
||||
#### The manifest.json and plugin-config.json files
|
||||
#### The config.json and plugin-settings.json files
|
||||
|
||||
The `manifest.json` file describes the plugin. The `plugin-config.json` file
|
||||
The `config.json` file describes the plugin. The `plugin-settings.json` file
|
||||
contains runtime parameters and is only required if your plugin has runtime
|
||||
parameters. [See the Plugins Manifest reference](manifest.md).
|
||||
parameters. [See the Plugins Config reference](config.md).
|
||||
|
||||
Consider the following `manifest.json` file.
|
||||
Consider the following `config.json` file.
|
||||
|
||||
```json
|
||||
{
|
||||
"manifestVersion": "v0",
|
||||
"description": "sshFS plugin for Docker",
|
||||
"documentation": "https://docs.docker.com/engine/extend/plugins/",
|
||||
"entrypoint": ["/go/bin/docker-volume-sshfs"],
|
||||
|
@ -250,7 +248,7 @@ entrypoint and uses the `/run/docker/plugins/sshfs.sock` socket to communicate
|
|||
with Docker Engine.
|
||||
|
||||
|
||||
Consider the following `plugin-config.json` file.
|
||||
Consider the following `plugin-settings.json` file.
|
||||
|
||||
```json
|
||||
{
|
||||
|
@ -264,8 +262,8 @@ Consider the following `plugin-config.json` file.
|
|||
This plugin has no runtime parameters.
|
||||
|
||||
Each of these JSON files is included as part of `plugins.json`, as you can see
|
||||
by looking back at the example above. After a plugin is installed, `manifest.json`
|
||||
is read-only, but `plugin-config.json` is read-write, and includes all runtime
|
||||
by looking back at the example above. After a plugin is installed, `config.json`
|
||||
is read-only, but `plugin-settings.json` is read-write, and includes all runtime
|
||||
configuration options for the plugin.
|
||||
|
||||
### Creating the plugin
|
||||
|
@ -279,9 +277,9 @@ Follow these steps to create a plugin:
|
|||
using `docker export`. See [The rootfs directory](#the-rootfs-directory) for
|
||||
an example of creating a `rootfs`.
|
||||
|
||||
3. Create a `manifest.json` file in `/var/lib/docker/plugins/$id/`.
|
||||
3. Create a `config.json` file in `/var/lib/docker/plugins/$id/`.
|
||||
|
||||
4. Create a `plugin-config.json` file if needed.
|
||||
4. Create a `plugin-settings.json` file if needed.
|
||||
|
||||
5. Create or add a section to `/var/lib/docker/plugins/plugins.json`. Use
|
||||
`<user>/<name>` as “Name” and `$id` as “Id”.
|
||||
|
|
|
@ -17,7 +17,7 @@ advisory: "experimental"
|
|||
```markdown
|
||||
Usage: docker plugin create [OPTIONS] reponame[:tag] PATH-TO-ROOTFS
|
||||
|
||||
create a plugin from the given PATH-TO-ROOTFS, which contains the plugin's root filesystem and the manifest file, manifest.json
|
||||
create a plugin from the given PATH-TO-ROOTFS, which contains the plugin's root filesystem and the config file, config.json
|
||||
|
||||
Options:
|
||||
--compress Compress the context using gzip
|
||||
|
@ -25,7 +25,7 @@ Options:
|
|||
```
|
||||
|
||||
Creates a plugin. Before creating the plugin, prepare the plugin's root filesystem as well as
|
||||
the manifest.json (https://github.com/docker/docker/blob/master/docs/extend/manifest.md)
|
||||
the config.json (https://github.com/docker/docker/blob/master/docs/extend/config.md)
|
||||
|
||||
|
||||
The following example shows how to create a sample `plugin`.
|
||||
|
@ -34,7 +34,7 @@ The following example shows how to create a sample `plugin`.
|
|||
|
||||
$ ls -ls /home/pluginDir
|
||||
|
||||
4 -rw-r--r-- 1 root root 431 Nov 7 01:40 manifest.json
|
||||
4 -rw-r--r-- 1 root root 431 Nov 7 01:40 config.json
|
||||
0 drwxr-xr-x 19 root root 420 Nov 7 01:40 rootfs
|
||||
|
||||
$ docker plugin create plugin /home/pluginDir
|
||||
|
|
Loading…
Reference in New Issue