From 7cd538db6f0722273fcfb1cc2c6788623dd414e3 Mon Sep 17 00:00:00 2001 From: David Calavera Date: Wed, 27 May 2015 15:21:18 -0700 Subject: [PATCH] Plugins JSON spec. Allow full configuration of external plugins via a JSON document. Signed-off-by: David Calavera --- experimental/plugin_api.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/experimental/plugin_api.md b/experimental/plugin_api.md index 9309b28468..f38db9cdaf 100644 --- a/experimental/plugin_api.md +++ b/experimental/plugin_api.md @@ -26,18 +26,35 @@ containers is recommended. Docker discovers plugins by looking for them in the plugin directory whenever a user or container tries to use one by name. -There are two types of files which can be put in the plugin directory. +There are three types of files which can be put in the plugin directory. * `.sock` files are UNIX domain sockets. * `.spec` files are text files containing a URL, such as `unix:///other.sock`. +* `.json` files are text files containing a full json specification for the plugin. The name of the file (excluding the extension) determines the plugin name. For example, the `flocker` plugin might create a UNIX socket at `/usr/share/docker/plugins/flocker.sock`. -Plugins must be run locally on the same machine as the Docker daemon. UNIX -domain sockets are strongly encouraged for security reasons. +### JSON specification + +This is the JSON format for a plugin: + +```json +{ + "Name": "plugin-example", + "Addr": "https://example.com/docker/plugin", + "TLSConfig": { + "InsecureSkipVerify": false, + "CAFile": "/usr/shared/docker/certs/example-ca.pem", + "CertFile": "/usr/shared/docker/certs/example-cert.pem", + "KeyFile": "/usr/shared/docker/certs/example-key.pem", + } +} +``` + +The `TLSConfig` field is optional and TLS will only be verified if this configuration is present. ## Plugin lifecycle