Browse code

Add a link to the new build instructions

Signed-off-by: Misty Stanley-Jones <misty@docker.com>

Misty Stanley-Jones authored on 2016/10/13 08:23:01
Showing 16 changed files
... ...
@@ -1,4 +1,4 @@
1
-.PHONY: all binary build cross deb docs help init-go-pkg-cache install manpages rpm run shell test test-docker-py test-integration-cli test-unit tgz validate win
1
+.PHONY: all binary build cross deb help init-go-pkg-cache install manpages rpm run shell test test-docker-py test-integration-cli test-unit tgz validate win
2 2
 
3 3
 # set the graph driver as the current graphdriver if not set
4 4
 DOCKER_GRAPHDRIVER := $(if $(DOCKER_GRAPHDRIVER),$(DOCKER_GRAPHDRIVER),$(shell docker info 2>&1 | grep "Storage Driver" | sed 's/.*: //'))
... ...
@@ -56,7 +56,6 @@ DOCKER_MOUNT := $(if $(DOCKER_INCREMENTAL_BINARY),$(DOCKER_MOUNT) $(shell echo $
56 56
 GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
57 57
 GIT_BRANCH_CLEAN := $(shell echo $(GIT_BRANCH) | sed -e "s/[^[:alnum:]]/-/g")
58 58
 DOCKER_IMAGE := docker-dev$(if $(GIT_BRANCH_CLEAN),:$(GIT_BRANCH_CLEAN))
59
-DOCKER_DOCS_IMAGE := docker-docs$(if $(GIT_BRANCH_CLEAN),:$(GIT_BRANCH_CLEAN))
60 59
 DOCKER_PORT_FORWARD := $(if $(DOCKER_PORT),-p "$(DOCKER_PORT)",)
61 60
 
62 61
 DOCKER_FLAGS := docker run --rm -i --privileged $(DOCKER_ENVS) $(DOCKER_MOUNT) $(DOCKER_PORT_FORWARD)
... ...
@@ -93,8 +92,6 @@ cross: build ## cross build the binaries for darwin, freebsd and\nwindows
93 93
 deb: build  ## build the deb packages
94 94
 	$(DOCKER_RUN_DOCKER) hack/make.sh dynbinary build-deb
95 95
 
96
-docs: ## build the docs
97
-	$(MAKE) -C docs docs
98 96
 
99 97
 help: ## this help
100 98
 	@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
... ...
@@ -140,4 +137,3 @@ validate: build ## validate DCO, Seccomp profile generation, gofmt,\n./pkg/ isol
140 140
 
141 141
 win: build ## cross build the binary for windows
142 142
 	$(DOCKER_RUN_DOCKER) hack/make.sh win
143
-
... ...
@@ -3,6 +3,9 @@
3 3
 The documentation for Docker Engine has been merged into
4 4
 [the general documentation repo](https://github.com/docker/docker.github.io).
5 5
 
6
+See the [README](https://github.com/docker/docker.github.io/blob/master/README.md)
7
+for instructions on contributing to and building the documentation.
8
+
6 9
 If you'd like to edit the current published version of the Engine docs,
7 10
 do it in the master branch here:
8 11
 https://github.com/docker/docker.github.io/tree/master/engine
9 12
new file mode 100644
... ...
@@ -0,0 +1,216 @@
0
+<!--[metadata]>
1
+aliases = ["/engine/misc/deprecated/"]
2
+title = "Deprecated Engine Features"
3
+description = "Deprecated Features."
4
+keywords = ["docker, documentation, about, technology, deprecate"]
5
+[menu.main]
6
+parent = "engine_use"
7
+weight=80
8
+<![end-metadata]-->
9
+
10
+# Deprecated Engine Features
11
+
12
+The following list of features are deprecated in Engine.
13
+To learn more about Docker Engine's deprecation policy,
14
+see [Feature Deprecation Policy](index.md#feature-deprecation-policy).
15
+
16
+
17
+### `repository:shortid` image references
18
+**Deprecated In Release: [v1.13](https://github.com/docker/docker/releases/)**
19
+
20
+**Target For Removal In Release: v1.16**
21
+
22
+`repository:shortid` syntax for referencing images is very little used, collides with with tag references can be confused with digest references.
23
+
24
+### `docker daemon` subcommand
25
+**Deprecated In Release: [v1.13](https://github.com/docker/docker/releases/)**
26
+
27
+**Target For Removal In Release: v1.16**
28
+
29
+The daemon is moved to a separate binary (`dockerd`), and should be used instead.
30
+
31
+### Three argument form in `docker import`
32
+**Deprecated In Release: [v0.6.7](https://github.com/docker/docker/releases/tag/v0.6.7)**
33
+
34
+**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)**
35
+
36
+The `docker import` command format 'file|URL|- [REPOSITORY [TAG]]' is deprecated since November 2013. It's no more supported.
37
+
38
+### `-h` shorthand for `--help`
39
+
40
+**Deprecated In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)**
41
+
42
+**Target For Removal In Release: v1.15**
43
+
44
+The shorthand (`-h`) is less common than `--help` on Linux and cannot be used
45
+on all subcommands (due to it conflicting with, e.g. `-h` / `--hostname` on
46
+`docker create`). For this reason, the `-h` shorthand was not printed in the
47
+"usage" output of subcommands, nor documented, and is now marked "deprecated".
48
+
49
+### `-e` and `--email` flags on `docker login`
50
+**Deprecated In Release: [v1.11.0](https://github.com/docker/docker/releases/tag/v1.11.0)**
51
+
52
+**Target For Removal In Release: v1.14**
53
+
54
+The docker login command is removing the ability to automatically register for an account with the target registry if the given username doesn't exist. Due to this change, the email flag is no longer required, and will be deprecated.
55
+
56
+### Separator (`:`) of `--security-opt` flag on `docker run`
57
+**Deprecated In Release: [v1.11.0](https://github.com/docker/docker/releases/tag/v1.11.0)**
58
+
59
+**Target For Removal In Release: v1.14**
60
+
61
+The flag `--security-opt` doesn't use the colon separator(`:`) anymore to divide keys and values, it uses the equal symbol(`=`) for consistency with other similar flags, like `--storage-opt`.
62
+
63
+### `/containers/(id or name)/copy` endpoint
64
+
65
+**Deprecated In Release: [v1.8.0](https://github.com/docker/docker/releases/tag/v1.8.0)**
66
+
67
+**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)**
68
+
69
+The endpoint `/containers/(id or name)/copy` is deprecated in favor of `/containers/(id or name)/archive`.
70
+
71
+### Ambiguous event fields in API
72
+**Deprecated In Release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)**
73
+
74
+The fields `ID`, `Status` and `From` in the events API have been deprecated in favor of a more rich structure.
75
+See the events API documentation for the new format.
76
+
77
+### `-f` flag on `docker tag`
78
+**Deprecated In Release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)**
79
+
80
+**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)**
81
+
82
+To make tagging consistent across the various `docker` commands, the `-f` flag on the `docker tag` command is deprecated. It is not longer necessary to specify `-f` to move a tag from one image to another. Nor will `docker` generate an error if the `-f` flag is missing and the specified tag is already in use.
83
+
84
+### HostConfig at API container start
85
+**Deprecated In Release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)**
86
+
87
+**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)**
88
+
89
+Passing an `HostConfig` to `POST /containers/{name}/start` is deprecated in favor of
90
+defining it at container creation (`POST /containers/create`).
91
+
92
+### Docker ps 'before' and 'since' options
93
+
94
+**Deprecated In Release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)**
95
+
96
+**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)**
97
+
98
+The `docker ps --before` and `docker ps --since` options are deprecated.
99
+Use `docker ps --filter=before=...` and `docker ps --filter=since=...` instead.
100
+
101
+### Docker search 'automated' and 'stars' options
102
+
103
+**Deprecated in Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)**
104
+
105
+**Target For Removal In Release: v1.15**
106
+
107
+The `docker search --automated` and `docker search --stars` options are deprecated.
108
+Use `docker search --filter=is-automated=...` and `docker search --filter=stars=...` instead.
109
+
110
+### Driver Specific Log Tags
111
+**Deprecated In Release: [v1.9.0](https://github.com/docker/docker/releases/tag/v1.9.0)**
112
+
113
+**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)**
114
+
115
+Log tags are now generated in a standard way across different logging drivers.
116
+Because of which, the driver specific log tag options `syslog-tag`, `gelf-tag` and
117
+`fluentd-tag` have been deprecated in favor of the generic `tag` option.
118
+
119
+    docker --log-driver=syslog --log-opt tag="{{.ImageName}}/{{.Name}}/{{.ID}}"
120
+
121
+### LXC built-in exec driver
122
+**Deprecated In Release: [v1.8.0](https://github.com/docker/docker/releases/tag/v1.8.0)**
123
+
124
+**Removed In Release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)**
125
+
126
+The built-in LXC execution driver, the lxc-conf flag, and API fields have been removed.
127
+
128
+### Old Command Line Options
129
+**Deprecated In Release: [v1.8.0](https://github.com/docker/docker/releases/tag/v1.8.0)**
130
+
131
+**Removed In Release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)**
132
+
133
+The flags `-d` and `--daemon` are deprecated in favor of the `daemon` subcommand:
134
+
135
+    docker daemon -H ...
136
+
137
+The following single-dash (`-opt`) variant of certain command line options
138
+are deprecated and replaced with double-dash options (`--opt`):
139
+
140
+    docker attach -nostdin
141
+    docker attach -sig-proxy
142
+    docker build -no-cache
143
+    docker build -rm
144
+    docker commit -author
145
+    docker commit -run
146
+    docker events -since
147
+    docker history -notrunc
148
+    docker images -notrunc
149
+    docker inspect -format
150
+    docker ps -beforeId
151
+    docker ps -notrunc
152
+    docker ps -sinceId
153
+    docker rm -link
154
+    docker run -cidfile
155
+    docker run -dns
156
+    docker run -entrypoint
157
+    docker run -expose
158
+    docker run -link
159
+    docker run -lxc-conf
160
+    docker run -n
161
+    docker run -privileged
162
+    docker run -volumes-from
163
+    docker search -notrunc
164
+    docker search -stars
165
+    docker search -t
166
+    docker search -trusted
167
+    docker tag -force
168
+
169
+The following double-dash options are deprecated and have no replacement:
170
+
171
+    docker run --cpuset
172
+    docker run --networking
173
+    docker ps --since-id
174
+    docker ps --before-id
175
+    docker search --trusted
176
+
177
+**Deprecated In Release: [v1.5.0](https://github.com/docker/docker/releases/tag/v1.5.0)**
178
+
179
+**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)**
180
+
181
+The single-dash (`-help`) was removed, in favor of the double-dash `--help`
182
+
183
+    docker -help
184
+    docker [COMMAND] -help
185
+
186
+### `--run` flag on docker commit
187
+
188
+**Deprecated In Release: [v0.10.0](https://github.com/docker/docker/releases/tag/v0.10.0)**
189
+
190
+**Removed In Release: [v1.13.0](https://github.com/docker/docker/releases/)**
191
+
192
+The flag `--run` of the docker commit (and its short version `-run`) were deprecated in favor 
193
+of the `--changes` flag that allows to pass `Dockerfile` commands.
194
+
195
+
196
+### Interacting with V1 registries
197
+
198
+Version 1.9 adds a flag (`--disable-legacy-registry=false`) which prevents the docker daemon from `pull`, `push`, and `login` operations against v1 registries.  Though disabled by default, this signals the intent to deprecate the v1 protocol.
199
+
200
+### Docker Content Trust ENV passphrase variables name change
201
+**Deprecated In Release: [v1.9.0](https://github.com/docker/docker/releases/tag/v1.9.0)**
202
+
203
+**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)**
204
+
205
+Since 1.9, Docker Content Trust Offline key has been renamed to Root key and the Tagging key has been renamed to Repository key. Due to this renaming, we're also changing the corresponding environment variables
206
+
207
+- DOCKER_CONTENT_TRUST_OFFLINE_PASSPHRASE is now named DOCKER_CONTENT_TRUST_ROOT_PASSPHRASE
208
+- DOCKER_CONTENT_TRUST_TAGGING_PASSPHRASE is now named DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE
209
+
210
+### `MAINTAINER` in Dockerfile
211
+**Deprecated In Release: v1.13.0**
212
+
213
+`MAINTAINER` was an early very limited form of `LABEL` which should be used instead.
0 214
new file mode 100644
1 215
Binary files /dev/null and b/docs/extend/images/authz_additional_info.png differ
2 216
new file mode 100644
3 217
Binary files /dev/null and b/docs/extend/images/authz_allow.png differ
4 218
new file mode 100644
5 219
Binary files /dev/null and b/docs/extend/images/authz_chunked.png differ
6 220
new file mode 100644
7 221
Binary files /dev/null and b/docs/extend/images/authz_connection_hijack.png differ
8 222
new file mode 100644
9 223
Binary files /dev/null and b/docs/extend/images/authz_deny.png differ
10 224
new file mode 100644
... ...
@@ -0,0 +1,272 @@
0
+<!--[metadata]>
1
+aliases = [
2
+"/engine/extend/"
3
+]
4
+title = "Managed plugin system"
5
+description = "How develop and use a plugin with the managed plugin system"
6
+keywords = ["API, Usage, plugins, documentation, developer"]
7
+advisory = "experimental"
8
+[menu.main]
9
+parent = "engine_extend"
10
+weight=1
11
+<![end-metadata]-->
12
+
13
+# Docker Engine managed plugin system
14
+
15
+This document describes the plugin system available today in the **experimental
16
+build** of Docker 1.12:
17
+
18
+* [How to operate an existing plugin](#how-to-operate-a-plugin)
19
+* [How to develop a plugin](#how-to-develop-a-plugin)
20
+
21
+Unlike the legacy plugin system, you now manage plugins using Docker Engine:
22
+
23
+* install plugins
24
+* start plugins
25
+* stop plugins
26
+* remove plugins
27
+
28
+The current Docker Engine plugin system only supports volume drivers. We are
29
+adding more plugin driver types in the future releases.
30
+
31
+For information on Docker Engine plugins generally available in Docker Engine
32
+1.12 and earlier, refer to [Understand legacy Docker Engine plugins](legacy_plugins.md).
33
+
34
+## How to operate a plugin
35
+
36
+Plugins are distributed as Docker images, so develpers can host them on Docker
37
+Hub or on a private registry.
38
+
39
+You install the plugin using a single command: `docker plugin install <PLUGIN>`.
40
+The `plugin install` command pulls the plugin from the Docker Hub or private
41
+registry. If necessary the CLI prompts you to accept any privilige requriements.
42
+For example the plugin may require access to a device on the host system.
43
+Finally it enables the plugin.
44
+
45
+Run `docker plugin ls` to check the status of installed plugins. The Engine
46
+markes plugins that are started without issues as `ENABLED`.
47
+
48
+After you install a plugin, the plugin behavior is the same as legacy plugins.
49
+The following example demonstrates how to install the `sshfs` plugin and use it
50
+to create a volume.
51
+
52
+1.  Install the `sshfs` plugin.
53
+
54
+    ```bash
55
+    $ docker plugin install vieux/sshfs
56
+
57
+    Plugin "vieux/sshfs" is requesting the following privileges:
58
+    - network: [host]
59
+    - capabilities: [CAP_SYS_ADMIN]
60
+    Do you grant the above permissions? [y/N] y
61
+
62
+    vieux/sshfs
63
+    ```
64
+
65
+    The plugin requests 2 privileges, the `CAP_SYS_ADMIN` capability to be able
66
+    to do mount inside the plugin and `host networking`.
67
+
68
+2. Check for a value of `true` the `ENABLED` column to verify the plugin
69
+started without error.
70
+
71
+    ```bash
72
+    $ docker plugin ls
73
+
74
+    NAME                TAG                 ENABLED
75
+    vieux/sshfs         latest              true
76
+    ```
77
+
78
+3. Create a volume using the plugin.
79
+
80
+    ```bash
81
+    $ docker volume create \
82
+      -d vieux/sshfs \
83
+      --name sshvolume \
84
+      -o sshcmd=user@1.2.3.4:/remote
85
+
86
+    sshvolume
87
+    ```
88
+
89
+4.  Use the volume `sshvolume`.
90
+
91
+    ```bash
92
+    $ docker run -v sshvolume:/data busybox ls /data
93
+
94
+    <content of /remote on machine 1.2.3.4>
95
+    ```
96
+
97
+5. Verify the plugin successfully created the volume.
98
+
99
+    ```bash
100
+    $ docker volume ls
101
+
102
+    DRIVER              NAME
103
+    vieux/sshfs         sshvolume
104
+    ```
105
+
106
+    You can stop a plugin with the `docker plugin disable`
107
+    command or remove a plugin with `docker plugin remove`.
108
+
109
+See the [command line reference](../reference/commandline/index.md) for more
110
+information.
111
+
112
+## How to develop a plugin
113
+
114
+Plugin creation is currently a manual process. We plan to add automation in a
115
+future release with a command such as `docker plugin build`.
116
+
117
+This section describes the format of an existing enabled plugin. You have to
118
+create and format the plugin files by hand.
119
+
120
+Plugins are stored in `/var/lib/docker/plugins`. For instance:
121
+
122
+```bash
123
+# ls -la /var/lib/docker/plugins
124
+total 20
125
+drwx------  4 root root 4096 Aug  8 18:03 .
126
+drwx--x--x 12 root root 4096 Aug  8 17:53 ..
127
+drwxr-xr-x  3 root root 4096 Aug  8 17:56 cd851ce43a403
128
+-rw-------  1 root root 2107 Aug  8 18:03 plugins.json
129
+```
130
+
131
+`plugins.json` is an inventory of all installed plugins. For example:
132
+
133
+```bash
134
+# cat plugins.json
135
+{
136
+  "cd851ce43a403": {
137
+    "plugin": {
138
+      "Manifest": {
139
+        "Args": {
140
+          "Value": null,
141
+          "Settable": null,
142
+          "Description": "",
143
+          "Name": ""
144
+        },
145
+        "Env": null,
146
+        "Devices": null,
147
+        "Mounts": null,
148
+        "Capabilities": [
149
+          "CAP_SYS_ADMIN"
150
+        ],
151
+        "ManifestVersion": "v0",
152
+        "Description": "sshFS plugin for Docker",
153
+        "Documentation": "https://docs.docker.com/engine/extend/plugins/",
154
+        "Interface": {
155
+          "Socket": "sshfs.sock",
156
+          "Types": [
157
+            "docker.volumedriver/1.0"
158
+          ]
159
+        },
160
+        "Entrypoint": [
161
+          "/go/bin/docker-volume-sshfs"
162
+        ],
163
+        "Workdir": "",
164
+        "User": {},
165
+        "Network": {
166
+          "Type": "host"
167
+        }
168
+      },
169
+      "Config": {
170
+        "Devices": null,
171
+        "Args": null,
172
+        "Env": [],
173
+        "Mounts": []
174
+      },
175
+      "Active": true,
176
+      "Tag": "latest",
177
+      "Name": "vieux/sshfs",
178
+      "Id": "cd851ce43a403"
179
+    }
180
+  }
181
+}
182
+```
183
+
184
+Each folder represents a plugin. For example:
185
+
186
+```bash
187
+# ls -la /var/lib/docker/plugins/cd851ce43a403
188
+total 12
189
+drwx------ 19 root root 4096 Aug  8 17:56 rootfs
190
+-rw-r--r--  1 root root   50 Aug  8 17:56 plugin-config.json
191
+-rw-------  1 root root  347 Aug  8 17:56 manifest.json
192
+```
193
+
194
+`rootfs` represents the root filesystem of the plugin. In this example, it was
195
+created from a Dockerfile as follows:
196
+
197
+>**Note:** `/run/docker/plugins` is mandatory for docker to communicate with
198
+the plugin._
199
+
200
+```bash
201
+$ git clone https://github.com/vieux/docker-volume-sshfs
202
+$ cd docker-volume-sshfs
203
+$ docker build -t rootfs .
204
+$ id=$(docker create rootfs true) # id was cd851ce43a403 when the image was created
205
+$ mkdir -p /var/lib/docker/plugins/$id/rootfs
206
+$ docker export "$id" | tar -x -C /var/lib/docker/plugins/$id/rootfs
207
+$ docker rm -vf "$id"
208
+$ docker rmi rootfs
209
+```
210
+
211
+`manifest.json` describes the plugin and `plugin-config.json` contains some
212
+runtime parameters. [See the Plugins Manifest reference](manifest.md). For example:
213
+
214
+```bash
215
+# cat manifest.json
216
+{
217
+	"manifestVersion": "v0",
218
+	"description": "sshFS plugin for Docker",
219
+	"documentation": "https://docs.docker.com/engine/extend/plugins/",
220
+	"entrypoint": ["/go/bin/docker-volume-sshfs"],
221
+	"network": {
222
+		   "type": "host"
223
+		   },
224
+	"interface" : {
225
+		   "types": ["docker.volumedriver/1.0"],
226
+		   "socket": "sshfs.sock"
227
+	},
228
+	"capabilities": ["CAP_SYS_ADMIN"]
229
+}
230
+```
231
+
232
+In this example, you can see the plugin is a volume driver, requires the
233
+`CAP_SYS_ADMIN` capability, `host networking`, `/go/bin/docker-volume-sshfs` as
234
+entrypoint and is going to use `/run/docker/plugins/sshfs.sock` to communicate
235
+with the Docker Engine.
236
+
237
+```bash
238
+# cat plugin-config.json
239
+{
240
+  "Devices": null,
241
+  "Args": null,
242
+  "Env": [],
243
+  "Mounts": []
244
+}
245
+```
246
+
247
+This plugin doesn't require runtime parameters.
248
+
249
+Both `manifest.json` and `plugin-config.json` are part of the `plugins.json`.
250
+`manifest.json` is read-only and `plugin-config.json` is read-write.
251
+
252
+To summarize, follow the steps below to create a plugin:
253
+
254
+0. Choose a name for the plugin. Plugin name uses the same format as images,
255
+for example: `<repo_name>/<name>`.
256
+1. Create a rootfs in `/var/lib/docker/plugins/$id/rootfs`.
257
+2. Create manifest.json file in `/var/lib/docker/plugins/$id/`.
258
+3. Create a `plugin-config.json` if needed.
259
+4. Create or add a section to `/var/lib/docker/plugins/plugins.json`. Use
260
+   `<user>/<name>` as “Name” and `$id` as “Id”.
261
+5. Restart the Docker Engine.
262
+6. Run `docker plugin ls`.
263
+    * If your plugin is listed as `ENABLED=true`, you can push it to the
264
+    registry.
265
+    * If the plugin is not listed or if `ENABLED=false`, something went wrong.
266
+    Check the daemon logs for errors.
267
+7. If you are not already logged in, use `docker login` to authenticate against
268
+   a registry.
269
+8. Run `docker plugin push <repo_name>/<name>` to push the plugin.
0 270
new file mode 100644
... ...
@@ -0,0 +1,93 @@
0
+<!--[metadata]>
1
+aliases = "/engine/extend/plugins/"
2
+title = "Use Docker Engine plugins"
3
+description = "How to add additional functionality to Docker with plugins extensions"
4
+keywords = ["Examples, Usage, plugins, docker, documentation, user guide"]
5
+[menu.main]
6
+parent = "engine_extend"
7
+weight=3
8
+<![end-metadata]-->
9
+
10
+# Use Docker Engine plugins
11
+
12
+This document describes the Docker Engine plugins generally available in Docker
13
+Engine. To view information on plugins managed by Docker Engine currently in
14
+experimental status, refer to [Docker Engine plugin system](index.md).
15
+
16
+You can extend the capabilities of the Docker Engine by loading third-party
17
+plugins. This page explains the types of plugins and provides links to several
18
+volume and network plugins for Docker.
19
+
20
+## Types of plugins
21
+
22
+Plugins extend Docker's functionality. They come in specific types.  For
23
+example, a [volume plugin](plugins_volume.md) might enable Docker
24
+volumes to persist across multiple Docker hosts and a
25
+[network plugin](plugins_network.md) might provide network plumbing.
26
+
27
+Currently Docker supports authorization, volume and network driver plugins. In the future it
28
+will support additional plugin types.
29
+
30
+## Installing a plugin
31
+
32
+Follow the instructions in the plugin's documentation.
33
+
34
+## Finding a plugin
35
+
36
+The sections below provide an inexhaustive overview of available plugins.
37
+
38
+<style>
39
+#DocumentationText  tr td:first-child { white-space: nowrap;}
40
+</style>
41
+
42
+### Network plugins
43
+
44
+Plugin                                                                              | Description
45
+----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
46
+[Contiv Networking](https://github.com/contiv/netplugin)                            | An open source network plugin to provide infrastructure and security policies for a multi-tenant micro services deployment, while providing an integration to physical network for non-container workload. Contiv Networking implements the remote driver and IPAM APIs available in Docker 1.9 onwards.
47
+[Kuryr Network Plugin](https://github.com/openstack/kuryr)                          | A network plugin is developed as part of the OpenStack Kuryr project and implements the Docker networking (libnetwork) remote driver API by utilizing Neutron, the OpenStack networking service. It includes an IPAM driver as well.
48
+[Weave Network Plugin](https://www.weave.works/docs/net/latest/introducing-weave/)    | A network plugin that creates a virtual network that connects your Docker containers - across multiple hosts or clouds and enables automatic discovery of applications. Weave networks are resilient, partition tolerant, secure and work in partially connected networks, and other adverse environments - all configured with delightful simplicity.
49
+
50
+### Volume plugins
51
+
52
+Plugin                                                                              | Description
53
+----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
54
+[Azure File Storage plugin](https://github.com/Azure/azurefile-dockervolumedriver)  | Lets you mount Microsoft [Azure File Storage](https://azure.microsoft.com/blog/azure-file-storage-now-generally-available/) shares to Docker containers as volumes using the SMB 3.0 protocol. [Learn more](https://azure.microsoft.com/blog/persistent-docker-volumes-with-azure-file-storage/).
55
+[Blockbridge plugin](https://github.com/blockbridge/blockbridge-docker-volume)      | A volume plugin that provides access to an extensible set of container-based persistent storage options. It supports single and multi-host Docker environments with features that include tenant isolation, automated provisioning, encryption, secure deletion, snapshots and QoS.
56
+[Contiv Volume Plugin](https://github.com/contiv/volplugin)                         | An open source volume plugin that provides multi-tenant, persistent, distributed storage with intent based consumption. It has support for Ceph and NFS.
57
+[Convoy plugin](https://github.com/rancher/convoy)                                  | A volume plugin for a variety of storage back-ends including device mapper and NFS. It's a simple standalone executable written in Go and provides the framework to support vendor-specific extensions such as snapshots, backups and restore.
58
+[DRBD plugin](https://www.drbd.org/en/supported-projects/docker)                    | A volume plugin that provides highly available storage replicated by [DRBD](https://www.drbd.org). Data written to the docker volume is replicated in a cluster of DRBD nodes.
59
+[Flocker plugin](https://clusterhq.com/docker-plugin/)                              | A volume plugin that provides multi-host portable volumes for Docker, enabling you to run databases and other stateful containers and move them around across a cluster of machines.
60
+[gce-docker plugin](https://github.com/mcuadros/gce-docker)                         | A volume plugin able to attach, format and mount Google Compute [persistent-disks](https://cloud.google.com/compute/docs/disks/persistent-disks).
61
+[GlusterFS plugin](https://github.com/calavera/docker-volume-glusterfs)             | A volume plugin that provides multi-host volumes management for Docker using GlusterFS.
62
+[Horcrux Volume Plugin](https://github.com/muthu-r/horcrux)                         | A volume plugin that allows on-demand, version controlled access to your data. Horcrux is an open-source plugin, written in Go, and supports SCP, [Minio](https://www.minio.io) and Amazon S3.
63
+[HPE 3Par Volume Plugin](https://github.com/hpe-storage/python-hpedockerplugin/)    | A volume plugin that supports HPE 3Par and StoreVirtual iSCSI storage arrays.
64
+[IPFS Volume Plugin](http://github.com/vdemeester/docker-volume-ipfs)               | An open source volume plugin that allows using an [ipfs](https://ipfs.io/) filesystem as a volume.
65
+[Keywhiz plugin](https://github.com/calavera/docker-volume-keywhiz)                 | A plugin that provides credentials and secret management using Keywhiz as a central repository.
66
+[Local Persist Plugin](https://github.com/CWSpear/local-persist)                    | A volume plugin that extends the default `local` driver's functionality by allowing you specify a mountpoint anywhere on the host, which enables the files to *always persist*, even if the volume is removed via `docker volume rm`.
67
+[NetApp Plugin](https://github.com/NetApp/netappdvp) (nDVP)                         | A volume plugin that provides direct integration with the Docker ecosystem for the NetApp storage portfolio. The nDVP package supports the provisioning and management of storage resources from the storage platform to Docker hosts, with a robust framework for adding additional platforms in the future.
68
+[Netshare plugin](https://github.com/ContainX/docker-volume-netshare)                 | A volume plugin that provides volume management for NFS 3/4, AWS EFS and CIFS file systems.
69
+[OpenStorage Plugin](https://github.com/libopenstorage/openstorage)                 | A cluster-aware volume plugin that provides volume management for file and block storage solutions.  It implements a vendor neutral specification for implementing extensions such as CoS, encryption, and snapshots. It has example drivers based on FUSE, NFS, NBD and EBS to name a few.
70
+[Portworx Volume Plugin](https://github.com/portworx/px-dev)                        | A volume plugin that turns any server into a scale-out converged compute/storage node, providing container granular storage and highly available volumes across any node, using a shared-nothing storage backend that works with any docker scheduler.
71
+[Quobyte Volume Plugin](https://github.com/quobyte/docker-volume)                   | A volume plugin that connects Docker to [Quobyte](http://www.quobyte.com/containers)'s data center file system, a general-purpose scalable and fault-tolerant storage platform.
72
+[REX-Ray plugin](https://github.com/emccode/rexray)                                 | A volume plugin which is written in Go and provides advanced storage functionality for many platforms including VirtualBox, EC2, Google Compute Engine, OpenStack, and EMC.
73
+[Virtuozzo Storage and Ploop plugin](https://github.com/virtuozzo/docker-volume-ploop) | A volume plugin with support for Virtuozzo Storage distributed cloud file system as well as ploop devices.
74
+[VMware vSphere Storage Plugin](https://github.com/vmware/docker-volume-vsphere)    | Docker Volume Driver for vSphere enables customers to address persistent storage requirements for Docker containers in vSphere environments.
75
+
76
+### Authorization plugins
77
+
78
+ Plugin                                                       | Description
79
+------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
80
+ [Twistlock AuthZ Broker](https://github.com/twistlock/authz) | A basic extendable authorization plugin that runs directly on the host or inside a container. This plugin allows you to define user policies that it evaluates during authorization. Basic authorization is provided if Docker daemon is started with the --tlsverify flag (username is extracted from the certificate common name).
81
+
82
+## Troubleshooting a plugin
83
+
84
+If you are having problems with Docker after loading a plugin, ask the authors
85
+of the plugin for help. The Docker team may not be able to assist you.
86
+
87
+## Writing a plugin
88
+
89
+If you are interested in writing a plugin for Docker, or seeing how they work
90
+under the hood, see the [docker plugins reference](plugin_api.md).
0 91
new file mode 100644
... ...
@@ -0,0 +1,222 @@
0
+<!--[metadata]>
1
+aliases = [
2
+"/engine/extend/"
3
+]
4
+title = "Plugin manifest"
5
+description = "How develop and use a plugin with the managed plugin system"
6
+keywords = ["API, Usage, plugins, documentation, developer"]
7
+advisory = "experimental"
8
+[menu.main]
9
+parent = "engine_extend"
10
+weight=1
11
+<![end-metadata]-->
12
+
13
+# Plugin Manifest Version 0 of Plugin V2
14
+
15
+This document outlines the format of the V0 plugin manifest. The plugin
16
+manifest described herein was introduced in the Docker daemon (experimental version) in the [v1.12.0
17
+release](https://github.com/docker/docker/commit/f37117045c5398fd3dca8016ea8ca0cb47e7312b).
18
+
19
+Plugin manifests describe the various constituents of a docker plugin. Plugin
20
+manifests can be serialized to JSON format with the following media types:
21
+
22
+Manifest Type  | Media Type
23
+------------- | -------------
24
+manifest  | "application/vnd.docker.plugin.v0+json"
25
+
26
+
27
+## *Manifest* Field Descriptions
28
+
29
+Manifest provides the base accessible fields for working with V0 plugin format
30
+ in the registry.
31
+
32
+- **`manifestVersion`** *string*
33
+
34
+	version of the plugin manifest (This version uses V0)
35
+
36
+- **`description`** *string*
37
+
38
+	description of the plugin
39
+
40
+- **`documentation`** *string*
41
+
42
+  	link to the documentation about the plugin
43
+
44
+- **`interface`** *PluginInterface*
45
+
46
+   interface implemented by the plugins, struct consisting of the following fields
47
+      
48
+    - **`types`** *string array*
49
+
50
+      types indicate what interface(s) the plugin currently implements.
51
+
52
+      currently supported:
53
+
54
+      	- **docker.volumedriver/1.0**
55
+      
56
+    - **`socket`** *string*
57
+      
58
+      socket is the name of the socket the engine should use to communicate with the plugins.
59
+      the socket will be created in `/run/docker/plugins`.
60
+
61
+
62
+- **`entrypoint`** *string array*
63
+
64
+   entrypoint of the plugin, see [`ENTRYPOINT`](../reference/builder.md#entrypoint)
65
+
66
+- **`workdir`** *string*
67
+
68
+   workdir of the plugin, see [`WORKDIR`](../reference/builder.md#workdir)
69
+
70
+- **`network`** *PluginNetwork*
71
+
72
+   network of the plugin, struct consisting of the following fields
73
+      
74
+    - **`type`** *string*
75
+
76
+      network type.
77
+
78
+      currently supported:
79
+
80
+      	- **bridge**
81
+      	- **host**
82
+      	- **none**
83
+      
84
+- **`capabilities`** *array*
85
+
86
+   capabilities of the plugin (*Linux only*), see list [`here`](https://github.com/opencontainers/runc/blob/master/libcontainer/SPEC.md#security)
87
+    
88
+- **`mounts`** *PluginMount array*
89
+
90
+   mount of the plugin, struct consisting of the following fields, see [`MOUNTS`](https://github.com/opencontainers/runtime-spec/blob/master/config.md#mounts)
91
+
92
+    - **`name`** *string*
93
+
94
+	  name of the mount.
95
+      
96
+    - **`description`** *string*
97
+	
98
+      description of the mount.
99
+   
100
+    - **`source`** *string*
101
+
102
+	  source of the mount.
103
+    
104
+    - **`destination`** *string*
105
+
106
+	  destination of the mount.
107
+   
108
+    - **`type`** *string*
109
+
110
+      mount type.
111
+      
112
+    - **`options`** *string array*
113
+
114
+	  options of the mount.
115
+      
116
+- **`devices`** *PluginDevice array*
117
+
118
+    device of the plugin, (*Linux only*), struct consisting of the following fields, see [`DEVICES`](https://github.com/opencontainers/runtime-spec/blob/master/config-linux.md#devices)
119
+
120
+    - **`name`** *string*
121
+
122
+	  name of the device.
123
+      
124
+    - **`description`** *string*
125
+
126
+      description of the device.
127
+      
128
+    - **`path`** *string*
129
+
130
+	  path of the device.
131
+
132
+- **`env`** *PluginEnv array*
133
+
134
+   env of the plugin, struct consisting of the following fields
135
+
136
+    - **`name`** *string*
137
+
138
+	  name of the env.
139
+      
140
+    - **`description`** *string*
141
+	
142
+      description of the env.
143
+   
144
+    - **`value`** *string*
145
+
146
+	  value of the env.
147
+    
148
+- **`args`** *PluginArgs*
149
+
150
+   args of the plugin, struct consisting of the following fields
151
+
152
+    - **`name`** *string*
153
+
154
+	  name of the env.
155
+      
156
+    - **`description`** *string*
157
+	
158
+      description of the env.
159
+   
160
+    - **`value`** *string array*
161
+
162
+	  values of the args.
163
+    
164
+    
165
+## Example Manifest
166
+
167
+*Example showing the 'tiborvass/no-remove' plugin manifest.*
168
+
169
+```
170
+{
171
+       	"manifestVersion": "v0",
172
+       	"description": "A test plugin for Docker",
173
+       	"documentation": "https://docs.docker.com/engine/extend/plugins/",
174
+       	"entrypoint": ["plugin-no-remove", "/data"],
175
+       	"interface" : {
176
+       		"types": ["docker.volumedriver/1.0"],
177
+       		"socket": "plugins.sock"
178
+       	},
179
+       	"network": {
180
+       		"type": "host"
181
+       	},
182
+
183
+       	"mounts": [
184
+       		{
185
+       			"source": "/data",
186
+       			"destination": "/data",
187
+       			"type": "bind",
188
+       			"options": ["shared", "rbind"]
189
+       		},
190
+       		{
191
+       			"destination": "/foobar",
192
+       			"type": "tmpfs"
193
+       		}
194
+       	],
195
+
196
+       	"args": {
197
+       		"name": "args",
198
+       		"description": "command line arguments",
199
+       		"value": []
200
+       	},
201
+
202
+       	"env": [
203
+       		{
204
+       			"name": "DEBUG",
205
+       			"description": "If set, prints debug messages",
206
+       			"value": "1"
207
+       		}
208
+       	],
209
+
210
+       	"devices": [
211
+       		{
212
+       			"name": "device",
213
+       			"description": "a host device to mount",
214
+       			"path": "/dev/cpu_dma_latency"
215
+       		}
216
+       	]
217
+}
218
+
219
+```
0 220
new file mode 100644
... ...
@@ -0,0 +1,15 @@
0
+<!--[metadata]>
1
+title = "Implement plugins"
2
+description = "Develop plugins and use existing plugins for Docker Engine"
3
+keywords = ["extend, plugins, docker, documentation, developer"]
4
+type="menu"
5
+[menu.main]
6
+identifier = "engine_extend"
7
+parent="engine_use"
8
+weight = 0
9
+<![end-metadata]-->
10
+
11
+
12
+<!--menu page not rendered-->
0 13
new file mode 100644
... ...
@@ -0,0 +1,192 @@
0
+<!--[metadata]>
1
+title = "Plugins API"
2
+description = "How to write Docker plugins extensions "
3
+keywords = ["API, Usage, plugins, documentation, developer"]
4
+[menu.main]
5
+parent = "engine_extend"
6
+weight=7
7
+<![end-metadata]-->
8
+
9
+# Docker Plugin API
10
+
11
+Docker plugins are out-of-process extensions which add capabilities to the
12
+Docker Engine.
13
+
14
+This document describes the Docker Engine plugin API. To view information on
15
+plugins managed by Docker Engine currently in experimental status, refer to
16
+[Docker Engine plugin system](index.md).
17
+
18
+This page is intended for people who want to develop their own Docker plugin.
19
+If you just want to learn about or use Docker plugins, look
20
+[here](legacy_plugins.md).
21
+
22
+## What plugins are
23
+
24
+A plugin is a process running on the same or a different host as the docker daemon,
25
+which registers itself by placing a file on the same docker host in one of the plugin
26
+directories described in [Plugin discovery](#plugin-discovery).
27
+
28
+Plugins have human-readable names, which are short, lowercase strings. For
29
+example, `flocker` or `weave`.
30
+
31
+Plugins can run inside or outside containers. Currently running them outside
32
+containers is recommended.
33
+
34
+## Plugin discovery
35
+
36
+Docker discovers plugins by looking for them in the plugin directory whenever a
37
+user or container tries to use one by name.
38
+
39
+There are three types of files which can be put in the plugin directory.
40
+
41
+* `.sock` files are UNIX domain sockets.
42
+* `.spec` files are text files containing a URL, such as `unix:///other.sock` or `tcp://localhost:8080`.
43
+* `.json` files are text files containing a full json specification for the plugin.
44
+
45
+Plugins with UNIX domain socket files must run on the same docker host, whereas
46
+plugins with spec or json files can run on a different host if a remote URL is specified.
47
+
48
+UNIX domain socket files must be located under `/run/docker/plugins`, whereas
49
+spec files can be located either under `/etc/docker/plugins` or `/usr/lib/docker/plugins`.
50
+
51
+The name of the file (excluding the extension) determines the plugin name.
52
+
53
+For example, the `flocker` plugin might create a UNIX socket at
54
+`/run/docker/plugins/flocker.sock`.
55
+
56
+You can define each plugin into a separated subdirectory if you want to isolate definitions from each other.
57
+For example, you can create the `flocker` socket under `/run/docker/plugins/flocker/flocker.sock` and only
58
+mount `/run/docker/plugins/flocker` inside the `flocker` container.
59
+
60
+Docker always searches for unix sockets in `/run/docker/plugins` first. It checks for spec or json files under
61
+`/etc/docker/plugins` and `/usr/lib/docker/plugins` if the socket doesn't exist. The directory scan stops as
62
+soon as it finds the first plugin definition with the given name.
63
+
64
+### JSON specification
65
+
66
+This is the JSON format for a plugin:
67
+
68
+```json
69
+{
70
+  "Name": "plugin-example",
71
+  "Addr": "https://example.com/docker/plugin",
72
+  "TLSConfig": {
73
+    "InsecureSkipVerify": false,
74
+    "CAFile": "/usr/shared/docker/certs/example-ca.pem",
75
+    "CertFile": "/usr/shared/docker/certs/example-cert.pem",
76
+    "KeyFile": "/usr/shared/docker/certs/example-key.pem",
77
+  }
78
+}
79
+```
80
+
81
+The `TLSConfig` field is optional and TLS will only be verified if this configuration is present.
82
+
83
+## Plugin lifecycle
84
+
85
+Plugins should be started before Docker, and stopped after Docker.  For
86
+example, when packaging a plugin for a platform which supports `systemd`, you
87
+might use [`systemd` dependencies](
88
+http://www.freedesktop.org/software/systemd/man/systemd.unit.html#Before=) to
89
+manage startup and shutdown order.
90
+
91
+When upgrading a plugin, you should first stop the Docker daemon, upgrade the
92
+plugin, then start Docker again.
93
+
94
+## Plugin activation
95
+
96
+When a plugin is first referred to -- either by a user referring to it by name
97
+(e.g.  `docker run --volume-driver=foo`) or a container already configured to
98
+use a plugin being started -- Docker looks for the named plugin in the plugin
99
+directory and activates it with a handshake. See Handshake API below.
100
+
101
+Plugins are *not* activated automatically at Docker daemon startup. Rather,
102
+they are activated only lazily, or on-demand, when they are needed.
103
+
104
+## Systemd socket activation
105
+
106
+Plugins may also be socket activated by `systemd`. The official [Plugins helpers](https://github.com/docker/go-plugins-helpers)
107
+natively supports socket activation. In order for a plugin to be socket activated it needs
108
+a `service` file and a `socket` file.
109
+
110
+The `service` file (for example `/lib/systemd/system/your-plugin.service`):
111
+
112
+```
113
+[Unit]
114
+Description=Your plugin
115
+Before=docker.service
116
+After=network.target your-plugin.socket
117
+Requires=your-plugin.socket docker.service
118
+
119
+[Service]
120
+ExecStart=/usr/lib/docker/your-plugin
121
+
122
+[Install]
123
+WantedBy=multi-user.target
124
+```
125
+The `socket` file (for example `/lib/systemd/system/your-plugin.socket`):
126
+```
127
+[Unit]
128
+Description=Your plugin
129
+
130
+[Socket]
131
+ListenStream=/run/docker/plugins/your-plugin.sock
132
+
133
+[Install]
134
+WantedBy=sockets.target
135
+```
136
+
137
+This will allow plugins to be actually started when the Docker daemon connects to
138
+the sockets they're listening on (for instance the first time the daemon uses them
139
+or if one of the plugin goes down accidentally).
140
+
141
+## API design
142
+
143
+The Plugin API is RPC-style JSON over HTTP, much like webhooks.
144
+
145
+Requests flow *from* the Docker daemon *to* the plugin.  So the plugin needs to
146
+implement an HTTP server and bind this to the UNIX socket mentioned in the
147
+"plugin discovery" section.
148
+
149
+All requests are HTTP `POST` requests.
150
+
151
+The API is versioned via an Accept header, which currently is always set to
152
+`application/vnd.docker.plugins.v1+json`.
153
+
154
+## Handshake API
155
+
156
+Plugins are activated via the following "handshake" API call.
157
+
158
+### /Plugin.Activate
159
+
160
+**Request:** empty body
161
+
162
+**Response:**
163
+```
164
+{
165
+    "Implements": ["VolumeDriver"]
166
+}
167
+```
168
+
169
+Responds with a list of Docker subsystems which this plugin implements.
170
+After activation, the plugin will then be sent events from this subsystem.
171
+
172
+Possible values are:
173
+
174
+* [`authz`](plugins_authorization.md)
175
+* [`NetworkDriver`](plugins_network.md)
176
+* [`VolumeDriver`](plugins_volume.md)
177
+
178
+
179
+## Plugin retries
180
+
181
+Attempts to call a method on a plugin are retried with an exponential backoff
182
+for up to 30 seconds. This may help when packaging plugins as containers, since
183
+it gives plugin containers a chance to start up before failing any user
184
+containers which depend on them.
185
+
186
+## Plugins helpers
187
+
188
+To ease plugins development, we're providing an `sdk` for each kind of plugins
189
+currently supported by Docker at [docker/go-plugins-helpers](https://github.com/docker/go-plugins-helpers).
0 190
new file mode 100644
... ...
@@ -0,0 +1,256 @@
0
+<!--[metadata]>
1
+title = "Access authorization plugin"
2
+description = "How to create authorization plugins to manage access control to your Docker daemon."
3
+keywords = ["security, authorization, authentication, docker, documentation, plugin, extend"]
4
+aliases = ["/engine/extend/authorization/"]
5
+[menu.main]
6
+parent = "engine_extend"
7
+weight = 4
8
+<![end-metadata]-->
9
+
10
+
11
+# Create an authorization plugin
12
+
13
+This document describes the Docker Engine plugins generally available in Docker
14
+Engine. To view information on plugins managed by Docker Engine currently in
15
+experimental status, refer to [Docker Engine plugin system](index.md).
16
+
17
+Docker's out-of-the-box authorization model is all or nothing. Any user with
18
+permission to access the Docker daemon can run any Docker client command. The
19
+same is true for callers using Docker's remote API to contact the daemon. If you
20
+require greater access control, you can create authorization plugins and add
21
+them to your Docker daemon configuration. Using an authorization plugin, a
22
+Docker administrator can configure granular access policies for managing access
23
+to Docker daemon.
24
+
25
+Anyone with the appropriate skills can develop an authorization plugin. These
26
+skills, at their most basic, are knowledge of Docker, understanding of REST, and
27
+sound programming knowledge. This document describes the architecture, state,
28
+and methods information available to an authorization plugin developer.
29
+
30
+## Basic principles
31
+
32
+Docker's [plugin infrastructure](plugin_api.md) enables
33
+extending Docker by loading, removing and communicating with
34
+third-party components using a generic API. The access authorization subsystem
35
+was built using this mechanism.
36
+
37
+Using this subsystem, you don't need to rebuild the Docker daemon to add an
38
+authorization plugin.  You can add a plugin to an installed Docker daemon. You do
39
+need to restart the Docker daemon to add a new plugin.
40
+
41
+An authorization plugin approves or denies requests to the Docker daemon based
42
+on both the current authentication context and the command context. The
43
+authentication context contains all user details and the authentication method.
44
+The command context contains all the relevant request data.
45
+
46
+Authorization plugins must follow the rules described in [Docker Plugin API](plugin_api.md).
47
+Each plugin must reside within directories described under the
48
+[Plugin discovery](plugin_api.md#plugin-discovery) section.
49
+
50
+**Note**: the abbreviations `AuthZ` and `AuthN` mean authorization and authentication
51
+respectively.
52
+
53
+## Default user authorization mechanism
54
+
55
+If TLS is enabled in the [Docker daemon](../security/https.md), the default user authorization flow extracts the user details from the certificate subject name.
56
+That is, the `User` field is set to the client certificate subject common name, and the `AuthenticationMethod` field is set to `TLS`.
57
+
58
+## Basic architecture
59
+
60
+You are responsible for registering your plugin as part of the Docker daemon
61
+startup. You can install multiple plugins and chain them together. This chain
62
+can be ordered. Each request to the daemon passes in order through the chain.
63
+Only when all the plugins grant access to the resource, is the access granted.
64
+
65
+When an HTTP request is made to the Docker daemon through the CLI or via the
66
+remote API, the authentication subsystem passes the request to the installed
67
+authentication plugin(s). The request contains the user (caller) and command
68
+context. The plugin is responsible for deciding whether to allow or deny the
69
+request.
70
+
71
+The sequence diagrams below depict an allow and deny authorization flow:
72
+
73
+![Authorization Allow flow](images/authz_allow.png)
74
+
75
+![Authorization Deny flow](images/authz_deny.png)
76
+
77
+Each request sent to the plugin includes the authenticated user, the HTTP
78
+headers, and the request/response body. Only the user name and the
79
+authentication method used are passed to the plugin. Most importantly, no user
80
+credentials or tokens are passed. Finally, not all request/response bodies
81
+are sent to the authorization plugin. Only those request/response bodies where
82
+the `Content-Type` is either `text/*` or `application/json` are sent.
83
+
84
+For commands that can potentially hijack the HTTP connection (`HTTP
85
+Upgrade`), such as `exec`, the authorization plugin is only called for the
86
+initial HTTP requests. Once the plugin approves the command, authorization is
87
+not applied to the rest of the flow. Specifically, the streaming data is not
88
+passed to the authorization plugins. For commands that return chunked HTTP
89
+response, such as `logs` and `events`, only the HTTP request is sent to the
90
+authorization plugins.
91
+
92
+During request/response processing, some authorization flows might
93
+need to do additional queries to the Docker daemon. To complete such flows,
94
+plugins can call the daemon API similar to a regular user. To enable these
95
+additional queries, the plugin must provide the means for an administrator to
96
+configure proper authentication and security policies.
97
+
98
+## Docker client flows
99
+
100
+To enable and configure the authorization plugin, the plugin developer must
101
+support the Docker client interactions detailed in this section.
102
+
103
+### Setting up Docker daemon
104
+
105
+Enable the authorization plugin with a dedicated command line flag in the
106
+`--authorization-plugin=PLUGIN_ID` format. The flag supplies a `PLUGIN_ID`
107
+value. This value can be the plugin’s socket or a path to a specification file.
108
+Authorization plugins can be loaded without restarting the daemon. Refer
109
+to the [`dockerd` documentation](../reference/commandline/dockerd.md#configuration-reloading) for more information.
110
+
111
+```bash
112
+$ dockerd --authorization-plugin=plugin1 --authorization-plugin=plugin2,...
113
+```
114
+
115
+Docker's authorization subsystem supports multiple `--authorization-plugin` parameters.
116
+
117
+### Calling authorized command (allow)
118
+
119
+```bash
120
+$ docker pull centos
121
+...
122
+f1b10cd84249: Pull complete
123
+...
124
+```
125
+
126
+### Calling unauthorized command (deny)
127
+
128
+```bash
129
+$ docker pull centos
130
+...
131
+docker: Error response from daemon: authorization denied by plugin PLUGIN_NAME: volumes are not allowed.
132
+```
133
+
134
+### Error from plugins
135
+
136
+```bash
137
+$ docker pull centos
138
+...
139
+docker: Error response from daemon: plugin PLUGIN_NAME failed with error: AuthZPlugin.AuthZReq: Cannot connect to the Docker daemon. Is the docker daemon running on this host?.
140
+```
141
+
142
+## API schema and implementation
143
+
144
+In addition to Docker's standard plugin registration method, each plugin
145
+should implement the following two methods:
146
+
147
+* `/AuthZPlugin.AuthZReq` This authorize request method is called before the Docker daemon processes the client request.
148
+
149
+* `/AuthZPlugin.AuthZRes` This authorize response method is called before the response is returned from Docker daemon to the client.
150
+
151
+#### /AuthZPlugin.AuthZReq
152
+
153
+**Request**:
154
+
155
+```json
156
+{
157
+    "User":              "The user identification",
158
+    "UserAuthNMethod":   "The authentication method used",
159
+    "RequestMethod":     "The HTTP method",
160
+    "RequestURI":        "The HTTP request URI",
161
+    "RequestBody":       "Byte array containing the raw HTTP request body",
162
+    "RequestHeader":     "Byte array containing the raw HTTP request header as a map[string][]string "
163
+}
164
+```
165
+
166
+**Response**:
167
+
168
+```json
169
+{
170
+    "Allow": "Determined whether the user is allowed or not",
171
+    "Msg":   "The authorization message",
172
+    "Err":   "The error message if things go wrong"
173
+}
174
+```
175
+#### /AuthZPlugin.AuthZRes
176
+
177
+**Request**:
178
+
179
+```json
180
+{
181
+    "User":              "The user identification",
182
+    "UserAuthNMethod":   "The authentication method used",
183
+    "RequestMethod":     "The HTTP method",
184
+    "RequestURI":        "The HTTP request URI",
185
+    "RequestBody":       "Byte array containing the raw HTTP request body",
186
+    "RequestHeader":     "Byte array containing the raw HTTP request header as a map[string][]string",
187
+    "ResponseBody":      "Byte array containing the raw HTTP response body",
188
+    "ResponseHeader":    "Byte array containing the raw HTTP response header as a map[string][]string",
189
+    "ResponseStatusCode":"Response status code"
190
+}
191
+```
192
+
193
+**Response**:
194
+
195
+```json
196
+{
197
+   "Allow":              "Determined whether the user is allowed or not",
198
+   "Msg":                "The authorization message",
199
+   "Err":                "The error message if things go wrong"
200
+}
201
+```
202
+
203
+### Request authorization
204
+
205
+Each plugin must support two request authorization messages formats, one from the daemon to the plugin and then from the plugin to the daemon. The tables below detail the content expected in each message.
206
+
207
+#### Daemon -> Plugin
208
+
209
+Name                   | Type              | Description
210
+-----------------------|-------------------|-------------------------------------------------------
211
+User                   | string            | The user identification
212
+Authentication method  | string            | The authentication method used
213
+Request method         | enum              | The HTTP method (GET/DELETE/POST)
214
+Request URI            | string            | The HTTP request URI including API version (e.g., v.1.17/containers/json)
215
+Request headers        | map[string]string | Request headers as key value pairs (without the authorization header)
216
+Request body           | []byte            | Raw request body
217
+
218
+
219
+#### Plugin -> Daemon
220
+
221
+Name    | Type   | Description
222
+--------|--------|----------------------------------------------------------------------------------
223
+Allow   | bool   | Boolean value indicating whether the request is allowed or denied
224
+Msg     | string | Authorization message (will be returned to the client in case the access is denied)
225
+Err     | string | Error message (will be returned to the client in case the plugin encounter an error. The string value supplied may appear in logs, so should not include confidential information)
226
+
227
+### Response authorization
228
+
229
+The plugin must support two authorization messages formats, one from the daemon to the plugin and then from the plugin to the daemon. The tables below detail the content expected in each message.
230
+
231
+#### Daemon -> Plugin
232
+
233
+
234
+Name                    | Type              | Description
235
+----------------------- |------------------ |----------------------------------------------------
236
+User                    | string            | The user identification
237
+Authentication method   | string            | The authentication method used
238
+Request method          | string            | The HTTP method (GET/DELETE/POST)
239
+Request URI             | string            | The HTTP request URI including API version (e.g., v.1.17/containers/json)
240
+Request headers         | map[string]string | Request headers as key value pairs (without the authorization header)
241
+Request body            | []byte            | Raw request body
242
+Response status code    | int               | Status code from the docker daemon
243
+Response headers        | map[string]string | Response headers as key value pairs
244
+Response body           | []byte            | Raw docker daemon response body
245
+
246
+
247
+#### Plugin -> Daemon
248
+
249
+Name    | Type   | Description
250
+--------|--------|----------------------------------------------------------------------------------
251
+Allow   | bool   | Boolean value indicating whether the response is allowed or denied
252
+Msg     | string | Authorization message (will be returned to the client in case the access is denied)
253
+Err     | string | Error message (will be returned to the client in case the plugin encounter an error. The string value supplied may appear in logs, so should not include confidential information)
0 254
new file mode 100644
... ...
@@ -0,0 +1,73 @@
0
+<!--[metadata]>
1
+title = "Docker network driver plugins"
2
+description = "Network driver plugins."
3
+keywords = ["Examples, Usage, plugins, docker, documentation, user guide"]
4
+[menu.main]
5
+parent = "engine_extend"
6
+weight=5
7
+<![end-metadata]-->
8
+
9
+# Engine network driver plugins
10
+
11
+This document describes Docker Engine network driver plugins generally
12
+available in Docker Engine. To view information on plugins
13
+managed by Docker Engine, refer to [Docker Engine plugin system](index.md).
14
+
15
+Docker Engine network plugins enable Engine deployments to be extended to
16
+support a wide range of networking technologies, such as VXLAN, IPVLAN, MACVLAN
17
+or something completely different. Network driver plugins are supported via the
18
+LibNetwork project. Each plugin is implemented as a  "remote driver" for
19
+LibNetwork, which shares plugin infrastructure with Engine. Effectively, network
20
+driver plugins are activated in the same way as other plugins, and use the same
21
+kind of protocol.
22
+
23
+## Network driver plugins and swarm mode
24
+
25
+Docker 1.12 adds support for cluster management and orchestration called
26
+[swarm mode](../swarm/index.md). Docker Engine running in swarm mode currently
27
+only supports the built-in overlay driver for networking. Therefore existing
28
+networking plugins will not work in swarm mode.
29
+
30
+When you run Docker Engine outside of swarm mode, all networking plugins that
31
+worked in Docker 1.11 will continue to function normally. They do not require
32
+any modification.
33
+
34
+## Using network driver plugins
35
+
36
+The means of installing and running a network driver plugin depend on the
37
+particular plugin. So, be sure to install your plugin according to the
38
+instructions obtained from the plugin developer.
39
+
40
+Once running however, network driver plugins are used just like the built-in
41
+network drivers: by being mentioned as a driver in network-oriented Docker
42
+commands. For example,
43
+
44
+    $ docker network create --driver weave mynet
45
+
46
+Some network driver plugins are listed in [plugins](legacy_plugins.md)
47
+
48
+The `mynet` network is now owned by `weave`, so subsequent commands
49
+referring to that network will be sent to the plugin,
50
+
51
+    $ docker run --network=mynet busybox top
52
+
53
+
54
+## Write a network plugin
55
+
56
+Network plugins implement the [Docker plugin
57
+API](https://docs.docker.com/extend/plugin_api/) and the network plugin protocol
58
+
59
+## Network plugin protocol
60
+
61
+The network driver protocol, in addition to the plugin activation call, is
62
+documented as part of libnetwork:
63
+[https://github.com/docker/libnetwork/blob/master/docs/remote.md](https://github.com/docker/libnetwork/blob/master/docs/remote.md).
64
+
65
+# Related Information
66
+
67
+To interact with the Docker maintainers and other interested users, see the IRC channel `#docker-network`.
68
+
69
+-  [Docker networks feature overview](../userguide/networking/index.md)
70
+-  The [LibNetwork](https://github.com/docker/libnetwork) project
0 71
new file mode 100644
... ...
@@ -0,0 +1,268 @@
0
+<!--[metadata]>
1
+title = "Volume plugins"
2
+description = "How to manage data with external volume plugins"
3
+keywords = ["Examples, Usage, volume, docker, data, volumes, plugin, api"]
4
+[menu.main]
5
+parent = "engine_extend"
6
+weight=6
7
+<![end-metadata]-->
8
+
9
+# Write a volume plugin
10
+
11
+Docker Engine volume plugins enable Engine deployments to be integrated with
12
+external storage systems, such as Amazon EBS, and enable data volumes to persist
13
+beyond the lifetime of a single Engine host. See the
14
+[plugin documentation](legacy_plugins.md) for more information.
15
+
16
+## Changelog
17
+
18
+### 1.12.0
19
+
20
+- Add `Status` field to `VolumeDriver.Get` response ([#21006](https://github.com/docker/docker/pull/21006#))
21
+- Add `VolumeDriver.Capabilities` to get capabilities of the volume driver([#22077](https://github.com/docker/docker/pull/22077))
22
+
23
+### 1.10.0
24
+
25
+- Add `VolumeDriver.Get` which gets the details about the volume ([#16534](https://github.com/docker/docker/pull/16534))
26
+- Add `VolumeDriver.List` which lists all volumes owned by the driver ([#16534](https://github.com/docker/docker/pull/16534))
27
+
28
+### 1.8.0
29
+
30
+- Initial support for volume driver plugins ([#14659](https://github.com/docker/docker/pull/14659))
31
+
32
+## Command-line changes
33
+
34
+A volume plugin makes use of the `-v`and `--volume-driver` flag on the `docker run` command.  The `-v` flag accepts a volume name and the `--volume-driver` flag a driver type, for example:
35
+
36
+    $ docker run -ti -v volumename:/data --volume-driver=flocker   busybox sh
37
+
38
+This command passes the `volumename` through to the volume plugin as a
39
+user-given name for the volume. The `volumename` must not begin with a `/`.
40
+
41
+By having the user specify a  `volumename`, a plugin can associate the volume
42
+with an external volume beyond the lifetime of a single container or container
43
+host. This can be used, for example, to move a stateful container from one
44
+server to another.
45
+
46
+By specifying a `volumedriver` in conjunction with a `volumename`, users can use plugins such as [Flocker](https://clusterhq.com/docker-plugin/) to manage volumes external to a single host, such as those on EBS.
47
+
48
+
49
+## Create a VolumeDriver
50
+
51
+The container creation endpoint (`/containers/create`) accepts a `VolumeDriver`
52
+field of type `string` allowing to specify the name of the driver. It's default
53
+value of `"local"` (the default driver for local volumes).
54
+
55
+## Volume plugin protocol
56
+
57
+If a plugin registers itself as a `VolumeDriver` when activated, then it is
58
+expected to provide writeable paths on the host filesystem for the Docker
59
+daemon to provide to containers to consume.
60
+
61
+The Docker daemon handles bind-mounting the provided paths into user
62
+containers.
63
+
64
+> **Note**: Volume plugins should *not* write data to the `/var/lib/docker/`
65
+> directory, including `/var/lib/docker/volumes`. The `/var/lib/docker/`
66
+> directory is reserved for Docker.
67
+
68
+### /VolumeDriver.Create
69
+
70
+**Request**:
71
+```json
72
+{
73
+    "Name": "volume_name",
74
+    "Opts": {}
75
+}
76
+```
77
+
78
+Instruct the plugin that the user wants to create a volume, given a user
79
+specified volume name.  The plugin does not need to actually manifest the
80
+volume on the filesystem yet (until Mount is called).
81
+Opts is a map of driver specific options passed through from the user request.
82
+
83
+**Response**:
84
+```json
85
+{
86
+    "Err": ""
87
+}
88
+```
89
+
90
+Respond with a string error if an error occurred.
91
+
92
+### /VolumeDriver.Remove
93
+
94
+**Request**:
95
+```json
96
+{
97
+    "Name": "volume_name"
98
+}
99
+```
100
+
101
+Delete the specified volume from disk. This request is issued when a user invokes `docker rm -v` to remove volumes associated with a container.
102
+
103
+**Response**:
104
+```json
105
+{
106
+    "Err": ""
107
+}
108
+```
109
+
110
+Respond with a string error if an error occurred.
111
+
112
+### /VolumeDriver.Mount
113
+
114
+**Request**:
115
+```json
116
+{
117
+    "Name": "volume_name",
118
+    "ID": "b87d7442095999a92b65b3d9691e697b61713829cc0ffd1bb72e4ccd51aa4d6c"
119
+}
120
+```
121
+
122
+Docker requires the plugin to provide a volume, given a user specified volume
123
+name. This is called once per container start. If the same volume_name is requested
124
+more than once, the plugin may need to keep track of each new mount request and provision
125
+at the first mount request and deprovision at the last corresponding unmount request.
126
+
127
+`ID` is a unique ID for the caller that is requesting the mount.
128
+
129
+**Response**:
130
+```json
131
+{
132
+    "Mountpoint": "/path/to/directory/on/host",
133
+    "Err": ""
134
+}
135
+```
136
+
137
+Respond with the path on the host filesystem where the volume has been made
138
+available, and/or a string error if an error occurred.
139
+
140
+### /VolumeDriver.Path
141
+
142
+**Request**:
143
+```json
144
+{
145
+    "Name": "volume_name"
146
+}
147
+```
148
+
149
+Docker needs reminding of the path to the volume on the host.
150
+
151
+**Response**:
152
+```json
153
+{
154
+    "Mountpoint": "/path/to/directory/on/host",
155
+    "Err": ""
156
+}
157
+```
158
+
159
+Respond with the path on the host filesystem where the volume has been made
160
+available, and/or a string error if an error occurred. `Mountpoint` is optional,
161
+however the plugin may be queried again later if one is not provided.
162
+
163
+### /VolumeDriver.Unmount
164
+
165
+**Request**:
166
+```json
167
+{
168
+    "Name": "volume_name",
169
+    "ID": "b87d7442095999a92b65b3d9691e697b61713829cc0ffd1bb72e4ccd51aa4d6c"
170
+}
171
+```
172
+
173
+Indication that Docker no longer is using the named volume. This is called once
174
+per container stop.  Plugin may deduce that it is safe to deprovision it at
175
+this point.
176
+
177
+`ID` is a unique ID for the caller that is requesting the mount.
178
+
179
+**Response**:
180
+```json
181
+{
182
+    "Err": ""
183
+}
184
+```
185
+
186
+Respond with a string error if an error occurred.
187
+
188
+
189
+### /VolumeDriver.Get
190
+
191
+**Request**:
192
+```json
193
+{
194
+    "Name": "volume_name"
195
+}
196
+```
197
+
198
+Get the volume info.
199
+
200
+
201
+**Response**:
202
+```json
203
+{
204
+  "Volume": {
205
+    "Name": "volume_name",
206
+    "Mountpoint": "/path/to/directory/on/host",
207
+    "Status": {}
208
+  },
209
+  "Err": ""
210
+}
211
+```
212
+
213
+Respond with a string error if an error occurred. `Mountpoint` and `Status` are
214
+optional.
215
+
216
+
217
+### /VolumeDriver.List
218
+
219
+**Request**:
220
+```json
221
+{}
222
+```
223
+
224
+Get the list of volumes registered with the plugin.
225
+
226
+**Response**:
227
+```json
228
+{
229
+  "Volumes": [
230
+    {
231
+      "Name": "volume_name",
232
+      "Mountpoint": "/path/to/directory/on/host"
233
+    }
234
+  ],
235
+  "Err": ""
236
+}
237
+```
238
+
239
+Respond with a string error if an error occurred. `Mountpoint` is optional.
240
+
241
+### /VolumeDriver.Capabilities
242
+
243
+**Request**:
244
+```json
245
+{}
246
+```
247
+
248
+Get the list of capabilities the driver supports.
249
+The driver is not required to implement this endpoint, however in such cases
250
+the default values will be taken.
251
+
252
+**Response**:
253
+```json
254
+{
255
+  "Capabilities": {
256
+    "Scope": "global"
257
+  }
258
+}
259
+```
260
+
261
+Supported scopes are `global` and `local`. Any other value in `Scope` will be
262
+ignored and assumed to be `local`. Scope allows cluster managers to handle the
263
+volume differently, for instance with a scope of `global`, the cluster manager
264
+knows it only needs to create the volume once instead of on every engine. More
265
+capabilities may be added in the future.