Browse Source

Merge pull request #28674 from vieux/1.13.0-rc2-cherrypicks

1.13.0-rc2 cherry-picks : part 3
Victor Vieux 8 years ago
parent
commit
44fe761b35
100 changed files with 1579 additions and 7409 deletions
  1. 4 5
      Dockerfile
  2. 4 0
      Dockerfile.armhf
  3. 4 0
      Dockerfile.simple
  4. 40 3
      api/README.md
  5. 1 1
      api/server/router/plugin/backend.go
  6. 13 1
      api/server/router/plugin/plugin_routes.go
  7. 1 1
      api/server/router/swarm/cluster.go
  8. 0 4
      api/server/router/swarm/cluster_routes.go
  9. 15 8
      api/server/router/system/system_routes.go
  10. 443 35
      api/swagger.yaml
  11. 6 1
      api/types/client.go
  12. 5 0
      api/types/configs.go
  13. 25 25
      api/types/container/config.go
  14. 0 14
      api/types/container/secret.go
  15. 22 9
      api/types/plugin.go
  16. 1 1
      api/types/plugin_responses.go
  17. 2 4
      api/types/swarm/secret.go
  18. 63 29
      api/types/types.go
  19. 0 11
      api/types/versions/v1p24/types.go
  20. 1 1
      cli/command/container/exec.go
  21. 34 23
      cli/command/container/utils.go
  22. 20 3
      cli/command/plugin/enable.go
  23. 2 3
      cli/command/secret/ls.go
  24. 12 1
      cli/command/service/list.go
  25. 5 5
      cli/command/service/opts.go
  26. 5 5
      cli/command/service/parse.go
  27. 2 1
      cli/command/stack/cmd.go
  28. 59 3
      cli/command/stack/deploy.go
  29. 1 0
      cli/command/stack/opts.go
  30. 13 8
      cli/command/system/info.go
  31. 14 1
      cli/command/task/print.go
  32. 1 1
      client/README.md
  33. 4 4
      client/client.go
  34. 20 4
      client/errors.go
  35. 2 4
      client/info_test.go
  36. 1 1
      client/interface.go
  37. 9 2
      client/plugin_enable.go
  38. 3 2
      client/plugin_enable_test.go
  39. 1 1
      client/plugin_install.go
  40. 1 1
      client/secret_create.go
  41. 2 2
      client/secret_create_test.go
  42. 7 4
      container/container.go
  43. 1 1
      container/container_unix.go
  44. 10 0
      contrib/builder/deb/aarch64/build.sh
  45. 118 0
      contrib/builder/deb/aarch64/generate.sh
  46. 24 0
      contrib/builder/deb/aarch64/ubuntu-trusty/Dockerfile
  47. 22 0
      contrib/builder/deb/aarch64/ubuntu-xenial/Dockerfile
  48. 10 5
      contrib/builder/deb/armhf/debian-jessie/Dockerfile
  49. 158 0
      contrib/builder/deb/armhf/generate.sh
  50. 10 5
      contrib/builder/deb/armhf/raspbian-jessie/Dockerfile
  51. 5 1
      contrib/builder/deb/armhf/ubuntu-trusty/Dockerfile
  52. 16 0
      contrib/builder/deb/armhf/ubuntu-xenial/Dockerfile
  53. 16 0
      contrib/builder/deb/armhf/ubuntu-yakkety/Dockerfile
  54. 19 8
      contrib/completion/bash/docker
  55. 1 1
      contrib/completion/fish/docker.fish
  56. 5 4
      contrib/completion/zsh/_docker
  57. 1 1
      contrib/vagrant-docker/README.md
  58. 6 6
      daemon/cluster/cluster.go
  59. 15 11
      daemon/cluster/convert/container.go
  60. 26 3
      daemon/cluster/convert/secret.go
  61. 4 1
      daemon/cluster/executor/backend.go
  62. 11 25
      daemon/cluster/executor/container/adapter.go
  63. 63 109
      daemon/cluster/executor/container/container.go
  64. 1 1
      daemon/config.go
  65. 1 1
      daemon/config_unix.go
  66. 20 87
      daemon/container_operations_unix.go
  67. 1 1
      daemon/create.go
  68. 6 0
      daemon/daemon_windows.go
  69. 1 1
      daemon/delete.go
  70. 1 1
      daemon/exec.go
  71. 9 15
      daemon/info.go
  72. 1 1
      daemon/info_unix.go
  73. 1 1
      daemon/info_windows.go
  74. 5 17
      daemon/oci_linux.go
  75. 18 5
      daemon/secrets.go
  76. 3 3
      daemon/stats.go
  77. 1 1
      daemon/volumes.go
  78. 1 0
      daemon/volumes_unix.go
  79. 6 4
      docs/api/v1.18.md
  80. 6 4
      docs/api/v1.19.md
  81. 6 4
      docs/api/v1.20.md
  82. 6 4
      docs/api/v1.21.md
  83. 6 4
      docs/api/v1.22.md
  84. 6 4
      docs/api/v1.23.md
  85. 7 5
      docs/api/v1.24.md
  86. 18 142
      docs/api/version-history.md
  87. 12 1
      docs/deprecated.md
  88. 22 20
      docs/extend/config.md
  89. 3 0
      docs/extend/index.md
  90. 2 2
      docs/extend/plugins_authorization.md
  91. 0 22
      docs/reference/api/README.md
  92. BIN
      docs/reference/api/_static/io_oauth_authorization_page.png
  93. 0 20
      docs/reference/api/docker-io_api.md
  94. 0 281
      docs/reference/api/docker_io_accounts_api.md
  95. 0 6163
      docs/reference/api/docker_remote_api_v1.25.md
  96. 0 23
      docs/reference/api/hub_registry_spec.md
  97. 0 0
      docs/reference/api/images/event_state.gliffy
  98. BIN
      docs/reference/api/images/event_state.png
  99. 0 20
      docs/reference/api/index.md
  100. 0 138
      docs/reference/api/remote_api_client_libraries.md

+ 4 - 5
Dockerfile

@@ -25,16 +25,15 @@
 
 FROM debian:jessie
 
+# allow replacing httpredir or deb mirror
+ARG APT_MIRROR=deb.debian.org
+RUN sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list
+
 # Add zfs ppa
 RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys E871F18B51E0147C77796AC81196BA81F6B0FC61 \
 	|| apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys E871F18B51E0147C77796AC81196BA81F6B0FC61
 RUN echo deb http://ppa.launchpad.net/zfs-native/stable/ubuntu trusty main > /etc/apt/sources.list.d/zfs.list
 
-
-# Allow replacing httpredir mirror
-ARG APT_MIRROR=httpredir.debian.org
-RUN sed -i s/httpredir.debian.org/$APT_MIRROR/g /etc/apt/sources.list
-
 # Packaged dependencies
 RUN apt-get update && apt-get install -y \
 	apparmor \

+ 4 - 0
Dockerfile.armhf

@@ -17,6 +17,10 @@
 
 FROM armhf/debian:jessie
 
+# allow replacing httpredir or deb mirror
+ARG APT_MIRROR=deb.debian.org
+RUN sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list
+
 # Packaged dependencies
 RUN apt-get update && apt-get install -y \
 	apparmor \

+ 4 - 0
Dockerfile.simple

@@ -7,6 +7,10 @@
 
 FROM debian:jessie
 
+# allow replacing httpredir or deb mirror
+ARG APT_MIRROR=deb.debian.org
+RUN sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list
+
 # Compile and runtime deps
 # https://github.com/docker/docker/blob/master/project/PACKAGERS.md#build-dependencies
 # https://github.com/docker/docker/blob/master/project/PACKAGERS.md#runtime-dependencies

+ 40 - 3
api/README.md

@@ -1,5 +1,42 @@
-This directory contains code pertaining to the Docker API:
+# Working on the Engine API
 
- - Used by the docker client when communicating with the docker daemon
+The Engine API is an HTTP API used by the command-line client to communicate with the daemon. It can also be used by third-party software to control the daemon.
 
- - Used by third party tools wishing to interface with the docker daemon
+It consists of various components in this repository:
+
+- `api/swagger.yaml` A Swagger definition of the API.
+- `api/types/` Types shared by both the client and server, representing various objects, options, responses, etc. Most are written manually, but some are automatically generated from the Swagger definition. See [#27919](https://github.com/docker/docker/issues/27919) for progress on this.
+- `cli/` The command-line client.
+- `client/` The Go client used by the command-line client. It can also be used by third-party Go programs.
+- `daemon/` The daemon, which serves the API.
+
+## Swagger definition
+
+The API is defined by the [Swagger](http://swagger.io/specification/) definition in `api/swagger.yaml`. This definition can be used to:
+
+1. To automatically generate documentation.
+2. To automatically generate the Go server and client. (A work-in-progress.)
+3. Provide a machine readable version of the API for introspecting what it can do, automatically generating clients for other languages, etc.
+
+## Updating the API documentation
+
+The API documentation is generated entirely from `api/swagger.yaml`. If you make updates to the API, you'll need to edit this file to represent the change in the documentation.
+
+The file is split into two main sections:
+
+- `definitions`, which defines re-usable objects used in requests and responses
+- `paths`, which defines the API endpoints (and some inline objects which don't need to be reusable)
+
+To make an edit, first look for the endpoint you want to edit under `paths`, then make the required edits. Endpoints may reference reusable objects with `$ref`, which can be found in the `definitions` section.
+
+There is hopefully enough example material in the file for you to copy a similar pattern from elsewhere in the file (e.g. adding new fields or endpoints), but for the full reference, see the [Swagger specification](https://github.com/docker/docker/issues/27919)
+
+`swagger.yaml` is validated by `hack/validate/swagger` to ensure it is a valid Swagger definition. This is useful for when you are making edits to ensure you are doing the right thing.
+
+## Viewing the API documentation
+
+When you make edits to `swagger.yaml`, you may want to check the generated API documentation to ensure it renders correctly.
+
+All the documentation generation is done in the documentation repository, [docker/docker.github.io](https://github.com/docker/docker.github.io). The Swagger definition is vendored periodically into this repository, but you can manually copy over the Swagger definition to test changes.
+
+Copy `api/swagger.yaml` in this repository to `engine/api/[VERSION_NUMBER]/swagger.yaml` in the documentation repository, overwriting what is already there. Then, run `docker-compose up` in the documentation repository and browse to [http://localhost:4000/engine/api/](http://localhost:4000/engine/api/) when it finishes rendering.

+ 1 - 1
api/server/router/plugin/backend.go

@@ -11,7 +11,7 @@ import (
 // Backend for Plugin
 type Backend interface {
 	Disable(name string) error
-	Enable(name string) error
+	Enable(name string, config *enginetypes.PluginEnableConfig) error
 	List() ([]enginetypes.Plugin, error)
 	Inspect(name string) (enginetypes.Plugin, error)
 	Remove(name string, config *enginetypes.PluginRmConfig) error

+ 13 - 1
api/server/router/plugin/plugin_routes.go

@@ -4,6 +4,7 @@ import (
 	"encoding/base64"
 	"encoding/json"
 	"net/http"
+	"strconv"
 	"strings"
 
 	"github.com/docker/docker/api/server/httputils"
@@ -56,7 +57,18 @@ func (pr *pluginRouter) createPlugin(ctx context.Context, w http.ResponseWriter,
 }
 
 func (pr *pluginRouter) enablePlugin(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
-	return pr.backend.Enable(vars["name"])
+	if err := httputils.ParseForm(r); err != nil {
+		return err
+	}
+
+	name := vars["name"]
+	timeout, err := strconv.Atoi(r.Form.Get("timeout"))
+	if err != nil {
+		return err
+	}
+	config := &types.PluginEnableConfig{Timeout: timeout}
+
+	return pr.backend.Enable(name, config)
 }
 
 func (pr *pluginRouter) disablePlugin(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {

+ 1 - 1
api/server/router/swarm/cluster.go

@@ -44,7 +44,7 @@ func (sr *swarmRouter) initRoutes() {
 		router.NewGetRoute("/tasks", sr.getTasks),
 		router.NewGetRoute("/tasks/{id}", sr.getTask),
 		router.NewGetRoute("/secrets", sr.getSecrets),
-		router.NewPostRoute("/secrets", sr.createSecret),
+		router.NewPostRoute("/secrets/create", sr.createSecret),
 		router.NewDeleteRoute("/secrets/{id}", sr.removeSecret),
 		router.NewGetRoute("/secrets/{id}", sr.getSecret),
 		router.NewPostRoute("/secrets/{id}/update", sr.updateSecret),

+ 0 - 4
api/server/router/swarm/cluster_routes.go

@@ -237,10 +237,6 @@ func (sr *swarmRouter) getServiceLogs(ctx context.Context, w http.ResponseWriter
 		OutStream: w,
 	}
 
-	if !logsConfig.Follow {
-		return fmt.Errorf("Bad parameters: Only follow mode is currently supported")
-	}
-
 	if logsConfig.Details {
 		return fmt.Errorf("Bad parameters: details is not currently supported")
 	}

+ 15 - 8
api/server/router/system/system_routes.go

@@ -16,7 +16,6 @@ import (
 	"github.com/docker/docker/api/types/registry"
 	timetypes "github.com/docker/docker/api/types/time"
 	"github.com/docker/docker/api/types/versions"
-	"github.com/docker/docker/api/types/versions/v1p24"
 	"github.com/docker/docker/pkg/ioutils"
 	"golang.org/x/net/context"
 )
@@ -42,16 +41,24 @@ func (s *systemRouter) getInfo(ctx context.Context, w http.ResponseWriter, r *ht
 
 	if versions.LessThan(httputils.VersionFromContext(ctx), "1.25") {
 		// TODO: handle this conversion in engine-api
-		oldInfo := &v1p24.Info{
-			InfoBase:        info.InfoBase,
+		type oldInfo struct {
+			*types.Info
+			ExecutionDriver string
+		}
+		old := &oldInfo{
+			Info:            info,
 			ExecutionDriver: "<not supported>",
 		}
-		for _, s := range info.SecurityOptions {
-			if s.Key == "Name" {
-				oldInfo.SecurityOptions = append(oldInfo.SecurityOptions, s.Value)
-			}
+		nameOnlySecurityOptions := []string{}
+		kvSecOpts, err := types.DecodeSecurityOptions(old.SecurityOptions)
+		if err != nil {
+			return err
+		}
+		for _, s := range kvSecOpts {
+			nameOnlySecurityOptions = append(nameOnlySecurityOptions, s.Name)
 		}
-		return httputils.WriteJSON(w, http.StatusOK, oldInfo)
+		old.SecurityOptions = nameOnlySecurityOptions
+		return httputils.WriteJSON(w, http.StatusOK, old)
 	}
 	return httputils.WriteJSON(w, http.StatusOK, info)
 }

+ 443 - 35
api/swagger.yaml

@@ -10,18 +10,18 @@ consumes:
   - "text/plain"
 basePath: "/v1.25"
 info:
-  title: "Docker Remote API"
+  title: "Docker Engine API"
   version: "1.25"
   x-logo:
     url: "https://docs.docker.com/images/logo-docker-main.png"
   description: |
-    The Docker API is an HTTP REST API served by Docker Engine. It is the API the Docker client uses to communicate with the Engine, so everything the Docker client can do can be done with the API.
+    The Engine API is an HTTP API served by Docker Engine. It is the API the Docker client uses to communicate with the Engine, so everything the Docker client can do can be done with the API.
 
-    Most of the client's commands map directly to API endpoints (e.g. `docker ps` is `GET /containers/json`). The notable exception is running containers, which consists of several API calls. [There is example of using `curl` to run a container in the SDK documentation.](#TODO)
+    Most of the client's commands map directly to API endpoints (e.g. `docker ps` is `GET /containers/json`). The notable exception is running containers, which consists of several API calls.
 
     # Errors
 
-    The Remote API uses standard HTTP status codes to indicate the success or failure of the API call. The body of the response will be JSON in the following format:
+    The API uses standard HTTP status codes to indicate the success or failure of the API call. The body of the response will be JSON in the following format:
 
     ```
     {
@@ -31,12 +31,28 @@ info:
 
     # Versioning
 
-    The API is usually changed in each release of Docker. If you want to write a client that doesn't break when connecting to newer Docker releases, you can lock to a specific API version.
+    The API is usually changed in each release of Docker, so API calls are versioned to ensure that clients don't break.
 
-    For Docker 1.13, the API version is 1.25. To lock to this version, you prefix the URL with `/v1.25`. For example, calling `/info` is the same as calling `/v1.25/info`.
+    For Docker Engine 1.13, the API version is 1.25. To lock to this version, you prefix the URL with `/v1.25`. For example, calling `/info` is the same as calling `/v1.25/info`.
+
+    Engine releases in the near future should support this version of the API, so your client will continue to work even if it is talking to a newer Engine.
+
+    In previous versions of Docker, it was possible to access the API without providing a version. This behaviour is now deprecated will be removed in a future version of Docker.
 
     The API uses an open schema model, which means server may add extra properties to responses. Likewise, the server will ignore any extra query parameters and request body properties. When you write clients, you need to ignore additional properties in responses to ensure they do not break when talking to newer Docker daemons.
 
+    This documentation is for version 1.25 of the API, which was introduced with Docker 1.13. Use this table to find documentation for previous versions of the API:
+
+    Docker version  | API version | Changes
+    ----------------|-------------|---------
+    1.12.x | [1.24](/engine/api/v1.24/) | [API changes](/engine/api/version-history/#v1-24-api-changes)
+    1.11.x | [1.23](/engine/api/v1.23/) | [API changes](/engine/api/version-history/#v1-23-api-changes)
+    1.10.x | [1.22](/engine/api/v1.22/) | [API changes](/engine/api/version-history/#v1-22-api-changes)
+    1.9.x | [1.21](/engine/api/v1.21/) | [API changes](/engine/api/version-history/#v1-21-api-changes)
+    1.8.x | [1.20](/engine/api/v1.20/) | [API changes](/engine/api/version-history/#v1-20-api-changes)
+    1.7.x | [1.19](/engine/api/v1.19/) | [API changes](/engine/api/version-history/#v1-19-api-changes)
+    1.6.x | [1.18](/engine/api/v1.18/) | [API changes](/engine/api/version-history/#v1-18-api-changes)
+
     # Authentication
 
     Authentication for registries is handled client side. The client has to send authentication details to various endpoints that need to communicate with registries, such as `POST /images/(name)/push`. These are sent as `X-Registry-Auth` header as a Base64 encoded (JSON) string with the following structure:
@@ -543,7 +559,8 @@ definitions:
               type: "string"
           Tmpfs:
             type: "object"
-            description: "List of tmpfs mounts for this container."
+            description: |
+              A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options. For example: `{ "/run": "rw,noexec,nosuid,size=65536k" }`.
             additionalProperties:
               type: "string"
           UTSMode:
@@ -1262,7 +1279,7 @@ definitions:
         x-nullable: false
 
   Plugin:
-    description: "A plugin for the Remote API"
+    description: "A plugin for the Engine API"
     type: "object"
     required: [Settings, Enabled, Config, Name, Tag]
     properties:
@@ -1311,9 +1328,8 @@ definitions:
           - Entrypoint
           - Workdir
           - Network
-          - Capabilities
+          - Linux
           - Mounts
-          - Devices
           - Env
           - Args
         properties:
@@ -1361,18 +1377,26 @@ definitions:
               Type:
                 x-nullable: false
                 type: "string"
-          Capabilities:
-            type: "array"
-            items:
-              type: "string"
+          Linux:
+            type: "object"
+            x-nullable: false
+            required: [Capabilities, DeviceCreation, Devices]
+            properties:
+              Capabilities:
+                type: "array"
+                items:
+                  type: "string"
+              DeviceCreation:
+                type: "boolean"
+                x-nullable: false
+              Devices:
+                type: "array"
+                items:
+                  $ref: "#/definitions/PluginDevice"
           Mounts:
             type: "array"
             items:
               $ref: "#/definitions/PluginMount"
-          Devices:
-            type: "array"
-            items:
-              $ref: "#/definitions/PluginDevice"
           Env:
             type: "array"
             items:
@@ -1684,6 +1708,13 @@ definitions:
                   type: "object"
                   additionalProperties:
                     type: "string"
+      EncryptionConfig:
+        description: "Parameters related to encryption-at-rest."
+        type: "object"
+        properties:
+          AutoLockManagers:
+            description: "If set, generate a key and use it to lock data stored on the managers."
+            type: "boolean"
       TaskDefaults:
         description: "Defaults for creating tasks in this cluster."
         type: "object"
@@ -1717,6 +1748,8 @@ definitions:
       JoinTokens:
         Worker: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx"
         Manager: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2"
+      EncryptionConfig:
+        AutoLockManagers: false
   # The Swarm information for `GET /info`. It is the same as `GET /swarm`, but
   # without `JoinTokens`.
   ClusterInfo:
@@ -1787,6 +1820,25 @@ definitions:
             description: "Amount of time to wait for the container to terminate before forcefully killing it."
             type: "integer"
             format: "int64"
+          DNSConfig:
+            description: "Specification for DNS related configurations in resolver configuration file (`resolv.conf`)."
+            type: "object"
+            properties:
+              Nameservers:
+                description: "The IP addresses of the name servers."
+                type: "array"
+                items:
+                  type: "string"
+              Search:
+                description: "A search list for host-name lookup."
+                type: "array"
+                items:
+                  type: "string"
+              Options:
+                description: "A list of internal resolver variables to be modified (e.g., `debug`, `ndots:3`, etc.)."
+                type: "array"
+                items:
+                  type: "string"
       Resources:
         description: "Resource requirements which apply to each individual container created as part of the service."
         type: "object"
@@ -2296,7 +2348,41 @@ definitions:
           type: "array"
           items:
             $ref: "#/definitions/Mount"
-
+  SecretSpec:
+    type: "object"
+    properties:
+      Name:
+        description: "User-defined name of the secret."
+        type: "string"
+      Labels:
+        description: "User-defined key/value metadata."
+        type: "object"
+        additionalProperties:
+          type: "string"
+      Data:
+        description: "Base64-url-safe-encoded secret data"
+        type: "array"
+        items:
+          type: "string"
+  Secret:
+    type: "object"
+    properties:
+      ID:
+        type: "string"
+      Version:
+        type: "object"
+        properties:
+          Index:
+            type: "integer"
+            format: "int64"
+      CreatedAt:
+        type: "string"
+        format: "dateTime"
+      UpdatedAt:
+        type: "string"
+        format: "dateTime"
+      Spec:
+        $ref: "#/definitions/ServiceSpec"
 paths:
   /containers/json:
     get:
@@ -3651,7 +3737,7 @@ paths:
 
         Either the `stream` or `logs` parameter must be `true` for this endpoint to do anything.
 
-        See [the documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/) for more details.
+        See [the documentation for the `docker attach` command](/engine/reference/commandline/attach/) for more details.
 
         ### Hijacking
 
@@ -4152,11 +4238,15 @@ paths:
           default: false
         - name: "filters"
           in: "query"
-          description: "A JSON encoded value of the filters (a `map[string][]string`) to process on the containers list"
-          type: "string"
-        - name: "filter"
-          in: "query"
-          description: "Only return images with the specified name."
+          description: |
+            A JSON encoded value of the filters (a `map[string][]string`) to process on the images list.
+
+            Available filters:
+            - `dangling=true`
+            - `label=key` or `label="key=value"` of an image label
+            - `before`=(`<image-name>[:<tag>]`,  `<image id>` or `<image@digest>`)
+            - `since`=(`<image-name>[:<tag>]`,  `<image id>` or `<image@digest>`)
+            - `reference`=(`<image-name>[:<tag>]`)
           type: "string"
         - name: "digests"
           in: "query"
@@ -4171,7 +4261,7 @@ paths:
       description: |
         Build an image from a tar archive with a `Dockerfile` in it.
 
-        The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](https://docs.docker.com/engine/reference/builder/).
+        The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](/engine/reference/builder/).
 
         The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output.
 
@@ -4255,7 +4345,7 @@ paths:
           type: "integer"
         - name: "buildargs"
           in: "query"
-          description: "JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the `Dockerfile` RUN instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for passing secret values. [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg)"
+          description: "JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the `Dockerfile` RUN instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for passing secret values. [Read more about the buildargs instruction.](/engine/reference/builder/#arg)"
           type: "integer"
         - name: "shmsize"
           in: "query"
@@ -6307,7 +6397,7 @@ paths:
       summary: "Install a plugin"
       operationId: "PostPluginsPull"
       description: |
-        Pulls and installs a plugin. After the plugin is installed, it can be enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginEnable).
+        Pulls and installs a plugin. After the plugin is installed, it can be enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable).
       produces:
         - "application/json"
       responses:
@@ -6430,6 +6520,11 @@ paths:
           description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted."
           required: true
           type: "string"
+        - name: "timeout"
+          in: "query"
+          description: "Set the HTTP client timeout (in seconds)"
+          type: "integer"
+          default: 0
       tags:
         - "Plugins"
   /plugins/{name}/disable:
@@ -6478,6 +6573,31 @@ paths:
             format: "binary"
       tags:
         - "Plugins"
+  /plugins/{name}/push:
+    post:
+      summary: "Push a plugin"
+      operationId: "PluginPush"
+      description: |
+        Push a plugin to the registry.
+      parameters:
+        - name: "name"
+          in: "path"
+          description: "The name of the plugin. The `:latest` tag is optional, and is the default if omitted."
+          required: true
+          type: "string"
+      responses:
+        200:
+          description: "no error"
+        404:
+          description: "plugin not installed"
+          schema:
+            $ref: "#/definitions/ErrorResponse"
+        500:
+          description: "server error"
+          schema:
+            $ref: "#/definitions/ErrorResponse"
+      tags:
+        - "Plugins"
   /plugins/{name}/set:
     post:
       summary: "Configure a plugin"
@@ -6533,9 +6653,10 @@ paths:
 
             Available filters:
             - `id=<node id>`
+            - `label=<engine label>`
+            - `membership=`(`accepted`|`pending`)`
             - `name=<node name>`
-            - `membership=`(`pending`|`accepted`|`rejected`)`
-            - `role=`(`worker`|`manager`)`
+            - `role=`(`manager`|`worker`)`
           type: "string"
       tags:
         - "Nodes"
@@ -6559,7 +6680,7 @@ paths:
       parameters:
         - name: "id"
           in: "path"
-          description: "The ID of the node"
+          description: "The ID or name of the node"
           type: "string"
           required: true
       tags:
@@ -6581,7 +6702,7 @@ paths:
       parameters:
         - name: "id"
           in: "path"
-          description: "The ID of the node"
+          description: "The ID or name of the node"
           type: "string"
           required: true
         - name: "force"
@@ -6661,6 +6782,8 @@ paths:
                   SnapshotInterval: 10000
                   ElectionTick: 3
                 TaskDefaults: {}
+                EncryptionConfig:
+                  AutoLockManagers: false
                 Name: "default"
               JoinTokens:
                 Worker: "SWMTKN-1-1h8aps2yszaiqmz2l3oc5392pgk8e49qhx2aj3nyv0ui0hez2a-6qmn92w6bu3jdvnglku58u11a"
@@ -6728,6 +6851,8 @@ paths:
                 Raft: {}
                 Dispatcher: {}
                 CAConfig: {}
+                EncryptionConfig:
+                  AutoLockManagers: false
       tags:
         - "Swarm"
   /swarm/join:
@@ -6840,6 +6965,63 @@ paths:
           description: "Rotate the manager join token."
           type: "boolean"
           default: false
+        - name: "rotateManagerUnlockKey"
+          in: "query"
+          description: "Rotate the manager unlock key."
+          type: "boolean"
+          default: false
+      tags:
+        - "Swarm"
+  /swarm/unlockkey:
+    get:
+      summary: "Get the unlock key"
+      operationId: "SwarmUnlockkey"
+      consumes:
+        - "application/json"
+      responses:
+        200:
+          description: "no error"
+          schema:
+            type: "object"
+            properties:
+              UnlockKey:
+                description: "The swarm's unlock key."
+                type: "string"
+            example:
+              UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8"
+        500:
+          description: "server error"
+          schema:
+            $ref: "#/definitions/ErrorResponse"
+      tags:
+        - "Swarm"
+  /swarm/unlock:
+    post:
+      summary: "Unlock a locked manager"
+      operationId: "SwarmUnlock"
+      consumes:
+        - "application/json"
+      produces:
+        - "application/json"
+      parameters:
+        - name: "body"
+          in: "body"
+          required: true
+          schema:
+            type: "object"
+            properties:
+              UnlockKey:
+                description: "The swarm's unlock key."
+                type: "string"
+            example:
+              UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8"
+      responses:
+        200:
+          description: "no error"
+        500:
+          description: "server error"
+          schema:
+            $ref: "#/definitions/ErrorResponse"
       tags:
         - "Swarm"
   /services:
@@ -6864,8 +7046,9 @@ paths:
           description: |
             A JSON encoded value of the filters (a `map[string][]string`) to process on the services list. Available filters:
 
-            - `id=<node id>`
-            - `name=<node name>`
+            - `id=<service id>`
+            - `name=<service name>`
+            - `label=<service label>`
       tags:
         - "Services"
   /services/create:
@@ -6927,6 +7110,10 @@ paths:
                             Labels:
                               com.example.something: "something-value"
                       User: "33"
+                      DNSConfig:
+                        Nameservers: ["8.8.8.8"]
+                        Search: ["example.org"]
+                        Options: ["timeout:3"]
                     LogDriver:
                       Name: "json-file"
                       Options:
@@ -7083,7 +7270,85 @@ paths:
           description: "A base64-encoded auth configuration for pulling from private registries. [See the authentication section for details.](#section/Authentication)"
           type: "string"
 
-      tags: [Service]
+      tags: ["Services"]
+  /services/{id}/logs:
+    get:
+      summary: "Get service logs"
+      description: |
+        Get `stdout` and `stderr` logs from a service.
+
+        **Note**: This endpoint works only for services with the `json-file` or `journald` logging drivers.
+      operationId: "ServiceLogs"
+      produces:
+        - "application/vnd.docker.raw-stream"
+        - "application/json"
+      responses:
+        101:
+          description: "logs returned as a stream"
+          schema:
+            type: "string"
+            format: "binary"
+        200:
+          description: "logs returned as a string in response body"
+          schema:
+            type: "string"
+        404:
+          description: "no such container"
+          schema:
+            $ref: "#/definitions/ErrorResponse"
+          examples:
+            application/json:
+              message: "No such container: c2ada9df5af8"
+        500:
+          description: "server error"
+          schema:
+            $ref: "#/definitions/ErrorResponse"
+      parameters:
+        - name: "id"
+          in: "path"
+          required: true
+          description: "ID or name of the container"
+          type: "string"
+        - name: "details"
+          in: "query"
+          description: "Show extra details provided to logs."
+          type: "boolean"
+          default: false
+        - name: "follow"
+          in: "query"
+          description: |
+            Return the logs as a stream.
+
+            This will return a `101` HTTP response with a `Connection: upgrade` header, then hijack the HTTP connection to send raw output. For more information about hijacking and the stream format, [see the documentation for the attach endpoint](#operation/PostContainerAttach).
+          type: "boolean"
+          default: false
+        - name: "stdout"
+          in: "query"
+          description: "Return logs from `stdout`"
+          type: "boolean"
+          default: false
+        - name: "stderr"
+          in: "query"
+          description: "Return logs from `stderr`"
+          type: "boolean"
+          default: false
+        - name: "since"
+          in: "query"
+          description: "Only return logs since this time, as a UNIX timestamp"
+          type: "integer"
+          default: 0
+        - name: "timestamps"
+          in: "query"
+          description: "Add timestamps to every log line"
+          type: "boolean"
+          default: false
+        - name: "tail"
+          in: "query"
+          description: "Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines."
+          type: "string"
+          default: "all"
+      tags:
+        - "Services"
   /tasks:
     get:
       summary: "List tasks"
@@ -7255,3 +7520,146 @@ paths:
           type: "string"
       tags:
         - "Tasks"
+  /secrets:
+    get:
+      summary: "List secrets"
+      operationId: "SecretList"
+      produces:
+        - "application/json"
+      responses:
+        200:
+          description: "no error"
+          schema:
+            type: "array"
+            items:
+              $ref: "#/definitions/Secret"
+            example:
+              - ID: "ktnbjxoalbkvbvedmg1urrz8h"
+                Version:
+                  Index: 11
+                CreatedAt: "2016-11-05T01:20:17.327670065Z"
+                UpdatedAt: "2016-11-05T01:20:17.327670065Z"
+                Spec:
+                  Name: "app-dev.crt"
+        500:
+          description: "server error"
+          schema:
+            $ref: "#/definitions/ErrorResponse"
+      parameters:
+        - name: "filters"
+          in: "query"
+          type: "string"
+          description: |
+            A JSON encoded value of the filters (a `map[string][]string`) to process on the secrets list. Available filters:
+
+            - `names=<secret name>`
+      tags:
+        - "Secrets"
+  /secrets/create:
+    post:
+      summary: "Create a secret"
+      operationId: "SecretCreate"
+      consumes:
+        - "application/json"
+      produces:
+        - "application/json"
+      responses:
+        201:
+          description: "no error"
+          schema:
+            type: "object"
+            properties:
+              ID:
+                description: "The ID of the created secret."
+                type: "string"
+            example:
+              ID: "ktnbjxoalbkvbvedmg1urrz8h"
+        406:
+          description: "server error or node is not part of a swarm"
+          schema:
+            $ref: "#/definitions/ErrorResponse"
+        409:
+          description: "name conflicts with an existing object"
+          schema:
+            $ref: "#/definitions/ErrorResponse"
+        500:
+          description: "server error"
+          schema:
+            $ref: "#/definitions/ErrorResponse"
+      parameters:
+        - name: "body"
+          in: "body"
+          schema:
+            allOf:
+              - $ref: "#/definitions/SecretSpec"
+              - type: "object"
+                example:
+                  Name: "app-key.crt"
+                  Labels:
+                    foo: "bar"
+                  Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg=="
+      tags:
+        - "Secrets"
+  /secrets/{id}:
+    get:
+      summary: "Inspect a secret"
+      operationId: "SecretsInspect"
+      produces:
+        - "application/json"
+      responses:
+        200:
+          description: "no error"
+          schema:
+            $ref: "#/definitions/Secret"
+            example:
+              ID: "ktnbjxoalbkvbvedmg1urrz8h"
+              Version:
+                Index: 11
+              CreatedAt: "2016-11-05T01:20:17.327670065Z"
+              UpdatedAt: "2016-11-05T01:20:17.327670065Z"
+              Spec:
+                Name: "app-dev.crt"
+        404:
+          description: "secret not found"
+          schema:
+            $ref: "#/definitions/ErrorResponse"
+        406:
+          description: "node is not part of a swarm"
+          schema:
+            $ref: "#/definitions/ErrorResponse"
+        500:
+          description: "server error"
+          schema:
+            $ref: "#/definitions/ErrorResponse"
+      parameters:
+        - name: "id"
+          in: "path"
+          required: true
+          type: "string"
+          description: "ID of the secret"
+      tags:
+        - "Secrets"
+    delete:
+      summary: "Delete a secret"
+      operationId: "SecretsDelete"
+      produces:
+        - "application/json"
+      responses:
+        204:
+          description: "no error"
+        404:
+          description: "secret not found"
+          schema:
+            $ref: "#/definitions/ErrorResponse"
+        500:
+          description: "server error"
+          schema:
+            $ref: "#/definitions/ErrorResponse"
+      parameters:
+        - name: "id"
+          in: "path"
+          required: true
+          type: "string"
+          description: "ID of the secret"
+      tags:
+        - "Secrets"

+ 6 - 1
api/types/client.go

@@ -332,6 +332,11 @@ type PluginRemoveOptions struct {
 	Force bool
 }
 
+// PluginEnableOptions holds parameters to enable plugins.
+type PluginEnableOptions struct {
+	Timeout int
+}
+
 // PluginInstallOptions holds parameters to install a plugin.
 type PluginInstallOptions struct {
 	Disabled              bool
@@ -351,7 +356,7 @@ type SecretRequestOption struct {
 	Mode   os.FileMode
 }
 
-// SwarmUnlockKeyResponse contains the response for Remote API:
+// SwarmUnlockKeyResponse contains the response for Engine API:
 // GET /swarm/unlockkey
 type SwarmUnlockKeyResponse struct {
 	// UnlockKey is the unlock key in ASCII-armored format.

+ 5 - 0
api/types/configs.go

@@ -59,3 +59,8 @@ type ExecConfig struct {
 type PluginRmConfig struct {
 	ForceRemove bool
 }
+
+// PluginEnableConfig holds arguments for the plugin enable
+type PluginEnableConfig struct {
+	Timeout int
+}

+ 25 - 25
api/types/container/config.go

@@ -34,29 +34,29 @@ type HealthConfig struct {
 // All fields added to this struct must be marked `omitempty` to keep getting
 // predictable hashes from the old `v1Compatibility` configuration.
 type Config struct {
-	Hostname        string                // Hostname
-	Domainname      string                // Domainname
-	User            string                // User that will run the command(s) inside the container, also support user:group
-	AttachStdin     bool                  // Attach the standard input, makes possible user interaction
-	AttachStdout    bool                  // Attach the standard output
-	AttachStderr    bool                  // Attach the standard error
-	ExposedPorts    map[nat.Port]struct{} `json:",omitempty"` // List of exposed ports
-	Tty             bool                  // Attach standard streams to a tty, including stdin if it is not closed.
-	OpenStdin       bool                  // Open stdin
-	StdinOnce       bool                  // If true, close stdin after the 1 attached client disconnects.
-	Env             []string              // List of environment variable to set in the container
-	Cmd             strslice.StrSlice     // Command to run when starting the container
-	Healthcheck     *HealthConfig         `json:",omitempty"` // Healthcheck describes how to check the container is healthy
-	ArgsEscaped     bool                  `json:",omitempty"` // True if command is already escaped (Windows specific)
-	Image           string                // Name of the image as it was passed by the operator (e.g. could be symbolic)
-	Volumes         map[string]struct{}   // List of volumes (mounts) used for the container
-	WorkingDir      string                // Current directory (PWD) in the command will be launched
-	Entrypoint      strslice.StrSlice     // Entrypoint to run when starting the container
-	NetworkDisabled bool                  `json:",omitempty"` // Is network disabled
-	MacAddress      string                `json:",omitempty"` // Mac Address of the container
-	OnBuild         []string              // ONBUILD metadata that were defined on the image Dockerfile
-	Labels          map[string]string     // List of labels set to this container
-	StopSignal      string                `json:",omitempty"` // Signal to stop a container
-	StopTimeout     *int                  `json:",omitempty"` // Timeout (in seconds) to stop a container
-	Shell           strslice.StrSlice     `json:",omitempty"` // Shell for shell-form of RUN, CMD, ENTRYPOINT
+	Hostname        string              // Hostname
+	Domainname      string              // Domainname
+	User            string              // User that will run the command(s) inside the container, also support user:group
+	AttachStdin     bool                // Attach the standard input, makes possible user interaction
+	AttachStdout    bool                // Attach the standard output
+	AttachStderr    bool                // Attach the standard error
+	ExposedPorts    nat.PortSet         `json:",omitempty"` // List of exposed ports
+	Tty             bool                // Attach standard streams to a tty, including stdin if it is not closed.
+	OpenStdin       bool                // Open stdin
+	StdinOnce       bool                // If true, close stdin after the 1 attached client disconnects.
+	Env             []string            // List of environment variable to set in the container
+	Cmd             strslice.StrSlice   // Command to run when starting the container
+	Healthcheck     *HealthConfig       `json:",omitempty"` // Healthcheck describes how to check the container is healthy
+	ArgsEscaped     bool                `json:",omitempty"` // True if command is already escaped (Windows specific)
+	Image           string              // Name of the image as it was passed by the operator (e.g. could be symbolic)
+	Volumes         map[string]struct{} // List of volumes (mounts) used for the container
+	WorkingDir      string              // Current directory (PWD) in the command will be launched
+	Entrypoint      strslice.StrSlice   // Entrypoint to run when starting the container
+	NetworkDisabled bool                `json:",omitempty"` // Is network disabled
+	MacAddress      string              `json:",omitempty"` // Mac Address of the container
+	OnBuild         []string            // ONBUILD metadata that were defined on the image Dockerfile
+	Labels          map[string]string   // List of labels set to this container
+	StopSignal      string              `json:",omitempty"` // Signal to stop a container
+	StopTimeout     *int                `json:",omitempty"` // Timeout (in seconds) to stop a container
+	Shell           strslice.StrSlice   `json:",omitempty"` // Shell for shell-form of RUN, CMD, ENTRYPOINT
 }

+ 0 - 14
api/types/container/secret.go

@@ -1,14 +0,0 @@
-package container
-
-import "os"
-
-// ContainerSecret represents a secret in a container.  This gets realized
-// in the container tmpfs
-type ContainerSecret struct {
-	Name   string
-	Target string
-	Data   []byte
-	UID    string
-	GID    string
-	Mode   os.FileMode
-}

+ 22 - 9
api/types/plugin.go

@@ -3,7 +3,7 @@ package types
 // This file was generated by the swagger tool.
 // Editing this file might prove futile when you re-run the swagger generate command
 
-// Plugin A plugin for the Remote API
+// Plugin A plugin for the Engine API
 // swagger:model Plugin
 type Plugin struct {
 
@@ -39,18 +39,10 @@ type PluginConfig struct {
 	// Required: true
 	Args PluginConfigArgs `json:"Args"`
 
-	// capabilities
-	// Required: true
-	Capabilities []string `json:"Capabilities"`
-
 	// description
 	// Required: true
 	Description string `json:"Description"`
 
-	// devices
-	// Required: true
-	Devices []PluginDevice `json:"Devices"`
-
 	// documentation
 	// Required: true
 	Documentation string `json:"Documentation"`
@@ -67,6 +59,10 @@ type PluginConfig struct {
 	// Required: true
 	Interface PluginConfigInterface `json:"Interface"`
 
+	// linux
+	// Required: true
+	Linux PluginConfigLinux `json:"Linux"`
+
 	// mounts
 	// Required: true
 	Mounts []PluginMount `json:"Mounts"`
@@ -117,6 +113,23 @@ type PluginConfigInterface struct {
 	Types []PluginInterfaceType `json:"Types"`
 }
 
+// PluginConfigLinux plugin config linux
+// swagger:model PluginConfigLinux
+type PluginConfigLinux struct {
+
+	// capabilities
+	// Required: true
+	Capabilities []string `json:"Capabilities"`
+
+	// device creation
+	// Required: true
+	DeviceCreation bool `json:"DeviceCreation"`
+
+	// devices
+	// Required: true
+	Devices []PluginDevice `json:"Devices"`
+}
+
 // PluginConfigNetwork plugin config network
 // swagger:model PluginConfigNetwork
 type PluginConfigNetwork struct {

+ 1 - 1
api/types/plugin_responses.go

@@ -5,7 +5,7 @@ import (
 	"fmt"
 )
 
-// PluginsListResponse contains the response for the remote API
+// PluginsListResponse contains the response for the Engine API
 type PluginsListResponse []*Plugin
 
 const (

+ 2 - 4
api/types/swarm/secret.go

@@ -6,9 +6,7 @@ import "os"
 type Secret struct {
 	ID string
 	Meta
-	Spec       SecretSpec
-	Digest     string
-	SecretSize int64
+	Spec SecretSpec
 }
 
 // SecretSpec represents a secret specification from a secret in swarm
@@ -27,7 +25,7 @@ type SecretReferenceFileTarget struct {
 
 // SecretReference is a reference to a secret in swarm
 type SecretReference struct {
+	File       *SecretReferenceFileTarget
 	SecretID   string
 	SecretName string
-	Target     *SecretReferenceFileTarget
 }

+ 63 - 29
api/types/types.go

@@ -1,8 +1,11 @@
 package types
 
 import (
+	"errors"
+	"fmt"
 	"io"
 	"os"
+	"strings"
 	"time"
 
 	"github.com/docker/docker/api/types/container"
@@ -14,14 +17,14 @@ import (
 	"github.com/docker/go-connections/nat"
 )
 
-// ContainerChange contains response of Remote API:
+// ContainerChange contains response of Engine API:
 // GET "/containers/{name:.*}/changes"
 type ContainerChange struct {
 	Kind int
 	Path string
 }
 
-// ImageHistory contains response of Remote API:
+// ImageHistory contains response of Engine API:
 // GET "/images/{name:.*}/history"
 type ImageHistory struct {
 	ID        string `json:"Id"`
@@ -32,7 +35,7 @@ type ImageHistory struct {
 	Comment   string
 }
 
-// ImageDelete contains response of Remote API:
+// ImageDelete contains response of Engine API:
 // DELETE "/images/{name:.*}"
 type ImageDelete struct {
 	Untagged string `json:",omitempty"`
@@ -53,7 +56,7 @@ type RootFS struct {
 	BaseLayer string   `json:",omitempty"`
 }
 
-// ImageInspect contains response of Remote API:
+// ImageInspect contains response of Engine API:
 // GET "/images/{name:.*}/json"
 type ImageInspect struct {
 	ID              string `json:"Id"`
@@ -76,7 +79,7 @@ type ImageInspect struct {
 	RootFS          RootFS
 }
 
-// Container contains response of Remote API:
+// Container contains response of Engine API:
 // GET "/containers/json"
 type Container struct {
 	ID         string `json:"Id"`
@@ -98,7 +101,7 @@ type Container struct {
 	Mounts          []MountPoint
 }
 
-// CopyConfig contains request body of Remote API:
+// CopyConfig contains request body of Engine API:
 // POST "/containers/"+containerID+"/copy"
 type CopyConfig struct {
 	Resource string
@@ -115,28 +118,28 @@ type ContainerPathStat struct {
 	LinkTarget string      `json:"linkTarget"`
 }
 
-// ContainerStats contains response of Remote API:
+// ContainerStats contains response of Engine API:
 // GET "/stats"
 type ContainerStats struct {
 	Body   io.ReadCloser `json:"body"`
 	OSType string        `json:"ostype"`
 }
 
-// ContainerProcessList contains response of Remote API:
+// ContainerProcessList contains response of Engine API:
 // GET "/containers/{name:.*}/top"
 type ContainerProcessList struct {
 	Processes [][]string
 	Titles    []string
 }
 
-// Ping contains response of Remote API:
+// Ping contains response of Engine API:
 // GET "/_ping"
 type Ping struct {
 	APIVersion   string
 	Experimental bool
 }
 
-// Version contains response of Remote API:
+// Version contains response of Engine API:
 // GET "/version"
 type Version struct {
 	Version       string
@@ -158,9 +161,9 @@ type Commit struct {
 	Expected string
 }
 
-// InfoBase contains the base response of Remote API:
+// Info contains response of Engine API:
 // GET "/info"
-type InfoBase struct {
+type Info struct {
 	ID                 string
 	Containers         int
 	ContainersRunning  int
@@ -219,18 +222,49 @@ type InfoBase struct {
 	ContainerdCommit   Commit
 	RuncCommit         Commit
 	InitCommit         Commit
+	SecurityOptions    []string
 }
 
-// SecurityOpt holds key/value pair about a security option
-type SecurityOpt struct {
+// KeyValue holds a key/value pair
+type KeyValue struct {
 	Key, Value string
 }
 
-// Info contains response of Remote API:
-// GET "/info"
-type Info struct {
-	*InfoBase
-	SecurityOptions []SecurityOpt
+// SecurityOpt contains the name and options of a security option
+type SecurityOpt struct {
+	Name    string
+	Options []KeyValue
+}
+
+// DecodeSecurityOptions decodes a security options string slice to a type safe
+// SecurityOpt
+func DecodeSecurityOptions(opts []string) ([]SecurityOpt, error) {
+	so := []SecurityOpt{}
+	for _, opt := range opts {
+		// support output from a < 1.13 docker daemon
+		if !strings.Contains(opt, "=") {
+			so = append(so, SecurityOpt{Name: opt})
+			continue
+		}
+		secopt := SecurityOpt{}
+		split := strings.Split(opt, ",")
+		for _, s := range split {
+			kv := strings.SplitN(s, "=", 2)
+			if len(kv) != 2 {
+				return nil, fmt.Errorf("invalid security option %q", s)
+			}
+			if kv[0] == "" || kv[1] == "" {
+				return nil, errors.New("invalid empty security option")
+			}
+			if kv[0] == "name" {
+				secopt.Name = kv[1]
+				continue
+			}
+			secopt.Options = append(secopt.Options, KeyValue{Key: kv[0], Value: kv[1]})
+		}
+		so = append(so, secopt)
+	}
+	return so, nil
 }
 
 // PluginsInfo is a temp struct holding Plugins name
@@ -305,7 +339,7 @@ type ContainerNode struct {
 	Labels    map[string]string
 }
 
-// ContainerJSONBase contains response of Remote API:
+// ContainerJSONBase contains response of Engine API:
 // GET "/containers/{name:.*}/json"
 type ContainerJSONBase struct {
 	ID              string `json:"Id"`
@@ -466,7 +500,7 @@ type Runtime struct {
 	Args []string `json:"runtimeArgs,omitempty"`
 }
 
-// DiskUsage contains response of Remote API:
+// DiskUsage contains response of Engine API:
 // GET "/system/df"
 type DiskUsage struct {
 	LayersSize int64
@@ -475,49 +509,49 @@ type DiskUsage struct {
 	Volumes    []*Volume
 }
 
-// ImagesPruneConfig contains the configuration for Remote API:
+// ImagesPruneConfig contains the configuration for Engine API:
 // POST "/images/prune"
 type ImagesPruneConfig struct {
 	DanglingOnly bool
 }
 
-// ContainersPruneConfig contains the configuration for Remote API:
+// ContainersPruneConfig contains the configuration for Engine API:
 // POST "/images/prune"
 type ContainersPruneConfig struct {
 }
 
-// VolumesPruneConfig contains the configuration for Remote API:
+// VolumesPruneConfig contains the configuration for Engine API:
 // POST "/images/prune"
 type VolumesPruneConfig struct {
 }
 
-// NetworksPruneConfig contains the configuration for Remote API:
+// NetworksPruneConfig contains the configuration for Engine API:
 // POST "/networks/prune"
 type NetworksPruneConfig struct {
 }
 
-// ContainersPruneReport contains the response for Remote API:
+// ContainersPruneReport contains the response for Engine API:
 // POST "/containers/prune"
 type ContainersPruneReport struct {
 	ContainersDeleted []string
 	SpaceReclaimed    uint64
 }
 
-// VolumesPruneReport contains the response for Remote API:
+// VolumesPruneReport contains the response for Engine API:
 // POST "/volumes/prune"
 type VolumesPruneReport struct {
 	VolumesDeleted []string
 	SpaceReclaimed uint64
 }
 
-// ImagesPruneReport contains the response for Remote API:
+// ImagesPruneReport contains the response for Engine API:
 // POST "/images/prune"
 type ImagesPruneReport struct {
 	ImagesDeleted  []ImageDelete
 	SpaceReclaimed uint64
 }
 
-// NetworksPruneReport contains the response for Remote API:
+// NetworksPruneReport contains the response for Engine API:
 // POST "/networks/prune"
 type NetworksPruneReport struct {
 	NetworksDeleted []string

+ 0 - 11
api/types/versions/v1p24/types.go

@@ -1,11 +0,0 @@
-// Package v1p24 provides specific API types for the API version 1, patch 24.
-package v1p24
-
-import "github.com/docker/docker/api/types"
-
-// Info is a backcompatibility struct for the API 1.24
-type Info struct {
-	*types.InfoBase
-	ExecutionDriver string
-	SecurityOptions []string
-}

+ 1 - 1
cli/command/container/exec.go

@@ -170,7 +170,7 @@ func getExecExitCode(ctx context.Context, client apiclient.ContainerAPIClient, e
 	resp, err := client.ContainerExecInspect(ctx, execID)
 	if err != nil {
 		// If we can't connect, then the daemon probably died.
-		if err != apiclient.ErrConnectionFailed {
+		if !apiclient.IsErrConnectionFailed(err) {
 			return false, -1, err
 		}
 		return false, -1, nil

+ 34 - 23
cli/command/container/utils.go

@@ -9,6 +9,7 @@ import (
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types/events"
 	"github.com/docker/docker/api/types/filters"
+	"github.com/docker/docker/api/types/versions"
 	"github.com/docker/docker/cli/command"
 	clientapi "github.com/docker/docker/client"
 )
@@ -19,11 +20,21 @@ func waitExitOrRemoved(dockerCli *command.DockerCli, ctx context.Context, contai
 		panic("Internal Error: waitExitOrRemoved needs a containerID as parameter")
 	}
 
+	var removeErr error
 	statusChan := make(chan int)
 	exitCode := 125
 
-	eventProcessor := func(e events.Message) bool {
+	// Get events via Events API
+	f := filters.NewArgs()
+	f.Add("type", "container")
+	f.Add("container", containerID)
+	options := types.EventsOptions{
+		Filters: f,
+	}
+	eventCtx, cancel := context.WithCancel(ctx)
+	eventq, errq := dockerCli.Client().Events(eventCtx, options)
 
+	eventProcessor := func(e events.Message) bool {
 		stopProcessing := false
 		switch e.Status {
 		case "die":
@@ -37,6 +48,18 @@ func waitExitOrRemoved(dockerCli *command.DockerCli, ctx context.Context, contai
 			}
 			if !waitRemove {
 				stopProcessing = true
+			} else {
+				// If we are talking to an older daemon, `AutoRemove` is not supported.
+				// We need to fall back to the old behavior, which is client-side removal
+				if versions.LessThan(dockerCli.Client().ClientVersion(), "1.25") {
+					go func() {
+						removeErr = dockerCli.Client().ContainerRemove(ctx, containerID, types.ContainerRemoveOptions{RemoveVolumes: true})
+						if removeErr != nil {
+							logrus.Errorf("error removing container: %v", removeErr)
+							cancel() // cancel the event Q
+						}
+					}()
+				}
 			}
 		case "detach":
 			exitCode = 0
@@ -44,39 +67,27 @@ func waitExitOrRemoved(dockerCli *command.DockerCli, ctx context.Context, contai
 		case "destroy":
 			stopProcessing = true
 		}
-
-		if stopProcessing {
-			statusChan <- exitCode
-			return true
-		}
-
-		return false
+		return stopProcessing
 	}
 
-	// Get events via Events API
-	f := filters.NewArgs()
-	f.Add("type", "container")
-	f.Add("container", containerID)
-	options := types.EventsOptions{
-		Filters: f,
-	}
-
-	eventCtx, cancel := context.WithCancel(ctx)
-	eventq, errq := dockerCli.Client().Events(eventCtx, options)
-
 	go func() {
-		defer cancel()
+		defer func() {
+			statusChan <- exitCode // must always send an exit code or the caller will block
+			cancel()
+		}()
 
 		for {
 			select {
+			case <-eventCtx.Done():
+				if removeErr != nil {
+					return
+				}
 			case evt := <-eventq:
 				if eventProcessor(evt) {
 					return
 				}
-
 			case err := <-errq:
 				logrus.Errorf("error getting events from daemon: %v", err)
-				statusChan <- exitCode
 				return
 			}
 		}
@@ -91,7 +102,7 @@ func getExitCode(dockerCli *command.DockerCli, ctx context.Context, containerID
 	c, err := dockerCli.Client().ContainerInspect(ctx, containerID)
 	if err != nil {
 		// If we can't connect, then the daemon probably died.
-		if err != clientapi.ErrConnectionFailed {
+		if !clientapi.IsErrConnectionFailed(err) {
 			return false, -1, err
 		}
 		return false, -1, nil

+ 20 - 3
cli/command/plugin/enable.go

@@ -3,6 +3,7 @@ package plugin
 import (
 	"fmt"
 
+	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/cli"
 	"github.com/docker/docker/cli/command"
 	"github.com/docker/docker/reference"
@@ -10,20 +11,32 @@ import (
 	"golang.org/x/net/context"
 )
 
+type enableOpts struct {
+	timeout int
+	name    string
+}
+
 func newEnableCommand(dockerCli *command.DockerCli) *cobra.Command {
+	var opts enableOpts
+
 	cmd := &cobra.Command{
 		Use:   "enable PLUGIN",
 		Short: "Enable a plugin",
 		Args:  cli.ExactArgs(1),
 		RunE: func(cmd *cobra.Command, args []string) error {
-			return runEnable(dockerCli, args[0])
+			opts.name = args[0]
+			return runEnable(dockerCli, &opts)
 		},
 	}
 
+	flags := cmd.Flags()
+	flags.IntVar(&opts.timeout, "timeout", 0, "HTTP client timeout (in seconds)")
 	return cmd
 }
 
-func runEnable(dockerCli *command.DockerCli, name string) error {
+func runEnable(dockerCli *command.DockerCli, opts *enableOpts) error {
+	name := opts.name
+
 	named, err := reference.ParseNamed(name) // FIXME: validate
 	if err != nil {
 		return err
@@ -35,7 +48,11 @@ func runEnable(dockerCli *command.DockerCli, name string) error {
 	if !ok {
 		return fmt.Errorf("invalid name: %s", named.String())
 	}
-	if err := dockerCli.Client().PluginEnable(context.Background(), ref.String()); err != nil {
+	if opts.timeout < 0 {
+		return fmt.Errorf("negative timeout %d is invalid", opts.timeout)
+	}
+
+	if err := dockerCli.Client().PluginEnable(context.Background(), ref.String(), types.PluginEnableOptions{Timeout: opts.timeout}); err != nil {
 		return err
 	}
 	fmt.Fprintln(dockerCli.Out(), name)

+ 2 - 3
cli/command/secret/ls.go

@@ -50,15 +50,14 @@ func runSecretList(dockerCli *command.DockerCli, opts listOptions) error {
 			fmt.Fprintf(w, "%s\n", s.ID)
 		}
 	} else {
-		fmt.Fprintf(w, "ID\tNAME\tCREATED\tUPDATED\tSIZE")
+		fmt.Fprintf(w, "ID\tNAME\tCREATED\tUPDATED")
 		fmt.Fprintf(w, "\n")
 
 		for _, s := range secrets {
 			created := units.HumanDuration(time.Now().UTC().Sub(s.Meta.CreatedAt)) + " ago"
 			updated := units.HumanDuration(time.Now().UTC().Sub(s.Meta.UpdatedAt)) + " ago"
-			size := units.HumanSizeWithPrecision(float64(s.SecretSize), 3)
 
-			fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\n", s.ID, s.Spec.Annotations.Name, created, updated, size)
+			fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", s.ID, s.Spec.Annotations.Name, created, updated)
 		}
 	}
 

+ 12 - 1
cli/command/service/list.go

@@ -5,6 +5,7 @@ import (
 	"io"
 	"text/tabwriter"
 
+	distreference "github.com/docker/distribution/reference"
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types/filters"
 	"github.com/docker/docker/api/types/swarm"
@@ -127,6 +128,16 @@ func printTable(out io.Writer, services []swarm.Service, running, tasksNoShutdow
 			mode = "global"
 			replicas = fmt.Sprintf("%d/%d", running[service.ID], tasksNoShutdown[service.ID])
 		}
+		image := service.Spec.TaskTemplate.ContainerSpec.Image
+		ref, err := distreference.ParseNamed(image)
+		if err == nil {
+			// update image string for display
+			namedTagged, ok := ref.(distreference.NamedTagged)
+			if ok {
+				image = namedTagged.Name() + ":" + namedTagged.Tag()
+			}
+		}
+
 		fmt.Fprintf(
 			writer,
 			listItemFmt,
@@ -134,7 +145,7 @@ func printTable(out io.Writer, services []swarm.Service, running, tasksNoShutdow
 			service.Spec.Name,
 			mode,
 			replicas,
-			service.Spec.TaskTemplate.ContainerSpec.Image)
+			image)
 	}
 }
 

+ 5 - 5
cli/command/service/opts.go

@@ -575,14 +575,14 @@ func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) {
 	flags.Var(&opts.resources.limitMemBytes, flagLimitMemory, "Limit Memory")
 	flags.Var(&opts.resources.resCPU, flagReserveCPU, "Reserve CPUs")
 	flags.Var(&opts.resources.resMemBytes, flagReserveMemory, "Reserve Memory")
-	flags.Var(&opts.stopGrace, flagStopGracePeriod, "Time to wait before force killing a container")
+	flags.Var(&opts.stopGrace, flagStopGracePeriod, "Time to wait before force killing a container (ns|us|ms|s|m|h)")
 
 	flags.Var(&opts.replicas, flagReplicas, "Number of tasks")
 
 	flags.StringVar(&opts.restartPolicy.condition, flagRestartCondition, "", "Restart when condition is met (none, on-failure, or any)")
-	flags.Var(&opts.restartPolicy.delay, flagRestartDelay, "Delay between restart attempts")
+	flags.Var(&opts.restartPolicy.delay, flagRestartDelay, "Delay between restart attempts (ns|us|ms|s|m|h)")
 	flags.Var(&opts.restartPolicy.maxAttempts, flagRestartMaxAttempts, "Maximum number of restarts before giving up")
-	flags.Var(&opts.restartPolicy.window, flagRestartWindow, "Window used to evaluate the restart policy")
+	flags.Var(&opts.restartPolicy.window, flagRestartWindow, "Window used to evaluate the restart policy (ns|us|ms|s|m|h)")
 
 	flags.Uint64Var(&opts.update.parallelism, flagUpdateParallelism, 1, "Maximum number of tasks updated simultaneously (0 to update all at once)")
 	flags.DurationVar(&opts.update.delay, flagUpdateDelay, time.Duration(0), "Delay between updates (ns|us|ms|s|m|h) (default 0s)")
@@ -598,8 +598,8 @@ func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) {
 	flags.Var(&opts.logDriver.opts, flagLogOpt, "Logging driver options")
 
 	flags.StringVar(&opts.healthcheck.cmd, flagHealthCmd, "", "Command to run to check health")
-	flags.Var(&opts.healthcheck.interval, flagHealthInterval, "Time between running the check")
-	flags.Var(&opts.healthcheck.timeout, flagHealthTimeout, "Maximum time to allow one check to run")
+	flags.Var(&opts.healthcheck.interval, flagHealthInterval, "Time between running the check (ns|us|ms|s|m|h)")
+	flags.Var(&opts.healthcheck.timeout, flagHealthTimeout, "Maximum time to allow one check to run (ns|us|ms|s|m|h)")
 	flags.IntVar(&opts.healthcheck.retries, flagHealthRetries, 0, "Consecutive failures needed to report unhealthy")
 	flags.BoolVar(&opts.healthcheck.noHealthcheck, flagNoHealthcheck, false, "Disable any container-specified HEALTHCHECK")
 

+ 5 - 5
cli/command/service/parse.go

@@ -17,19 +17,19 @@ func parseSecrets(client client.APIClient, requestedSecrets []*types.SecretReque
 	ctx := context.Background()
 
 	for _, secret := range requestedSecrets {
+		if _, exists := secretRefs[secret.Target]; exists {
+			return nil, fmt.Errorf("duplicate secret target for %s not allowed", secret.Source)
+		}
 		secretRef := &swarmtypes.SecretReference{
-			SecretName: secret.Source,
-			Target: &swarmtypes.SecretReferenceFileTarget{
+			File: &swarmtypes.SecretReferenceFileTarget{
 				Name: secret.Target,
 				UID:  secret.UID,
 				GID:  secret.GID,
 				Mode: secret.Mode,
 			},
+			SecretName: secret.Source,
 		}
 
-		if _, exists := secretRefs[secret.Target]; exists {
-			return nil, fmt.Errorf("duplicate secret target for %s not allowed", secret.Source)
-		}
 		secretRefs[secret.Target] = secretRef
 	}
 

+ 2 - 1
cli/command/stack/cmd.go

@@ -13,7 +13,7 @@ func NewStackCommand(dockerCli *command.DockerCli) *cobra.Command {
 		Short: "Manage Docker stacks",
 		Args:  cli.NoArgs,
 		RunE:  dockerCli.ShowHelp,
-		Tags:  map[string]string{"experimental": "", "version": "1.25"},
+		Tags:  map[string]string{"version": "1.25"},
 	}
 	cmd.AddCommand(
 		newDeployCommand(dockerCli),
@@ -30,5 +30,6 @@ func NewTopLevelDeployCommand(dockerCli *command.DockerCli) *cobra.Command {
 	cmd := newDeployCommand(dockerCli)
 	// Remove the aliases at the top level
 	cmd.Aliases = []string{}
+	cmd.Tags = map[string]string{"experimental": "", "version": "1.25"}
 	return cmd
 }

+ 59 - 3
cli/command/stack/deploy.go

@@ -6,6 +6,7 @@ import (
 	"os"
 	"sort"
 	"strings"
+	"time"
 
 	"github.com/spf13/cobra"
 	"golang.org/x/net/context"
@@ -13,6 +14,7 @@ import (
 	"github.com/aanand/compose-file/loader"
 	composetypes "github.com/aanand/compose-file/types"
 	"github.com/docker/docker/api/types"
+	"github.com/docker/docker/api/types/container"
 	"github.com/docker/docker/api/types/mount"
 	networktypes "github.com/docker/docker/api/types/network"
 	"github.com/docker/docker/api/types/swarm"
@@ -47,7 +49,6 @@ func newDeployCommand(dockerCli *command.DockerCli) *cobra.Command {
 			opts.namespace = args[0]
 			return runDeploy(dockerCli, opts)
 		},
-		Tags: map[string]string{"experimental": "", "version": "1.25"},
 	}
 
 	flags := cmd.Flags()
@@ -250,9 +251,13 @@ func convertServiceNetworks(
 
 	nets := []swarm.NetworkAttachmentConfig{}
 	for networkName, network := range networks {
+		var aliases []string
+		if network != nil {
+			aliases = network.Aliases
+		}
 		nets = append(nets, swarm.NetworkAttachmentConfig{
 			Target:  namespace.scope(networkName),
-			Aliases: append(network.Aliases, name),
+			Aliases: append(aliases, name),
 		})
 	}
 	return nets
@@ -492,6 +497,11 @@ func convertService(
 		return swarm.ServiceSpec{}, err
 	}
 
+	healthcheck, err := convertHealthcheck(service.HealthCheck)
+	if err != nil {
+		return swarm.ServiceSpec{}, err
+	}
+
 	serviceSpec := swarm.ServiceSpec{
 		Annotations: swarm.Annotations{
 			Name:   name,
@@ -504,6 +514,7 @@ func convertService(
 				Args:            service.Command,
 				Hostname:        service.Hostname,
 				Hosts:           convertExtraHosts(service.ExtraHosts),
+				Healthcheck:     healthcheck,
 				Env:             convertEnvironment(service.Environment),
 				Labels:          getStackLabels(namespace.name, service.Labels),
 				Dir:             service.WorkingDir,
@@ -536,6 +547,47 @@ func convertExtraHosts(extraHosts map[string]string) []string {
 	return hosts
 }
 
+func convertHealthcheck(healthcheck *composetypes.HealthCheckConfig) (*container.HealthConfig, error) {
+	if healthcheck == nil {
+		return nil, nil
+	}
+	var (
+		err               error
+		timeout, interval time.Duration
+		retries           int
+	)
+	if healthcheck.Disable {
+		if len(healthcheck.Test) != 0 {
+			return nil, fmt.Errorf("command and disable key can't be set at the same time")
+		}
+		return &container.HealthConfig{
+			Test: []string{"NONE"},
+		}, nil
+
+	}
+	if healthcheck.Timeout != "" {
+		timeout, err = time.ParseDuration(healthcheck.Timeout)
+		if err != nil {
+			return nil, err
+		}
+	}
+	if healthcheck.Interval != "" {
+		interval, err = time.ParseDuration(healthcheck.Interval)
+		if err != nil {
+			return nil, err
+		}
+	}
+	if healthcheck.Retries != nil {
+		retries = int(*healthcheck.Retries)
+	}
+	return &container.HealthConfig{
+		Test:     healthcheck.Test,
+		Timeout:  timeout,
+		Interval: interval,
+		Retries:  retries,
+	}, nil
+}
+
 func convertRestartPolicy(restart string, source *composetypes.RestartPolicy) (*swarm.RestartPolicy, error) {
 	// TODO: log if restart is being ignored
 	if source == nil {
@@ -571,8 +623,12 @@ func convertUpdateConfig(source *composetypes.UpdateConfig) *swarm.UpdateConfig
 	if source == nil {
 		return nil
 	}
+	parallel := uint64(1)
+	if source.Parallelism != nil {
+		parallel = *source.Parallelism
+	}
 	return &swarm.UpdateConfig{
-		Parallelism:     source.Parallelism,
+		Parallelism:     parallel,
 		Delay:           source.Delay,
 		FailureAction:   source.FailureAction,
 		Monitor:         source.Monitor,

+ 1 - 0
cli/command/stack/opts.go

@@ -15,6 +15,7 @@ func addComposefileFlag(opt *string, flags *pflag.FlagSet) {
 
 func addBundlefileFlag(opt *string, flags *pflag.FlagSet) {
 	flags.StringVar(opt, "bundle-file", "", "Path to a Distributed Application Bundle file")
+	flags.SetAnnotation("bundle-file", "experimental", nil)
 }
 
 func addRegistryAuthFlag(opt *bool, flags *pflag.FlagSet) {

+ 13 - 8
cli/command/system/info.go

@@ -172,16 +172,21 @@ func prettyPrintInfo(dockerCli *command.DockerCli, info types.Info) error {
 			fmt.Fprintf(dockerCli.Out(), "\n")
 		}
 		if len(info.SecurityOptions) != 0 {
+			kvs, err := types.DecodeSecurityOptions(info.SecurityOptions)
+			if err != nil {
+				return err
+			}
 			fmt.Fprintf(dockerCli.Out(), "Security Options:\n")
-			for _, o := range info.SecurityOptions {
-				switch o.Key {
-				case "Name":
-					fmt.Fprintf(dockerCli.Out(), " %s\n", o.Value)
-				case "Profile":
-					if o.Value != "default" {
-						fmt.Fprintf(dockerCli.Err(), "  WARNING: You're not using the default seccomp profile\n")
+			for _, so := range kvs {
+				fmt.Fprintf(dockerCli.Out(), " %s\n", so.Name)
+				for _, o := range so.Options {
+					switch o.Key {
+					case "profile":
+						if o.Value != "default" {
+							fmt.Fprintf(dockerCli.Err(), "  WARNING: You're not using the default seccomp profile\n")
+						}
+						fmt.Fprintf(dockerCli.Out(), "  Profile: %s\n", o.Value)
 					}
-					fmt.Fprintf(dockerCli.Out(), "  %s: %s\n", o.Key, o.Value)
 				}
 			}
 		}

+ 14 - 1
cli/command/task/print.go

@@ -10,6 +10,7 @@ import (
 
 	"golang.org/x/net/context"
 
+	distreference "github.com/docker/distribution/reference"
 	"github.com/docker/docker/api/types/swarm"
 	"github.com/docker/docker/cli/command"
 	"github.com/docker/docker/cli/command/idresolver"
@@ -118,11 +119,23 @@ func print(out io.Writer, ctx context.Context, tasks []swarm.Task, resolver *idr
 			taskErr = fmt.Sprintf("\"%s\"", taskErr)
 		}
 
+		image := task.Spec.ContainerSpec.Image
+		if !noTrunc {
+			ref, err := distreference.ParseNamed(image)
+			if err == nil {
+				// update image string for display
+				namedTagged, ok := ref.(distreference.NamedTagged)
+				if ok {
+					image = namedTagged.Name() + ":" + namedTagged.Tag()
+				}
+			}
+		}
+
 		fmt.Fprintf(
 			out,
 			psTaskItemFmt,
 			indentedName,
-			task.Spec.ContainerSpec.Image,
+			image,
 			nodeValue,
 			command.PrettyPrint(task.DesiredState),
 			command.PrettyPrint(task.Status.State),

+ 1 - 1
client/README.md

@@ -1,4 +1,4 @@
-## Go client for the Docker Remote API
+# Go client for the Docker Engine API
 
 The `docker` command uses this package to communicate with the daemon. It can also be used by your own Go applications to do anything the command-line interface does – running containers, pulling images, managing swarms, etc.
 

+ 4 - 4
client/client.go

@@ -1,12 +1,12 @@
 /*
-Package client is a Go client for the Docker Remote API.
+Package client is a Go client for the Docker Engine API.
 
 The "docker" command uses this package to communicate with the daemon. It can also
 be used by your own Go applications to do anything the command-line interface does
 – running containers, pulling images, managing swarms, etc.
 
-For more information about the Remote API, see the documentation:
-https://docs.docker.com/engine/reference/api/docker_remote_api/
+For more information about the Engine API, see the documentation:
+https://docs.docker.com/engine/reference/api/
 
 Usage
 
@@ -122,7 +122,7 @@ func NewEnvClient() (*Client, error) {
 	if err != nil {
 		return cli, err
 	}
-	if version != "" {
+	if os.Getenv("DOCKER_API_VERSION") != "" {
 		cli.manualOverride = true
 	}
 	return cli, nil

+ 20 - 4
client/errors.go

@@ -1,18 +1,34 @@
 package client
 
 import (
-	"errors"
 	"fmt"
 
 	"github.com/docker/docker/api/types/versions"
+	"github.com/pkg/errors"
 )
 
-// ErrConnectionFailed is an error raised when the connection between the client and the server failed.
-var ErrConnectionFailed = errors.New("Cannot connect to the Docker daemon. Is the docker daemon running on this host?")
+// errConnectionFailed implements an error returned when connection failed.
+type errConnectionFailed struct {
+	host string
+}
+
+// Error returns a string representation of an errConnectionFailed
+func (err errConnectionFailed) Error() string {
+	if err.host == "" {
+		return "Cannot connect to the Docker daemon. Is the docker daemon running on this host?"
+	}
+	return fmt.Sprintf("Cannot connect to the Docker daemon at %s. Is the docker daemon running?", err.host)
+}
+
+// IsErrConnectionFailed returns true if the error is caused by connection failed.
+func IsErrConnectionFailed(err error) bool {
+	_, ok := errors.Cause(err).(errConnectionFailed)
+	return ok
+}
 
 // ErrorConnectionFailed returns an error with host in the error message when connection to docker daemon failed.
 func ErrorConnectionFailed(host string) error {
-	return fmt.Errorf("Cannot connect to the Docker daemon at %s. Is the docker daemon running?", host)
+	return errConnectionFailed{host: host}
 }
 
 type notFound interface {

+ 2 - 4
client/info_test.go

@@ -46,10 +46,8 @@ func TestInfo(t *testing.T) {
 				return nil, fmt.Errorf("Expected URL '%s', got '%s'", expectedURL, req.URL)
 			}
 			info := &types.Info{
-				InfoBase: &types.InfoBase{
-					ID:         "daemonID",
-					Containers: 3,
-				},
+				ID:         "daemonID",
+				Containers: 3,
 			}
 			b, err := json.Marshal(info)
 			if err != nil {

+ 1 - 1
client/interface.go

@@ -109,7 +109,7 @@ type NodeAPIClient interface {
 type PluginAPIClient interface {
 	PluginList(ctx context.Context) (types.PluginsListResponse, error)
 	PluginRemove(ctx context.Context, name string, options types.PluginRemoveOptions) error
-	PluginEnable(ctx context.Context, name string) error
+	PluginEnable(ctx context.Context, name string, options types.PluginEnableOptions) error
 	PluginDisable(ctx context.Context, name string) error
 	PluginInstall(ctx context.Context, name string, options types.PluginInstallOptions) error
 	PluginPush(ctx context.Context, name string, registryAuth string) error

+ 9 - 2
client/plugin_enable.go

@@ -1,12 +1,19 @@
 package client
 
 import (
+	"net/url"
+	"strconv"
+
+	"github.com/docker/docker/api/types"
 	"golang.org/x/net/context"
 )
 
 // PluginEnable enables a plugin
-func (cli *Client) PluginEnable(ctx context.Context, name string) error {
-	resp, err := cli.post(ctx, "/plugins/"+name+"/enable", nil, nil, nil)
+func (cli *Client) PluginEnable(ctx context.Context, name string, options types.PluginEnableOptions) error {
+	query := url.Values{}
+	query.Set("timeout", strconv.Itoa(options.Timeout))
+
+	resp, err := cli.post(ctx, "/plugins/"+name+"/enable", query, nil, nil)
 	ensureReaderClosed(resp)
 	return err
 }

+ 3 - 2
client/plugin_enable_test.go

@@ -8,6 +8,7 @@ import (
 	"strings"
 	"testing"
 
+	"github.com/docker/docker/api/types"
 	"golang.org/x/net/context"
 )
 
@@ -16,7 +17,7 @@ func TestPluginEnableError(t *testing.T) {
 		client: newMockClient(errorMock(http.StatusInternalServerError, "Server error")),
 	}
 
-	err := client.PluginEnable(context.Background(), "plugin_name")
+	err := client.PluginEnable(context.Background(), "plugin_name", types.PluginEnableOptions{})
 	if err == nil || err.Error() != "Error response from daemon: Server error" {
 		t.Fatalf("expected a Server Error, got %v", err)
 	}
@@ -40,7 +41,7 @@ func TestPluginEnable(t *testing.T) {
 		}),
 	}
 
-	err := client.PluginEnable(context.Background(), "plugin_name")
+	err := client.PluginEnable(context.Background(), "plugin_name", types.PluginEnableOptions{})
 	if err != nil {
 		t.Fatal(err)
 	}

+ 1 - 1
client/plugin_install.go

@@ -62,7 +62,7 @@ func (cli *Client) PluginInstall(ctx context.Context, name string, options types
 		return nil
 	}
 
-	return cli.PluginEnable(ctx, name)
+	return cli.PluginEnable(ctx, name, types.PluginEnableOptions{Timeout: 0})
 }
 
 func (cli *Client) tryPluginPull(ctx context.Context, query url.Values, registryAuth string) (serverResponse, error) {

+ 1 - 1
client/secret_create.go

@@ -13,7 +13,7 @@ func (cli *Client) SecretCreate(ctx context.Context, secret swarm.SecretSpec) (t
 	var headers map[string][]string
 
 	var response types.SecretCreateResponse
-	resp, err := cli.post(ctx, "/secrets", nil, secret, headers)
+	resp, err := cli.post(ctx, "/secrets/create", nil, secret, headers)
 	if err != nil {
 		return response, err
 	}

+ 2 - 2
client/secret_create_test.go

@@ -25,7 +25,7 @@ func TestSecretCreateError(t *testing.T) {
 }
 
 func TestSecretCreate(t *testing.T) {
-	expectedURL := "/secrets"
+	expectedURL := "/secrets/create"
 	client := &Client{
 		client: newMockClient(func(req *http.Request) (*http.Response, error) {
 			if !strings.HasPrefix(req.URL.Path, expectedURL) {
@@ -41,7 +41,7 @@ func TestSecretCreate(t *testing.T) {
 				return nil, err
 			}
 			return &http.Response{
-				StatusCode: http.StatusOK,
+				StatusCode: http.StatusCreated,
 				Body:       ioutil.NopCloser(bytes.NewReader(b)),
 			}, nil
 		}),

+ 7 - 4
container/container.go

@@ -19,6 +19,7 @@ import (
 	containertypes "github.com/docker/docker/api/types/container"
 	mounttypes "github.com/docker/docker/api/types/mount"
 	networktypes "github.com/docker/docker/api/types/network"
+	swarmtypes "github.com/docker/docker/api/types/swarm"
 	"github.com/docker/docker/container/stream"
 	"github.com/docker/docker/daemon/exec"
 	"github.com/docker/docker/daemon/logger"
@@ -41,6 +42,7 @@ import (
 	"github.com/docker/libnetwork/netlabel"
 	"github.com/docker/libnetwork/options"
 	"github.com/docker/libnetwork/types"
+	agentexec "github.com/docker/swarmkit/agent/exec"
 	"github.com/opencontainers/runc/libcontainer/label"
 )
 
@@ -68,7 +70,7 @@ func (DetachError) Error() string {
 type CommonContainer struct {
 	StreamConfig *stream.Config
 	// embed for Container to support states directly.
-	*State          `json:"State"` // Needed for remote api version <= 1.11
+	*State          `json:"State"` // Needed for Engine API version <= 1.11
 	Root            string         `json:"-"` // Path to the "home" of the container, including metadata.
 	BaseFS          string         `json:"-"` // Path to the graphdriver mountpoint
 	RWLayer         layer.RWLayer  `json:"-"`
@@ -90,9 +92,10 @@ type CommonContainer struct {
 	HasBeenStartedBefore   bool
 	HasBeenManuallyStopped bool // used for unless-stopped restart policy
 	MountPoints            map[string]*volume.MountPoint
-	HostConfig             *containertypes.HostConfig        `json:"-"` // do not serialize the host config in the json, otherwise we'll make the container unportable
-	ExecCommands           *exec.Store                       `json:"-"`
-	Secrets                []*containertypes.ContainerSecret `json:"-"` // do not serialize
+	HostConfig             *containertypes.HostConfig `json:"-"` // do not serialize the host config in the json, otherwise we'll make the container unportable
+	ExecCommands           *exec.Store                `json:"-"`
+	SecretStore            agentexec.SecretGetter     `json:"-"`
+	SecretReferences       []*swarmtypes.SecretReference
 	// logDriver for closing
 	LogDriver      logger.Logger  `json:"-"`
 	LogCopier      *logger.Copier `json:"-"`

+ 1 - 1
container/container_unix.go

@@ -258,7 +258,7 @@ func (container *Container) IpcMounts() []Mount {
 
 // SecretMount returns the mount for the secret path
 func (container *Container) SecretMount() *Mount {
-	if len(container.Secrets) > 0 {
+	if len(container.SecretReferences) > 0 {
 		return &Mount{
 			Source:      container.SecretMountPath(),
 			Destination: containerSecretMountPath,

+ 10 - 0
contrib/builder/deb/aarch64/build.sh

@@ -0,0 +1,10 @@
+#!/bin/bash
+set -e
+
+cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
+
+set -x
+./generate.sh
+for d in */; do
+	docker build -t "dockercore/builder-deb:$(basename "$d")" "$d"
+done

+ 118 - 0
contrib/builder/deb/aarch64/generate.sh

@@ -0,0 +1,118 @@
+#!/bin/bash
+set -e
+
+# This file is used to auto-generate Dockerfiles for making debs via 'make deb'
+#
+# usage: ./generate.sh [versions]
+#    ie: ./generate.sh
+#        to update all Dockerfiles in this directory
+#    or: ./generate.sh ubuntu-trusty
+#        to only update ubuntu-trusty/Dockerfile
+#    or: ./generate.sh ubuntu-newversion
+#        to create a new folder and a Dockerfile within it
+#
+# Note: non-LTS versions are not guaranteed to work.
+
+cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
+
+versions=( "$@" )
+if [ ${#versions[@]} -eq 0 ]; then
+	versions=( */ )
+fi
+versions=( "${versions[@]%/}" )
+
+for version in "${versions[@]}"; do
+	echo "${versions[@]}"
+	distro="${version%-*}"
+	suite="${version##*-}"
+	from="aarch64/${distro}:${suite}"
+
+	mkdir -p "$version"
+	echo "$version -> FROM $from"
+	cat > "$version/Dockerfile" <<-EOF
+		#
+		# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/aarch64/generate.sh"!
+		#
+
+		FROM $from
+
+	EOF
+
+	dockerBuildTags='apparmor pkcs11 selinux'
+	runcBuildTags='apparmor selinux'
+
+	# this list is sorted alphabetically; please keep it that way
+	packages=(
+		apparmor # for apparmor_parser for testing the profile
+		bash-completion # for bash-completion debhelper integration
+		btrfs-tools # for "btrfs/ioctl.h" (and "version.h" if possible)
+		build-essential # "essential for building Debian packages"
+		cmake # tini dep
+		curl ca-certificates # for downloading Go
+		debhelper # for easy ".deb" building
+		dh-apparmor # for apparmor debhelper
+		dh-systemd # for systemd debhelper integration
+		git # for "git commit" info in "docker -v"
+		libapparmor-dev # for "sys/apparmor.h"
+		libdevmapper-dev # for "libdevmapper.h"
+		libltdl-dev # for pkcs11 "ltdl.h"
+		libsqlite3-dev # for "sqlite3.h"
+		pkg-config # for detecting things like libsystemd-journal dynamically
+		vim-common # tini dep
+	)
+
+	case "$suite" in
+		trusty)
+			packages+=( libsystemd-journal-dev )
+			# aarch64 doesn't have an official downloadable binary for go.
+			# And gccgo for trusty only includes Go 1.2 implementation which
+			# is too old to build current go source, fortunately trusty has
+			# golang-1.6-go package can be used as bootstrap.
+			packages+=( golang-1.6-go )
+			;;
+		xenial)
+			packages+=( libsystemd-dev )
+			packages+=( golang-go libseccomp-dev)
+
+			dockerBuildTags="$dockerBuildTags seccomp"
+			runcBuildTags="$runcBuildTags seccomp"
+			;;
+		*)
+			echo "Unsupported distro:" $distro:$suite
+			rm -fr "$version"
+			exit 1
+			;;
+	esac
+
+	# update and install packages
+	echo "RUN apt-get update && apt-get install -y ${packages[*]} --no-install-recommends && rm -rf /var/lib/apt/lists/*" >> "$version/Dockerfile"
+	echo >> "$version/Dockerfile"
+
+	case "$suite" in
+		trusty)
+			echo 'RUN update-alternatives --install /usr/bin/go go /usr/lib/go-1.6/bin/go 100' >> "$version/Dockerfile"
+			echo >> "$version/Dockerfile"
+			;;
+		*)
+			;;
+	esac
+
+	echo "# Install Go" >> "$version/Dockerfile"
+	echo "# aarch64 doesn't have official go binaries, so use the version of go installed from" >> "$version/Dockerfile"
+	echo "# the image to build go from source." >> "$version/Dockerfile"
+
+	awk '$1 == "ENV" && $2 == "GO_VERSION" { print; exit }' ../../../../Dockerfile.aarch64 >> "$version/Dockerfile"
+	echo 'RUN mkdir /usr/src/go && curl -fsSL https://golang.org/dl/go${GO_VERSION}.src.tar.gz | tar -v -C /usr/src/go -xz --strip-components=1 \' >> "$version/Dockerfile"
+	echo '	&& cd /usr/src/go/src \' >> "$version/Dockerfile"
+	echo '	&& GOOS=linux GOARCH=arm64 GOROOT_BOOTSTRAP="$(go env GOROOT)" ./make.bash' >> "$version/Dockerfile"
+	echo >> "$version/Dockerfile"
+
+	echo 'ENV PATH $PATH:/usr/src/go/bin' >> "$version/Dockerfile"
+	echo >> "$version/Dockerfile"
+
+	echo "ENV AUTO_GOPATH 1" >> "$version/Dockerfile"
+	echo >> "$version/Dockerfile"
+
+	echo "ENV DOCKER_BUILDTAGS $dockerBuildTags" >> "$version/Dockerfile"
+	echo "ENV RUNC_BUILDTAGS $runcBuildTags" >> "$version/Dockerfile"
+done

+ 24 - 0
contrib/builder/deb/aarch64/ubuntu-trusty/Dockerfile

@@ -0,0 +1,24 @@
+#
+# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/aarch64/generate.sh"!
+#
+
+FROM aarch64/ubuntu:trusty
+
+RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential cmake curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libsqlite3-dev pkg-config vim-common libsystemd-journal-dev golang-1.6-go --no-install-recommends && rm -rf /var/lib/apt/lists/*
+
+RUN update-alternatives --install /usr/bin/go go /usr/lib/go-1.6/bin/go 100
+
+# Install Go
+# aarch64 doesn't have official go binaries, so use the version of go installed from
+# the image to build go from source.
+ENV GO_VERSION 1.7.3
+RUN mkdir /usr/src/go && curl -fsSL https://golang.org/dl/go${GO_VERSION}.src.tar.gz | tar -v -C /usr/src/go -xz --strip-components=1 \
+	&& cd /usr/src/go/src \
+	&& GOOS=linux GOARCH=arm64 GOROOT_BOOTSTRAP="$(go env GOROOT)" ./make.bash
+
+ENV PATH $PATH:/usr/src/go/bin
+
+ENV AUTO_GOPATH 1
+
+ENV DOCKER_BUILDTAGS apparmor pkcs11 selinux
+ENV RUNC_BUILDTAGS apparmor selinux

+ 22 - 0
contrib/builder/deb/aarch64/ubuntu-xenial/Dockerfile

@@ -0,0 +1,22 @@
+#
+# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/aarch64/generate.sh"!
+#
+
+FROM aarch64/ubuntu:xenial
+
+RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential cmake curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libsqlite3-dev pkg-config vim-common libsystemd-dev golang-go libseccomp-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
+
+# Install Go
+# aarch64 doesn't have official go binaries, so use the version of go installed from
+# the image to build go from source.
+ENV GO_VERSION 1.7.3
+RUN mkdir /usr/src/go && curl -fsSL https://golang.org/dl/go${GO_VERSION}.src.tar.gz | tar -v -C /usr/src/go -xz --strip-components=1 \
+	&& cd /usr/src/go/src \
+	&& GOOS=linux GOARCH=arm64 GOROOT_BOOTSTRAP="$(go env GOROOT)" ./make.bash
+
+ENV PATH $PATH:/usr/src/go/bin
+
+ENV AUTO_GOPATH 1
+
+ENV DOCKER_BUILDTAGS apparmor pkcs11 selinux seccomp
+ENV RUNC_BUILDTAGS apparmor selinux seccomp

+ 10 - 5
contrib/builder/deb/armhf/debian-jessie/Dockerfile

@@ -1,15 +1,20 @@
+#
+# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/armhf/generate.sh"!
+#
+
 FROM armhf/debian:jessie
 
-# allow replacing httpredir mirror
-ARG APT_MIRROR=httpredir.debian.org
-RUN sed -i s/httpredir.debian.org/$APT_MIRROR/g /etc/apt/sources.list
+# allow replacing httpredir or deb mirror
+ARG APT_MIRROR=deb.debian.org
+RUN sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list
 
-RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential cmake curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libsqlite3-dev libsystemd-journal-dev vim-common --no-install-recommends && rm -rf /var/lib/apt/lists/*
+RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential cmake curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev  libsqlite3-dev pkg-config vim-common libsystemd-journal-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
 
 ENV GO_VERSION 1.7.3
 RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-armv6l.tar.gz" | tar xzC /usr/local
 ENV PATH $PATH:/usr/local/go/bin
 
 ENV AUTO_GOPATH 1
-ENV DOCKER_BUILDTAGS apparmor selinux
+
+ENV DOCKER_BUILDTAGS apparmor pkcs11 selinux
 ENV RUNC_BUILDTAGS apparmor selinux

+ 158 - 0
contrib/builder/deb/armhf/generate.sh

@@ -0,0 +1,158 @@
+#!/bin/bash
+set -e
+
+# usage: ./generate.sh [versions]
+#    ie: ./generate.sh
+#        to update all Dockerfiles in this directory
+#    or: ./generate.sh debian-jessie
+#        to only update debian-jessie/Dockerfile
+#    or: ./generate.sh debian-newversion
+#        to create a new folder and a Dockerfile within it
+
+cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
+
+versions=( "$@" )
+if [ ${#versions[@]} -eq 0 ]; then
+	versions=( */ )
+fi
+versions=( "${versions[@]%/}" )
+
+for version in "${versions[@]}"; do
+	distro="${version%-*}"
+	suite="${version##*-}"
+	from="${distro}:${suite}"
+
+	case "$from" in
+		raspbian:jessie)
+			from="resin/rpi-raspbian:jessie"
+			;;
+		*)
+			from="armhf/$from"
+			;;
+	esac
+
+	mkdir -p "$version"
+	echo "$version -> FROM $from"
+	cat > "$version/Dockerfile" <<-EOF
+		#
+		# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/armhf/generate.sh"!
+		#
+
+		FROM $from
+	EOF
+
+	echo >> "$version/Dockerfile"
+
+	if [[ "$distro" = "debian" || "$distro" = "raspbian" ]]; then
+		cat >> "$version/Dockerfile" <<-'EOF'
+			# allow replacing httpredir or deb mirror
+			ARG APT_MIRROR=deb.debian.org
+			RUN sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list
+		EOF
+
+		if [ "$suite" = "wheezy" ]; then
+			cat >> "$version/Dockerfile" <<-'EOF'
+				RUN sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list.d/backports.list
+			EOF
+		fi
+
+		echo "" >> "$version/Dockerfile"
+	fi
+
+	extraBuildTags='pkcs11'
+	runcBuildTags=
+
+	# this list is sorted alphabetically; please keep it that way
+	packages=(
+		apparmor # for apparmor_parser for testing the profile
+		bash-completion # for bash-completion debhelper integration
+		btrfs-tools # for "btrfs/ioctl.h" (and "version.h" if possible)
+		build-essential # "essential for building Debian packages"
+		cmake # tini dep
+		curl ca-certificates # for downloading Go
+		debhelper # for easy ".deb" building
+		dh-apparmor # for apparmor debhelper
+		dh-systemd # for systemd debhelper integration
+		git # for "git commit" info in "docker -v"
+		libapparmor-dev # for "sys/apparmor.h"
+		libdevmapper-dev # for "libdevmapper.h"
+		libltdl-dev # for pkcs11 "ltdl.h"
+		libseccomp-dev  # for "seccomp.h" & "libseccomp.so"
+		libsqlite3-dev # for "sqlite3.h"
+		pkg-config # for detecting things like libsystemd-journal dynamically
+		vim-common # tini dep
+	)
+	# packaging for "sd-journal.h" and libraries varies
+	case "$suite" in
+		precise|wheezy) ;;
+		jessie|trusty) packages+=( libsystemd-journal-dev );;
+		*) packages+=( libsystemd-dev );;
+	esac
+
+	# debian wheezy & ubuntu precise do not have the right libseccomp libs
+	# debian jessie & ubuntu trusty have a libseccomp < 2.2.1 :(
+	case "$suite" in
+		precise|wheezy|jessie|trusty)
+			packages=( "${packages[@]/libseccomp-dev}" )
+			runcBuildTags="apparmor selinux"
+			;;
+		*)
+			extraBuildTags+=' seccomp'
+			runcBuildTags="apparmor seccomp selinux"
+			;;
+	esac
+
+
+	if [ "$suite" = 'precise' ]; then
+		# precise has a few package issues
+
+		# - dh-systemd doesn't exist at all
+		packages=( "${packages[@]/dh-systemd}" )
+
+		# - libdevmapper-dev is missing critical structs (too old)
+		packages=( "${packages[@]/libdevmapper-dev}" )
+		extraBuildTags+=' exclude_graphdriver_devicemapper'
+
+		# - btrfs-tools is missing "ioctl.h" (too old), so it's useless
+		#   (since kernels on precise are old too, just skip btrfs entirely)
+		packages=( "${packages[@]/btrfs-tools}" )
+		extraBuildTags+=' exclude_graphdriver_btrfs'
+	fi
+
+	if [ "$suite" = 'wheezy' ]; then
+		# pull a couple packages from backports explicitly
+		# (build failures otherwise)
+		backportsPackages=( btrfs-tools )
+		for pkg in "${backportsPackages[@]}"; do
+			packages=( "${packages[@]/$pkg}" )
+		done
+		echo "RUN apt-get update && apt-get install -y -t $suite-backports ${backportsPackages[*]} --no-install-recommends && rm -rf /var/lib/apt/lists/*" >> "$version/Dockerfile"
+	fi
+
+	echo "RUN apt-get update && apt-get install -y ${packages[*]} --no-install-recommends && rm -rf /var/lib/apt/lists/*" >> "$version/Dockerfile"
+
+	echo >> "$version/Dockerfile"
+
+	awk '$1 == "ENV" && $2 == "GO_VERSION" { print; exit }' ../../../../Dockerfile >> "$version/Dockerfile"
+	if [ "$distro" == 'raspbian' ];
+	then
+		cat <<EOF >> "$version/Dockerfile"
+# GOARM is the ARM architecture version which is unrelated to the above Golang version
+ENV GOARM 6
+EOF
+	fi
+	echo 'RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-armv6l.tar.gz" | tar xzC /usr/local' >> "$version/Dockerfile"
+	echo 'ENV PATH $PATH:/usr/local/go/bin' >> "$version/Dockerfile"
+
+	echo >> "$version/Dockerfile"
+
+	echo 'ENV AUTO_GOPATH 1' >> "$version/Dockerfile"
+
+	echo >> "$version/Dockerfile"
+
+	# print build tags in alphabetical order
+	buildTags=$( echo "apparmor selinux $extraBuildTags" | xargs -n1 | sort -n | tr '\n' ' ' | sed -e 's/[[:space:]]*$//' )
+
+	echo "ENV DOCKER_BUILDTAGS $buildTags" >> "$version/Dockerfile"
+	echo "ENV RUNC_BUILDTAGS $runcBuildTags" >> "$version/Dockerfile"
+done

+ 10 - 5
contrib/builder/deb/armhf/raspbian-jessie/Dockerfile

@@ -1,10 +1,14 @@
+#
+# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/armhf/generate.sh"!
+#
+
 FROM resin/rpi-raspbian:jessie
 
-# allow replacing httpredir mirror
-ARG APT_MIRROR=httpredir.debian.org
-RUN sed -i s/httpredir.debian.org/$APT_MIRROR/g /etc/apt/sources.list
+# allow replacing httpredir or deb mirror
+ARG APT_MIRROR=deb.debian.org
+RUN sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list
 
-RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential cmake curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libsqlite3-dev libsystemd-journal-dev vim-common --no-install-recommends && rm -rf /var/lib/apt/lists/*
+RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential cmake curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev  libsqlite3-dev pkg-config vim-common libsystemd-journal-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
 
 ENV GO_VERSION 1.7.3
 # GOARM is the ARM architecture version which is unrelated to the above Golang version
@@ -13,5 +17,6 @@ RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-armv6l.tar.gz" | tar
 ENV PATH $PATH:/usr/local/go/bin
 
 ENV AUTO_GOPATH 1
-ENV DOCKER_BUILDTAGS apparmor selinux
+
+ENV DOCKER_BUILDTAGS apparmor pkcs11 selinux
 ENV RUNC_BUILDTAGS apparmor selinux

+ 5 - 1
contrib/builder/deb/armhf/ubuntu-trusty/Dockerfile

@@ -1,6 +1,10 @@
+#
+# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/armhf/generate.sh"!
+#
+
 FROM armhf/ubuntu:trusty
 
-RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential cmake curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libsqlite3-dev pkg-config libsystemd-journal-dev vim-common --no-install-recommends && rm -rf /var/lib/apt/lists/*
+RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential cmake curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev  libsqlite3-dev pkg-config vim-common libsystemd-journal-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
 
 ENV GO_VERSION 1.7.3
 RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-armv6l.tar.gz" | tar xzC /usr/local

+ 16 - 0
contrib/builder/deb/armhf/ubuntu-xenial/Dockerfile

@@ -0,0 +1,16 @@
+#
+# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/armhf/generate.sh"!
+#
+
+FROM armhf/ubuntu:xenial
+
+RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential cmake curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libseccomp-dev libsqlite3-dev pkg-config vim-common libsystemd-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
+
+ENV GO_VERSION 1.7.3
+RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-armv6l.tar.gz" | tar xzC /usr/local
+ENV PATH $PATH:/usr/local/go/bin
+
+ENV AUTO_GOPATH 1
+
+ENV DOCKER_BUILDTAGS apparmor pkcs11 seccomp selinux
+ENV RUNC_BUILDTAGS apparmor seccomp selinux

+ 16 - 0
contrib/builder/deb/armhf/ubuntu-yakkety/Dockerfile

@@ -0,0 +1,16 @@
+#
+# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/armhf/generate.sh"!
+#
+
+FROM armhf/ubuntu:yakkety
+
+RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential cmake curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libseccomp-dev libsqlite3-dev pkg-config vim-common libsystemd-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
+
+ENV GO_VERSION 1.7.3
+RUN curl -fSL "https://golang.org/dl/go${GO_VERSION}.linux-armv6l.tar.gz" | tar xzC /usr/local
+ENV PATH $PATH:/usr/local/go/bin
+
+ENV AUTO_GOPATH 1
+
+ENV DOCKER_BUILDTAGS apparmor pkcs11 seccomp selinux
+ENV RUNC_BUILDTAGS apparmor seccomp selinux

+ 19 - 8
contrib/completion/bash/docker

@@ -1708,6 +1708,7 @@ _docker_daemon() {
 		--shutdown-timeout
 		--storage-driver -s
 		--storage-opt
+		--userland-proxy-path
 		--userns-remap
 	"
 
@@ -1754,7 +1755,7 @@ _docker_daemon() {
 			__docker_nospace
 			return
 			;;
-		--config-file|--containerd|--init-path|--pidfile|-p|--tlscacert|--tlscert|--tlskey)
+		--config-file|--containerd|--init-path|--pidfile|-p|--tlscacert|--tlscert|--tlskey|--userland-proxy-path)
 			_filedir
 			return
 			;;
@@ -1913,6 +1914,7 @@ _docker_image_build() {
 		--label
 		--memory -m
 		--memory-swap
+		--network
 		--shm-size
 		--tag -t
 		--ulimit
@@ -1949,6 +1951,20 @@ _docker_image_build() {
 			__docker_complete_isolation
 			return
 			;;
+		--network)
+			case "$cur" in
+				container:*)
+					__docker_complete_containers_all --cur "${cur#*:}"
+					;;
+				*)
+					COMPREPLY=( $( compgen -W "$(__docker_plugins --type Network) $(__docker_networks) container:" -- "$cur") )
+					if [ "${COMPREPLY[*]}" = "container:" ] ; then
+						__docker_nospace
+					fi
+					;;
+			esac
+			return
+			;;
 		--tag|-t)
 			__docker_complete_image_repos_and_tags
 			return
@@ -2041,7 +2057,7 @@ _docker_image_list() {
 _docker_image_ls() {
 	local key=$(__docker_map_key_of_current_option '--filter|-f')
 	case "$key" in
-		before)
+		before|since|reference)
 			cur="${cur##*=}"
 			__docker_complete_images
 			return
@@ -2053,16 +2069,11 @@ _docker_image_ls() {
 		label)
 			return
 			;;
-		since)
-			cur="${cur##*=}"
-			__docker_complete_images
-			return
-			;;
 	esac
 
 	case "$prev" in
 		--filter|-f)
-			COMPREPLY=( $( compgen -S = -W "before dangling label since" -- "$cur" ) )
+			COMPREPLY=( $( compgen -S = -W "before dangling label reference since" -- "$cur" ) )
 			__docker_nospace
 			return
 			;;

+ 1 - 1
contrib/completion/fish/docker.fish

@@ -43,7 +43,7 @@ function __fish_print_docker_repositories --description 'Print a list of docker
 end
 
 # common options
-complete -c docker -f -n '__fish_docker_no_subcommand' -l api-cors-header -d "Set CORS headers in the remote API. Default is cors disabled"
+complete -c docker -f -n '__fish_docker_no_subcommand' -l api-cors-header -d "Set CORS headers in the Engine API. Default is cors disabled"
 complete -c docker -f -n '__fish_docker_no_subcommand' -s b -l bridge -d 'Attach containers to a pre-existing network bridge'
 complete -c docker -f -n '__fish_docker_no_subcommand' -l bip -d "Use this CIDR notation address for the network bridge's IP, not compatible with -b"
 complete -c docker -f -n '__fish_docker_no_subcommand' -s D -l debug -d 'Enable debug mode'

+ 5 - 4
contrib/completion/zsh/_docker

@@ -399,11 +399,11 @@ __docker_complete_images_filters() {
     declare -a boolean_opts opts
 
     boolean_opts=('true' 'false')
-    opts=('before' 'dangling' 'label' 'since')
+    opts=('before' 'dangling' 'label' 'reference' 'since')
 
     if compset -P '*='; then
         case "${${words[-1]%=*}#*=}" in
-            (before|since)
+            (before|reference|since)
                 __docker_complete_images && ret=0
                 ;;
             (dangling)
@@ -2200,7 +2200,7 @@ __docker_subcommand() {
             _arguments $(__docker_arguments) \
                 $opts_help \
                 "($help)*--add-runtime=[Register an additional OCI compatible runtime]:runtime:__docker_complete_runtimes" \
-                "($help)--api-cors-header=[CORS headers in the remote API]:CORS headers: " \
+                "($help)--api-cors-header=[CORS headers in the Engine API]:CORS headers: " \
                 "($help)*--authorization-plugin=[Authorization plugins to load]" \
                 "($help -b --bridge)"{-b=,--bridge=}"[Attach containers to a network bridge]:bridge:_net_interfaces" \
                 "($help)--bip=[Network bridge IP]:IP address: " \
@@ -2257,7 +2257,8 @@ __docker_subcommand() {
                 "($help)--tlskey=[Path to TLS key file]:Key file:_files -g \"*.(pem|key)\"" \
                 "($help)--tlsverify[Use TLS and verify the remote]" \
                 "($help)--userns-remap=[User/Group setting for user namespaces]:user\:group:->users-groups" \
-                "($help)--userland-proxy[Use userland proxy for loopback traffic]" && ret=0
+                "($help)--userland-proxy[Use userland proxy for loopback traffic]" \
+                "($help)--userland-proxy-path=[Path to the userland proxy binary]:binary:_files" && ret=0
 
             case $state in
                 (cluster-store)

+ 1 - 1
contrib/vagrant-docker/README.md

@@ -18,7 +18,7 @@ meaning you can use Vagrant to control Docker containers.
 * [docker-provider](https://github.com/fgrehm/docker-provider)
 * [vagrant-shell](https://github.com/destructuring/vagrant-shell)
 
-## Setting up Vagrant-docker with the Remote API
+## Setting up Vagrant-docker with the Engine API
 
 The initial Docker upstart script will not work because it runs on `127.0.0.1`, which is not accessible to the host machine. Instead, we need to change the script to connect to `0.0.0.0`. To do this, modify `/etc/init/docker.conf` to look like this:
 

+ 6 - 6
daemon/cluster/cluster.go

@@ -595,6 +595,11 @@ func (c *Cluster) UnlockSwarm(req types.UnlockRequest) error {
 			return err
 		}
 	}
+
+	if c.node != nil || c.locked != true {
+		c.RUnlock()
+		return errors.New("swarm is not locked")
+	}
 	c.RUnlock()
 
 	key, err := encryption.ParseHumanReadableKey(req.UnlockKey)
@@ -603,11 +608,6 @@ func (c *Cluster) UnlockSwarm(req types.UnlockRequest) error {
 	}
 
 	c.Lock()
-	if c.node != nil || c.locked != true {
-		c.Unlock()
-		return errors.New("swarm is not locked")
-	}
-
 	config := *c.lastNodeConfig
 	config.lockKey = key
 	n, err := c.startNewNode(config)
@@ -1278,7 +1278,7 @@ func (c *Cluster) ServiceLogs(ctx context.Context, input string, config *backend
 			ServiceIDs: []string{service.ID},
 		},
 		Options: &swarmapi.LogSubscriptionOptions{
-			Follow: true,
+			Follow: config.Follow,
 		},
 	})
 	if err != nil {

+ 15 - 11
daemon/cluster/convert/container.go

@@ -82,18 +82,22 @@ func containerSpecFromGRPC(c *swarmapi.ContainerSpec) types.ContainerSpec {
 func secretReferencesToGRPC(sr []*types.SecretReference) []*swarmapi.SecretReference {
 	refs := make([]*swarmapi.SecretReference, 0, len(sr))
 	for _, s := range sr {
-		refs = append(refs, &swarmapi.SecretReference{
+		ref := &swarmapi.SecretReference{
 			SecretID:   s.SecretID,
 			SecretName: s.SecretName,
-			Target: &swarmapi.SecretReference_File{
+		}
+		if s.File != nil {
+			ref.Target = &swarmapi.SecretReference_File{
 				File: &swarmapi.SecretReference_FileTarget{
-					Name: s.Target.Name,
-					UID:  s.Target.UID,
-					GID:  s.Target.GID,
-					Mode: s.Target.Mode,
+					Name: s.File.Name,
+					UID:  s.File.UID,
+					GID:  s.File.GID,
+					Mode: s.File.Mode,
 				},
-			},
-		})
+			}
+		}
+
+		refs = append(refs, ref)
 	}
 
 	return refs
@@ -108,14 +112,14 @@ func secretReferencesFromGRPC(sr []*swarmapi.SecretReference) []*types.SecretRef
 			continue
 		}
 		refs = append(refs, &types.SecretReference{
-			SecretID:   s.SecretID,
-			SecretName: s.SecretName,
-			Target: &types.SecretReferenceFileTarget{
+			File: &types.SecretReferenceFileTarget{
 				Name: target.Name,
 				UID:  target.UID,
 				GID:  target.GID,
 				Mode: target.Mode,
 			},
+			SecretID:   s.SecretID,
+			SecretName: s.SecretName,
 		})
 	}
 

+ 26 - 3
daemon/cluster/convert/secret.go

@@ -9,9 +9,7 @@ import (
 // SecretFromGRPC converts a grpc Secret to a Secret.
 func SecretFromGRPC(s *swarmapi.Secret) swarmtypes.Secret {
 	secret := swarmtypes.Secret{
-		ID:         s.ID,
-		Digest:     s.Digest,
-		SecretSize: s.SecretSize,
+		ID: s.ID,
 		Spec: swarmtypes.SecretSpec{
 			Annotations: swarmtypes.Annotations{
 				Name:   s.Spec.Annotations.Name,
@@ -39,3 +37,28 @@ func SecretSpecToGRPC(s swarmtypes.SecretSpec) swarmapi.SecretSpec {
 		Data: s.Data,
 	}
 }
+
+// SecretReferencesFromGRPC converts a slice of grpc SecretReference to SecretReference
+func SecretReferencesFromGRPC(s []*swarmapi.SecretReference) []*swarmtypes.SecretReference {
+	refs := []*swarmtypes.SecretReference{}
+
+	for _, r := range s {
+		ref := &swarmtypes.SecretReference{
+			SecretID:   r.SecretID,
+			SecretName: r.SecretName,
+		}
+
+		if t, ok := r.Target.(*swarmapi.SecretReference_File); ok {
+			ref.File = &swarmtypes.SecretReferenceFileTarget{
+				Name: t.File.Name,
+				UID:  t.File.UID,
+				GID:  t.File.GID,
+				Mode: t.File.Mode,
+			}
+		}
+
+		refs = append(refs, ref)
+	}
+
+	return refs
+}

+ 4 - 1
daemon/cluster/executor/backend.go

@@ -11,11 +11,13 @@ import (
 	"github.com/docker/docker/api/types/events"
 	"github.com/docker/docker/api/types/filters"
 	"github.com/docker/docker/api/types/network"
+	swarmtypes "github.com/docker/docker/api/types/swarm"
 	clustertypes "github.com/docker/docker/daemon/cluster/provider"
 	"github.com/docker/docker/reference"
 	"github.com/docker/libnetwork"
 	"github.com/docker/libnetwork/cluster"
 	networktypes "github.com/docker/libnetwork/types"
+	"github.com/docker/swarmkit/agent/exec"
 	"golang.org/x/net/context"
 )
 
@@ -38,7 +40,8 @@ type Backend interface {
 	ContainerWaitWithContext(ctx context.Context, name string) error
 	ContainerRm(name string, config *types.ContainerRmConfig) error
 	ContainerKill(name string, sig uint64) error
-	SetContainerSecrets(name string, secrets []*container.ContainerSecret) error
+	SetContainerSecretStore(name string, store exec.SecretGetter) error
+	SetContainerSecretReferences(name string, refs []*swarmtypes.SecretReference) error
 	SystemInfo() (*types.Info, error)
 	VolumeCreate(name, driverName string, opts, labels map[string]string) (*types.Volume, error)
 	Containers(config *types.ContainerListOptions) ([]*types.Container, error)

+ 11 - 25
daemon/cluster/executor/container/adapter.go

@@ -16,6 +16,7 @@ import (
 	containertypes "github.com/docker/docker/api/types/container"
 	"github.com/docker/docker/api/types/events"
 	"github.com/docker/docker/api/types/versions"
+	"github.com/docker/docker/daemon/cluster/convert"
 	executorpkg "github.com/docker/docker/daemon/cluster/executor"
 	"github.com/docker/docker/reference"
 	"github.com/docker/libnetwork"
@@ -237,33 +238,14 @@ func (c *containerAdapter) create(ctx context.Context) error {
 	if container == nil {
 		return fmt.Errorf("unable to get container from task spec")
 	}
-	secrets := make([]*containertypes.ContainerSecret, 0, len(container.Secrets))
-	for _, s := range container.Secrets {
-		sec := c.secrets.Get(s.SecretID)
-		if sec == nil {
-			logrus.Warnf("unable to get secret %s from provider", s.SecretID)
-			continue
-		}
-
-		name := sec.Spec.Annotations.Name
-		target := s.GetFile()
-		if target == nil {
-			logrus.Warnf("secret target was not a file: secret=%s", s.SecretID)
-			continue
-		}
 
-		secrets = append(secrets, &containertypes.ContainerSecret{
-			Name:   name,
-			Target: target.Name,
-			Data:   sec.Spec.Data,
-			UID:    target.UID,
-			GID:    target.GID,
-			Mode:   target.Mode,
-		})
+	// configure secrets
+	if err := c.backend.SetContainerSecretStore(cr.ID, c.secrets); err != nil {
+		return err
 	}
 
-	// configure secrets
-	if err := c.backend.SetContainerSecrets(cr.ID, secrets); err != nil {
+	refs := convert.SecretReferencesFromGRPC(container.Secrets)
+	if err := c.backend.SetContainerSecretReferences(cr.ID, refs); err != nil {
 		return err
 	}
 
@@ -437,7 +419,11 @@ func (c *containerAdapter) logs(ctx context.Context, options api.LogSubscription
 	}
 
 	chStarted := make(chan struct{})
-	go c.backend.ContainerLogs(ctx, c.container.name(), apiOptions, chStarted)
+	go func() {
+		defer writer.Close()
+		c.backend.ContainerLogs(ctx, c.container.name(), apiOptions, chStarted)
+	}()
+
 	return reader, nil
 }
 

+ 63 - 109
daemon/cluster/executor/container/container.go

@@ -14,6 +14,7 @@ import (
 	enginecontainer "github.com/docker/docker/api/types/container"
 	"github.com/docker/docker/api/types/events"
 	"github.com/docker/docker/api/types/filters"
+	enginemount "github.com/docker/docker/api/types/mount"
 	"github.com/docker/docker/api/types/network"
 	volumetypes "github.com/docker/docker/api/types/volume"
 	clustertypes "github.com/docker/docker/daemon/cluster/provider"
@@ -191,7 +192,6 @@ func (c *containerConfig) config() *enginecontainer.Config {
 		Hostname:     c.spec().Hostname,
 		WorkingDir:   c.spec().Dir,
 		Image:        c.image(),
-		Volumes:      c.volumes(),
 		ExposedPorts: c.exposedPorts(),
 		Healthcheck:  c.healthcheck(),
 	}
@@ -243,49 +243,79 @@ func (c *containerConfig) labels() map[string]string {
 	return labels
 }
 
-// volumes gets placed into the Volumes field on the containerConfig.
-func (c *containerConfig) volumes() map[string]struct{} {
-	r := make(map[string]struct{})
-	// Volumes *only* creates anonymous volumes. The rest is mixed in with
-	// binds, which aren't actually binds. Basically, any volume that
-	// results in a single component must be added here.
-	//
-	// This is reversed engineered from the behavior of the engine API.
+func (c *containerConfig) mounts() []enginemount.Mount {
+	var r []enginemount.Mount
 	for _, mount := range c.spec().Mounts {
-		if mount.Type == api.MountTypeVolume && mount.Source == "" {
-			r[mount.Target] = struct{}{}
-		}
+		r = append(r, convertMount(mount))
 	}
 	return r
 }
 
-func (c *containerConfig) tmpfs() map[string]string {
-	r := make(map[string]string)
-
-	for _, spec := range c.spec().Mounts {
-		if spec.Type != api.MountTypeTmpfs {
-			continue
-		}
+func convertMount(m api.Mount) enginemount.Mount {
+	mount := enginemount.Mount{
+		Source:   m.Source,
+		Target:   m.Target,
+		ReadOnly: m.ReadOnly,
+	}
 
-		r[spec.Target] = getMountMask(&spec)
+	switch m.Type {
+	case api.MountTypeBind:
+		mount.Type = enginemount.TypeBind
+	case api.MountTypeVolume:
+		mount.Type = enginemount.TypeVolume
+	case api.MountTypeTmpfs:
+		mount.Type = enginemount.TypeTmpfs
 	}
 
-	return r
-}
+	if m.BindOptions != nil {
+		mount.BindOptions = &enginemount.BindOptions{}
+		switch m.BindOptions.Propagation {
+		case api.MountPropagationRPrivate:
+			mount.BindOptions.Propagation = enginemount.PropagationRPrivate
+		case api.MountPropagationPrivate:
+			mount.BindOptions.Propagation = enginemount.PropagationPrivate
+		case api.MountPropagationRSlave:
+			mount.BindOptions.Propagation = enginemount.PropagationRSlave
+		case api.MountPropagationSlave:
+			mount.BindOptions.Propagation = enginemount.PropagationSlave
+		case api.MountPropagationRShared:
+			mount.BindOptions.Propagation = enginemount.PropagationRShared
+		case api.MountPropagationShared:
+			mount.BindOptions.Propagation = enginemount.PropagationShared
+		}
+	}
 
-func (c *containerConfig) binds() []string {
-	var r []string
-	for _, mount := range c.spec().Mounts {
-		if mount.Type == api.MountTypeBind || (mount.Type == api.MountTypeVolume && mount.Source != "") {
-			spec := fmt.Sprintf("%s:%s", mount.Source, mount.Target)
-			mask := getMountMask(&mount)
-			if mask != "" {
-				spec = fmt.Sprintf("%s:%s", spec, mask)
+	if m.VolumeOptions != nil {
+		mount.VolumeOptions = &enginemount.VolumeOptions{
+			NoCopy: m.VolumeOptions.NoCopy,
+		}
+		if m.VolumeOptions.Labels != nil {
+			mount.VolumeOptions.Labels = make(map[string]string, len(m.VolumeOptions.Labels))
+			for k, v := range m.VolumeOptions.Labels {
+				mount.VolumeOptions.Labels[k] = v
+			}
+		}
+		if m.VolumeOptions.DriverConfig != nil {
+			mount.VolumeOptions.DriverConfig = &enginemount.Driver{
+				Name: m.VolumeOptions.DriverConfig.Name,
+			}
+			if m.VolumeOptions.DriverConfig.Options != nil {
+				mount.VolumeOptions.DriverConfig.Options = make(map[string]string, len(m.VolumeOptions.DriverConfig.Options))
+				for k, v := range m.VolumeOptions.DriverConfig.Options {
+					mount.VolumeOptions.DriverConfig.Options[k] = v
+				}
 			}
-			r = append(r, spec)
 		}
 	}
-	return r
+
+	if m.TmpfsOptions != nil {
+		mount.TmpfsOptions = &enginemount.TmpfsOptions{
+			SizeBytes: m.TmpfsOptions.SizeBytes,
+			Mode:      m.TmpfsOptions.Mode,
+		}
+	}
+
+	return mount
 }
 
 func (c *containerConfig) healthcheck() *enginecontainer.HealthConfig {
@@ -303,88 +333,12 @@ func (c *containerConfig) healthcheck() *enginecontainer.HealthConfig {
 	}
 }
 
-func getMountMask(m *api.Mount) string {
-	var maskOpts []string
-	if m.ReadOnly {
-		maskOpts = append(maskOpts, "ro")
-	}
-
-	switch m.Type {
-	case api.MountTypeVolume:
-		if m.VolumeOptions != nil && m.VolumeOptions.NoCopy {
-			maskOpts = append(maskOpts, "nocopy")
-		}
-	case api.MountTypeBind:
-		if m.BindOptions == nil {
-			break
-		}
-
-		switch m.BindOptions.Propagation {
-		case api.MountPropagationPrivate:
-			maskOpts = append(maskOpts, "private")
-		case api.MountPropagationRPrivate:
-			maskOpts = append(maskOpts, "rprivate")
-		case api.MountPropagationShared:
-			maskOpts = append(maskOpts, "shared")
-		case api.MountPropagationRShared:
-			maskOpts = append(maskOpts, "rshared")
-		case api.MountPropagationSlave:
-			maskOpts = append(maskOpts, "slave")
-		case api.MountPropagationRSlave:
-			maskOpts = append(maskOpts, "rslave")
-		}
-	case api.MountTypeTmpfs:
-		if m.TmpfsOptions == nil {
-			break
-		}
-
-		if m.TmpfsOptions.Mode != 0 {
-			maskOpts = append(maskOpts, fmt.Sprintf("mode=%o", m.TmpfsOptions.Mode))
-		}
-
-		if m.TmpfsOptions.SizeBytes != 0 {
-			// calculate suffix here, making this linux specific, but that is
-			// okay, since API is that way anyways.
-
-			// we do this by finding the suffix that divides evenly into the
-			// value, returing the value itself, with no suffix, if it fails.
-			//
-			// For the most part, we don't enforce any semantic to this values.
-			// The operating system will usually align this and enforce minimum
-			// and maximums.
-			var (
-				size   = m.TmpfsOptions.SizeBytes
-				suffix string
-			)
-			for _, r := range []struct {
-				suffix  string
-				divisor int64
-			}{
-				{"g", 1 << 30},
-				{"m", 1 << 20},
-				{"k", 1 << 10},
-			} {
-				if size%r.divisor == 0 {
-					size = size / r.divisor
-					suffix = r.suffix
-					break
-				}
-			}
-
-			maskOpts = append(maskOpts, fmt.Sprintf("size=%d%s", size, suffix))
-		}
-	}
-
-	return strings.Join(maskOpts, ",")
-}
-
 func (c *containerConfig) hostConfig() *enginecontainer.HostConfig {
 	hc := &enginecontainer.HostConfig{
 		Resources:    c.resources(),
-		Binds:        c.binds(),
-		Tmpfs:        c.tmpfs(),
 		GroupAdd:     c.spec().Groups,
 		PortBindings: c.portBindings(),
+		Mounts:       c.mounts(),
 	}
 
 	if c.spec().DNSConfig != nil {

+ 1 - 1
daemon/config.go

@@ -185,7 +185,7 @@ func (config *Config) InstallCommonFlags(flags *pflag.FlagSet) {
 	flags.StringVar(&config.ClusterAdvertise, "cluster-advertise", "", "Address or interface name to advertise")
 	flags.StringVar(&config.ClusterStore, "cluster-store", "", "URL of the distributed storage backend")
 	flags.Var(opts.NewNamedMapOpts("cluster-store-opts", config.ClusterOpts, nil), "cluster-store-opt", "Set cluster store options")
-	flags.StringVar(&config.CorsHeaders, "api-cors-header", "", "Set CORS headers in the remote API")
+	flags.StringVar(&config.CorsHeaders, "api-cors-header", "", "Set CORS headers in the Engine API")
 	flags.IntVar(&maxConcurrentDownloads, "max-concurrent-downloads", defaultMaxConcurrentDownloads, "Set the max concurrent downloads for each pull")
 	flags.IntVar(&maxConcurrentUploads, "max-concurrent-uploads", defaultMaxConcurrentUploads, "Set the max concurrent uploads for each push")
 	flags.IntVar(&config.ShutdownTimeout, "shutdown-timeout", defaultShutdownTimeout, "Set the default shutdown timeout")

+ 1 - 1
daemon/config_unix.go

@@ -77,7 +77,7 @@ func (config *Config) InstallFlags(flags *pflag.FlagSet) {
 	flags.StringVar(&config.bridgeConfig.FixedCIDRv6, "fixed-cidr-v6", "", "IPv6 subnet for fixed IPs")
 	flags.BoolVar(&config.bridgeConfig.EnableUserlandProxy, "userland-proxy", true, "Use userland proxy for loopback traffic")
 	flags.StringVar(&config.bridgeConfig.UserlandProxyPath, "userland-proxy-path", "", "Path to the userland proxy binary")
-	flags.BoolVar(&config.EnableCors, "api-enable-cors", false, "Enable CORS headers in the remote API, this is deprecated by --api-cors-header")
+	flags.BoolVar(&config.EnableCors, "api-enable-cors", false, "Enable CORS headers in the Engine API, this is deprecated by --api-cors-header")
 	flags.MarkDeprecated("api-enable-cors", "Please use --api-cors-header")
 	flags.StringVar(&config.CgroupParent, "cgroup-parent", "", "Set parent cgroup for all containers")
 	flags.StringVar(&config.RemappedRoot, "userns-remap", "", "User/Group setting for user namespaces")

+ 20 - 87
daemon/container_operations_unix.go

@@ -8,13 +8,11 @@ import (
 	"os"
 	"path/filepath"
 	"strconv"
-	"strings"
 	"syscall"
 	"time"
 
 	"github.com/Sirupsen/logrus"
 	"github.com/cloudflare/cfssl/log"
-	containertypes "github.com/docker/docker/api/types/container"
 	"github.com/docker/docker/container"
 	"github.com/docker/docker/daemon/links"
 	"github.com/docker/docker/pkg/idtools"
@@ -22,16 +20,10 @@ import (
 	"github.com/docker/docker/pkg/stringid"
 	"github.com/docker/docker/runconfig"
 	"github.com/docker/libnetwork"
-	"github.com/opencontainers/runc/libcontainer/configs"
-	"github.com/opencontainers/runc/libcontainer/devices"
 	"github.com/opencontainers/runc/libcontainer/label"
-	"github.com/opencontainers/runtime-spec/specs-go"
 	"github.com/pkg/errors"
 )
 
-func u32Ptr(i int64) *uint32     { u := uint32(i); return &u }
-func fmPtr(i int64) *os.FileMode { fm := os.FileMode(i); return &fm }
-
 func (daemon *Daemon) setupLinkedContainers(container *container.Container) ([]string, error) {
 	var env []string
 	children := daemon.children(container)
@@ -145,7 +137,7 @@ func (daemon *Daemon) setupIpcDirs(c *container.Container) error {
 }
 
 func (daemon *Daemon) setupSecretDir(c *container.Container) (setupErr error) {
-	if len(c.Secrets) == 0 {
+	if len(c.SecretReferences) == 0 {
 		return nil
 	}
 
@@ -174,8 +166,17 @@ func (daemon *Daemon) setupSecretDir(c *container.Container) (setupErr error) {
 		return errors.Wrap(err, "unable to setup secret mount")
 	}
 
-	for _, s := range c.Secrets {
-		targetPath := filepath.Clean(s.Target)
+	for _, s := range c.SecretReferences {
+		if c.SecretStore == nil {
+			return fmt.Errorf("secret store is not initialized")
+		}
+
+		// TODO (ehazlett): use type switch when more are supported
+		if s.File == nil {
+			return fmt.Errorf("secret target type is not a file target")
+		}
+
+		targetPath := filepath.Clean(s.File.Name)
 		// ensure that the target is a filename only; no paths allowed
 		if targetPath != filepath.Base(targetPath) {
 			return fmt.Errorf("error creating secret: secret must not be a path")
@@ -187,18 +188,22 @@ func (daemon *Daemon) setupSecretDir(c *container.Container) (setupErr error) {
 		}
 
 		logrus.WithFields(logrus.Fields{
-			"name": s.Name,
+			"name": s.File.Name,
 			"path": fPath,
 		}).Debug("injecting secret")
-		if err := ioutil.WriteFile(fPath, s.Data, s.Mode); err != nil {
+		secret := c.SecretStore.Get(s.SecretID)
+		if secret == nil {
+			return fmt.Errorf("unable to get secret from secret store")
+		}
+		if err := ioutil.WriteFile(fPath, secret.Spec.Data, s.File.Mode); err != nil {
 			return errors.Wrap(err, "error injecting secret")
 		}
 
-		uid, err := strconv.Atoi(s.UID)
+		uid, err := strconv.Atoi(s.File.UID)
 		if err != nil {
 			return err
 		}
-		gid, err := strconv.Atoi(s.GID)
+		gid, err := strconv.Atoi(s.File.GID)
 		if err != nil {
 			return err
 		}
@@ -234,78 +239,6 @@ func killProcessDirectly(container *container.Container) error {
 	return nil
 }
 
-func specDevice(d *configs.Device) specs.Device {
-	return specs.Device{
-		Type:     string(d.Type),
-		Path:     d.Path,
-		Major:    d.Major,
-		Minor:    d.Minor,
-		FileMode: fmPtr(int64(d.FileMode)),
-		UID:      u32Ptr(int64(d.Uid)),
-		GID:      u32Ptr(int64(d.Gid)),
-	}
-}
-
-func specDeviceCgroup(d *configs.Device) specs.DeviceCgroup {
-	t := string(d.Type)
-	return specs.DeviceCgroup{
-		Allow:  true,
-		Type:   &t,
-		Major:  &d.Major,
-		Minor:  &d.Minor,
-		Access: &d.Permissions,
-	}
-}
-
-func getDevicesFromPath(deviceMapping containertypes.DeviceMapping) (devs []specs.Device, devPermissions []specs.DeviceCgroup, err error) {
-	resolvedPathOnHost := deviceMapping.PathOnHost
-
-	// check if it is a symbolic link
-	if src, e := os.Lstat(deviceMapping.PathOnHost); e == nil && src.Mode()&os.ModeSymlink == os.ModeSymlink {
-		if linkedPathOnHost, e := filepath.EvalSymlinks(deviceMapping.PathOnHost); e == nil {
-			resolvedPathOnHost = linkedPathOnHost
-		}
-	}
-
-	device, err := devices.DeviceFromPath(resolvedPathOnHost, deviceMapping.CgroupPermissions)
-	// if there was no error, return the device
-	if err == nil {
-		device.Path = deviceMapping.PathInContainer
-		return append(devs, specDevice(device)), append(devPermissions, specDeviceCgroup(device)), nil
-	}
-
-	// if the device is not a device node
-	// try to see if it's a directory holding many devices
-	if err == devices.ErrNotADevice {
-
-		// check if it is a directory
-		if src, e := os.Stat(resolvedPathOnHost); e == nil && src.IsDir() {
-
-			// mount the internal devices recursively
-			filepath.Walk(resolvedPathOnHost, func(dpath string, f os.FileInfo, e error) error {
-				childDevice, e := devices.DeviceFromPath(dpath, deviceMapping.CgroupPermissions)
-				if e != nil {
-					// ignore the device
-					return nil
-				}
-
-				// add the device to userSpecified devices
-				childDevice.Path = strings.Replace(dpath, resolvedPathOnHost, deviceMapping.PathInContainer, 1)
-				devs = append(devs, specDevice(childDevice))
-				devPermissions = append(devPermissions, specDeviceCgroup(childDevice))
-
-				return nil
-			})
-		}
-	}
-
-	if len(devs) > 0 {
-		return devs, devPermissions, nil
-	}
-
-	return devs, devPermissions, fmt.Errorf("error gathering device information while adding custom device %q: %s", deviceMapping.PathOnHost, err)
-}
-
 func detachMounted(path string) error {
 	return syscall.Unmount(path, syscall.MNT_DETACH)
 }

+ 1 - 1
daemon/create.go

@@ -221,7 +221,7 @@ func (daemon *Daemon) setRWLayer(container *container.Container) error {
 }
 
 // VolumeCreate creates a volume with the specified name, driver, and opts
-// This is called directly from the remote API
+// This is called directly from the Engine API
 func (daemon *Daemon) VolumeCreate(name, driverName string, opts, labels map[string]string) (*types.Volume, error) {
 	if name == "" {
 		name = stringid.GenerateNonCryptoID()

+ 6 - 0
daemon/daemon_windows.go

@@ -24,6 +24,7 @@ import (
 	"github.com/docker/libnetwork/netlabel"
 	"github.com/docker/libnetwork/options"
 	blkiodev "github.com/opencontainers/runc/libcontainer/configs"
+	"golang.org/x/sys/windows"
 )
 
 const (
@@ -230,6 +231,11 @@ func checkSystem() error {
 	if osv.Build < 14393 {
 		return fmt.Errorf("The docker daemon requires build 14393 or later of Windows Server 2016 or Windows 10")
 	}
+
+	vmcompute := windows.NewLazySystemDLL("vmcompute.dll")
+	if vmcompute.Load() != nil {
+		return fmt.Errorf("Failed to load vmcompute.dll. Ensure that the Containers role is installed.")
+	}
 	return nil
 }
 

+ 1 - 1
daemon/delete.go

@@ -140,7 +140,7 @@ func (daemon *Daemon) cleanupContainer(container *container.Container, forceRemo
 
 // VolumeRm removes the volume with the given name.
 // If the volume is referenced by a container it is not removed
-// This is called directly from the remote API
+// This is called directly from the Engine API
 func (daemon *Daemon) VolumeRm(name string, force bool) error {
 	err := daemon.volumeRm(name)
 	if err == nil || force {

+ 1 - 1
daemon/exec.go

@@ -27,7 +27,7 @@ const termProcessTimeout = 10
 func (d *Daemon) registerExecCommand(container *container.Container, config *exec.Config) {
 	// Storing execs in container in order to kill them gracefully whenever the container is stopped or removed.
 	container.ExecCommands.Add(config.ID, config)
-	// Storing execs in daemon for easy access via remote API.
+	// Storing execs in daemon for easy access via Engine API.
 	d.execCommands.Add(config.ID, config)
 }
 

+ 9 - 15
daemon/info.go

@@ -1,6 +1,7 @@
 package daemon
 
 import (
+	"fmt"
 	"os"
 	"runtime"
 	"sync/atomic"
@@ -69,29 +70,26 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
 		}
 	})
 
-	securityOptions := []types.SecurityOpt{}
+	securityOptions := []string{}
 	if sysInfo.AppArmor {
-		securityOptions = append(securityOptions, types.SecurityOpt{Key: "Name", Value: "apparmor"})
+		securityOptions = append(securityOptions, "name=apparmor")
 	}
 	if sysInfo.Seccomp && supportsSeccomp {
 		profile := daemon.seccompProfilePath
 		if profile == "" {
 			profile = "default"
 		}
-		securityOptions = append(securityOptions,
-			types.SecurityOpt{Key: "Name", Value: "seccomp"},
-			types.SecurityOpt{Key: "Profile", Value: profile},
-		)
+		securityOptions = append(securityOptions, fmt.Sprintf("name=seccomp,profile=%s", profile))
 	}
 	if selinuxEnabled() {
-		securityOptions = append(securityOptions, types.SecurityOpt{Key: "Name", Value: "selinux"})
+		securityOptions = append(securityOptions, "name=selinux")
 	}
 	uid, gid := daemon.GetRemappedUIDGID()
 	if uid != 0 || gid != 0 {
-		securityOptions = append(securityOptions, types.SecurityOpt{Key: "Name", Value: "userns"})
+		securityOptions = append(securityOptions, "name=userns")
 	}
 
-	v := &types.InfoBase{
+	v := &types.Info{
 		ID:                 daemon.ID,
 		Containers:         int(cRunning + cPaused + cStopped),
 		ContainersRunning:  int(cRunning),
@@ -129,6 +127,7 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
 		HTTPSProxy:         sockets.GetProxyEnv("https_proxy"),
 		NoProxy:            sockets.GetProxyEnv("no_proxy"),
 		LiveRestoreEnabled: daemon.configStore.LiveRestoreEnabled,
+		SecurityOptions:    securityOptions,
 		Isolation:          daemon.defaultIsolation,
 	}
 
@@ -143,12 +142,7 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
 	}
 	v.Name = hostname
 
-	i := &types.Info{
-		InfoBase:        v,
-		SecurityOptions: securityOptions,
-	}
-
-	return i, nil
+	return v, nil
 }
 
 // SystemVersion returns version information about the daemon.

+ 1 - 1
daemon/info_unix.go

@@ -14,7 +14,7 @@ import (
 )
 
 // FillPlatformInfo fills the platform related info.
-func (daemon *Daemon) FillPlatformInfo(v *types.InfoBase, sysInfo *sysinfo.SysInfo) {
+func (daemon *Daemon) FillPlatformInfo(v *types.Info, sysInfo *sysinfo.SysInfo) {
 	v.MemoryLimit = sysInfo.MemoryLimit
 	v.SwapLimit = sysInfo.SwapLimit
 	v.KernelMemory = sysInfo.KernelMemory

+ 1 - 1
daemon/info_windows.go

@@ -6,5 +6,5 @@ import (
 )
 
 // FillPlatformInfo fills the platform related info.
-func (daemon *Daemon) FillPlatformInfo(v *types.InfoBase, sysInfo *sysinfo.SysInfo) {
+func (daemon *Daemon) FillPlatformInfo(v *types.Info, sysInfo *sysinfo.SysInfo) {
 }

+ 5 - 17
daemon/oci_linux.go

@@ -88,7 +88,7 @@ func setDevices(s *specs.Spec, c *container.Container) error {
 			return err
 		}
 		for _, d := range hostDevices {
-			devs = append(devs, specDevice(d))
+			devs = append(devs, oci.Device(d))
 		}
 		rwm := "rwm"
 		devPermissions = []specs.DeviceCgroup{
@@ -99,7 +99,7 @@ func setDevices(s *specs.Spec, c *container.Container) error {
 		}
 	} else {
 		for _, deviceMapping := range c.HostConfig.Devices {
-			d, dPermissions, err := getDevicesFromPath(deviceMapping)
+			d, dPermissions, err := oci.DevicesFromPath(deviceMapping.PathOnHost, deviceMapping.PathInContainer, deviceMapping.CgroupPermissions)
 			if err != nil {
 				return err
 			}
@@ -221,18 +221,6 @@ func setCapabilities(s *specs.Spec, c *container.Container) error {
 	return nil
 }
 
-func delNamespace(s *specs.Spec, nsType specs.NamespaceType) {
-	idx := -1
-	for i, n := range s.Linux.Namespaces {
-		if n.Type == nsType {
-			idx = i
-		}
-	}
-	if idx >= 0 {
-		s.Linux.Namespaces = append(s.Linux.Namespaces[:idx], s.Linux.Namespaces[idx+1:]...)
-	}
-}
-
 func setNamespaces(daemon *Daemon, s *specs.Spec, c *container.Container) error {
 	userNS := false
 	// user
@@ -283,7 +271,7 @@ func setNamespaces(daemon *Daemon, s *specs.Spec, c *container.Container) error
 			setNamespace(s, nsUser)
 		}
 	} else if c.HostConfig.IpcMode.IsHost() {
-		delNamespace(s, specs.NamespaceType("ipc"))
+		oci.RemoveNamespace(s, specs.NamespaceType("ipc"))
 	} else {
 		ns := specs.Namespace{Type: "ipc"}
 		setNamespace(s, ns)
@@ -304,14 +292,14 @@ func setNamespaces(daemon *Daemon, s *specs.Spec, c *container.Container) error
 			setNamespace(s, nsUser)
 		}
 	} else if c.HostConfig.PidMode.IsHost() {
-		delNamespace(s, specs.NamespaceType("pid"))
+		oci.RemoveNamespace(s, specs.NamespaceType("pid"))
 	} else {
 		ns := specs.Namespace{Type: "pid"}
 		setNamespace(s, ns)
 	}
 	// uts
 	if c.HostConfig.UTSMode.IsHost() {
-		delNamespace(s, specs.NamespaceType("uts"))
+		oci.RemoveNamespace(s, specs.NamespaceType("uts"))
 		s.Hostname = ""
 	}
 

+ 18 - 5
daemon/secrets.go

@@ -2,12 +2,25 @@ package daemon
 
 import (
 	"github.com/Sirupsen/logrus"
-	containertypes "github.com/docker/docker/api/types/container"
+	swarmtypes "github.com/docker/docker/api/types/swarm"
+	"github.com/docker/swarmkit/agent/exec"
 )
 
-// SetContainerSecrets sets the container secrets needed
-func (daemon *Daemon) SetContainerSecrets(name string, secrets []*containertypes.ContainerSecret) error {
-	if !secretsSupported() && len(secrets) > 0 {
+// SetContainerSecretStore sets the secret store backend for the container
+func (daemon *Daemon) SetContainerSecretStore(name string, store exec.SecretGetter) error {
+	c, err := daemon.GetContainer(name)
+	if err != nil {
+		return err
+	}
+
+	c.SecretStore = store
+
+	return nil
+}
+
+// SetContainerSecretReferences sets the container secret references needed
+func (daemon *Daemon) SetContainerSecretReferences(name string, refs []*swarmtypes.SecretReference) error {
+	if !secretsSupported() && len(refs) > 0 {
 		logrus.Warn("secrets are not supported on this platform")
 		return nil
 	}
@@ -17,7 +30,7 @@ func (daemon *Daemon) SetContainerSecrets(name string, secrets []*containertypes
 		return err
 	}
 
-	c.Secrets = secrets
+	c.SecretReferences = refs
 
 	return nil
 }

+ 3 - 3
daemon/stats.go

@@ -23,7 +23,7 @@ func (daemon *Daemon) ContainerStats(ctx context.Context, prefixOrName string, c
 	if runtime.GOOS == "solaris" {
 		return fmt.Errorf("%+v does not support stats", runtime.GOOS)
 	}
-	// Remote API version (used for backwards compatibility)
+	// Engine API version (used for backwards compatibility)
 	apiVersion := config.Version
 
 	container, err := daemon.GetContainer(prefixOrName)
@@ -31,8 +31,8 @@ func (daemon *Daemon) ContainerStats(ctx context.Context, prefixOrName string, c
 		return err
 	}
 
-	// If the container is not running and requires no stream, return an empty stats.
-	if !container.IsRunning() && !config.Stream {
+	// If the container is either not running or restarting and requires no stream, return an empty stats.
+	if (!container.IsRunning() || container.IsRestarting()) && !config.Stream {
 		return json.NewEncoder(config.OutStream).Encode(&types.Stats{})
 	}
 

+ 1 - 1
daemon/volumes.go

@@ -26,7 +26,7 @@ var (
 
 type mounts []container.Mount
 
-// volumeToAPIType converts a volume.Volume to the type used by the remote API
+// volumeToAPIType converts a volume.Volume to the type used by the Engine API
 func volumeToAPIType(v volume.Volume) *types.Volume {
 	tv := &types.Volume{
 		Name:   v.Name(),

+ 1 - 0
daemon/volumes_unix.go

@@ -140,6 +140,7 @@ func (daemon *Daemon) verifyVolumesInfo(container *container.Container) error {
 	if err != nil {
 		return errors.Wrap(err, "could not open container config")
 	}
+	defer f.Close()
 	var cv volumes
 	if err := json.NewDecoder(f).Decode(&cv); err != nil {
 		return errors.Wrap(err, "could not decode container config")

+ 6 - 4
docs/reference/api/docker_remote_api_v1.18.md → docs/api/v1.18.md

@@ -1,7 +1,10 @@
 ---
-title: "Remote API v1.18"
+title: "Engine API v1.18"
 description: "API Documentation for Docker"
 keywords: "API, Docker, rcli, REST, documentation"
+redirect_from:
+- /engine/reference/api/docker_remote_api_v1.18/
+- /reference/api/docker_remote_api_v1.18/
 ---
 
 <!-- This file is maintained within the docker/docker Github
@@ -13,11 +16,10 @@ keywords: "API, Docker, rcli, REST, documentation"
      will be rejected.
 -->
 
-# Docker Remote API v1.18
+# Docker Engine API v1.18
 
 # 1. Brief introduction
 
- - The Remote API has replaced `rcli`.
  - The daemon listens on `unix:///var/run/docker.sock` but you can
    [Bind Docker to another host/port or a Unix socket](../commandline/dockerd.md#bind-docker-to-another-host-port-or-a-unix-socket).
  - The API tends to be REST, but for some complex commands, like `attach`
@@ -2148,7 +2150,7 @@ This might change in the future.
 
 ## 3.3 CORS Requests
 
-To set cross origin requests to the remote api please give values to
+To set cross origin requests to the Engine API please give values to
 `--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all,
 default or blank means CORS disabled
 

+ 6 - 4
docs/reference/api/docker_remote_api_v1.19.md → docs/api/v1.19.md

@@ -1,7 +1,10 @@
 ---
-title: "Remote API v1.19"
+title: "Engine API v1.19"
 description: "API Documentation for Docker"
 keywords: "API, Docker, rcli, REST, documentation"
+redirect_from:
+- /engine/reference/api/docker_remote_api_v1.19/
+- /reference/api/docker_remote_api_v1.19/
 ---
 
 <!-- This file is maintained within the docker/docker Github
@@ -13,11 +16,10 @@ keywords: "API, Docker, rcli, REST, documentation"
      will be rejected.
 -->
 
-# Docker Remote API v1.19
+# Docker Engine API v1.19
 
 ## 1. Brief introduction
 
- - The Remote API has replaced `rcli`.
  - The daemon listens on `unix:///var/run/docker.sock` but you can
    [Bind Docker to another host/port or a Unix socket](../commandline/dockerd.md#bind-docker-to-another-host-port-or-a-unix-socket).
  - The API tends to be REST. However, for some complex commands, like `attach`
@@ -2230,7 +2232,7 @@ from **200 OK** to **101 UPGRADED** and resends the same headers.
 
 ## 3.3 CORS Requests
 
-To set cross origin requests to the remote api please give values to
+To set cross origin requests to the Engine API please give values to
 `--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all,
 default or blank means CORS disabled
 

+ 6 - 4
docs/reference/api/docker_remote_api_v1.20.md → docs/api/v1.20.md

@@ -1,7 +1,10 @@
 ---
-title: "Remote API v1.20"
+title: "Engine API v1.20"
 description: "API Documentation for Docker"
 keywords: "API, Docker, rcli, REST, documentation"
+redirect_from:
+- /engine/reference/api/docker_remote_api_v1.20/
+- /reference/api/docker_remote_api_v1.20/
 ---
 
 <!-- This file is maintained within the docker/docker Github
@@ -13,11 +16,10 @@ keywords: "API, Docker, rcli, REST, documentation"
      will be rejected.
 -->
 
-# Docker Remote API v1.20
+# Docker Engine API v1.20
 
 # 1. Brief introduction
 
- - The Remote API has replaced `rcli`.
  - The daemon listens on `unix:///var/run/docker.sock` but you can
    [Bind Docker to another host/port or a Unix socket](../commandline/dockerd.md#bind-docker-to-another-host-port-or-a-unix-socket).
  - The API tends to be REST. However, for some complex commands, like `attach`
@@ -2383,7 +2385,7 @@ from **200 OK** to **101 UPGRADED** and resends the same headers.
 
 ## 3.3 CORS Requests
 
-To set cross origin requests to the remote api please give values to
+To set cross origin requests to the Engine API please give values to
 `--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all,
 default or blank means CORS disabled
 

+ 6 - 4
docs/reference/api/docker_remote_api_v1.21.md → docs/api/v1.21.md

@@ -1,7 +1,10 @@
 ---
-title: "Remote API v1.21"
+title: "Engine API v1.21"
 description: "API Documentation for Docker"
 keywords: "API, Docker, rcli, REST, documentation"
+redirect_from:
+- /engine/reference/api/docker_remote_api_v1.21/
+- /reference/api/docker_remote_api_v1.21/
 ---
 
 <!-- This file is maintained within the docker/docker Github
@@ -13,11 +16,10 @@ keywords: "API, Docker, rcli, REST, documentation"
      will be rejected.
 -->
 
-# Docker Remote API v1.21
+# Docker Engine API v1.21
 
 ## 1. Brief introduction
 
- - The Remote API has replaced `rcli`.
  - The daemon listens on `unix:///var/run/docker.sock` but you can
    [Bind Docker to another host/port or a Unix socket](../commandline/dockerd.md#bind-docker-to-another-host-port-or-a-unix-socket).
  - The API tends to be REST. However, for some complex commands, like `attach`
@@ -2961,7 +2963,7 @@ from **200 OK** to **101 UPGRADED** and resends the same headers.
 
 ## 3.3 CORS Requests
 
-To set cross origin requests to the remote api please give values to
+To set cross origin requests to the Engine API please give values to
 `--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all,
 default or blank means CORS disabled
 

+ 6 - 4
docs/reference/api/docker_remote_api_v1.22.md → docs/api/v1.22.md

@@ -1,7 +1,10 @@
 ---
-title: "Remote API v1.22"
+title: "Engine API v1.22"
 description: "API Documentation for Docker"
 keywords: "API, Docker, rcli, REST, documentation"
+redirect_from:
+- /engine/reference/api/docker_remote_api_v1.22/
+- /reference/api/docker_remote_api_v1.22/
 ---
 
 <!-- This file is maintained within the docker/docker Github
@@ -13,11 +16,10 @@ keywords: "API, Docker, rcli, REST, documentation"
      will be rejected.
 -->
 
-# Docker Remote API v1.22
+# Docker Engine API v1.22
 
 # 1. Brief introduction
 
- - The Remote API has replaced `rcli`.
  - The daemon listens on `unix:///var/run/docker.sock` but you can
    [Bind Docker to another host/port or a Unix socket](../commandline/dockerd.md#bind-docker-to-another-host-port-or-a-unix-socket).
  - The API tends to be REST. However, for some complex commands, like `attach`
@@ -3299,7 +3301,7 @@ from **200 OK** to **101 UPGRADED** and resends the same headers.
 
 ## 3.3 CORS Requests
 
-To set cross origin requests to the remote api please give values to
+To set cross origin requests to the Engine API please give values to
 `--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all,
 default or blank means CORS disabled
 

+ 6 - 4
docs/reference/api/docker_remote_api_v1.23.md → docs/api/v1.23.md

@@ -1,7 +1,10 @@
 ---
-title: "Remote API v1.23"
+title: "Engine API v1.23"
 description: "API Documentation for Docker"
 keywords: "API, Docker, rcli, REST, documentation"
+redirect_from:
+- /engine/reference/api/docker_remote_api_v1.23/
+- /reference/api/docker_remote_api_v1.23/
 ---
 
 <!-- This file is maintained within the docker/docker Github
@@ -13,11 +16,10 @@ keywords: "API, Docker, rcli, REST, documentation"
      will be rejected.
 -->
 
-# Docker Remote API v1.23
+# Docker Engine API v1.23
 
 ## 1. Brief introduction
 
- - The Remote API has replaced `rcli`.
  - The daemon listens on `unix:///var/run/docker.sock` but you can
    [Bind Docker to another host/port or a Unix socket](../commandline/dockerd.md#bind-docker-to-another-host-port-or-a-unix-socket).
  - The API tends to be REST. However, for some complex commands, like `attach`
@@ -3416,7 +3418,7 @@ from **200 OK** to **101 UPGRADED** and resends the same headers.
 
 ## 3.3 CORS Requests
 
-To set cross origin requests to the remote api please give values to
+To set cross origin requests to the Engine API please give values to
 `--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all,
 default or blank means CORS disabled
 

+ 7 - 5
docs/reference/api/docker_remote_api_v1.24.md → docs/api/v1.24.md

@@ -1,7 +1,10 @@
 ---
-title: "Remote API v1.24"
+title: "Engine API v1.24"
 description: "API Documentation for Docker"
 keywords: "API, Docker, rcli, REST, documentation"
+redirect_from:
+- /engine/reference/api/docker_remote_api_v1.24/
+- /reference/api/docker_remote_api_v1.24/
 ---
 
 <!-- This file is maintained within the docker/docker Github
@@ -13,11 +16,10 @@ keywords: "API, Docker, rcli, REST, documentation"
      will be rejected.
 -->
 
-# Docker Remote API v1.24
+# Docker Engine API v1.24
 
 # 1. Brief introduction
 
- - The Remote API has replaced `rcli`.
  - The daemon listens on `unix:///var/run/docker.sock` but you can
    [Bind Docker to another host/port or a Unix socket](../commandline/dockerd.md#bind-docker-to-another-host-port-or-a-unix-socket).
  - The API tends to be REST. However, for some complex commands, like `attach`
@@ -26,7 +28,7 @@ keywords: "API, Docker, rcli, REST, documentation"
 
 # 2. Errors
 
-The Remote API uses standard HTTP status codes to indicate the success or failure of the API call. The body of the response will be JSON in the following format:
+The Engine API uses standard HTTP status codes to indicate the success or failure of the API call. The body of the response will be JSON in the following format:
 
     {
         "message": "page not found"
@@ -5274,7 +5276,7 @@ from **200 OK** to **101 UPGRADED** and resends the same headers.
 
 ## 4.3 CORS Requests
 
-To set cross origin requests to the remote api please give values to
+To set cross origin requests to the Engine API please give values to
 `--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all,
 default or blank means CORS disabled
 

+ 18 - 142
docs/reference/api/docker_remote_api.md → docs/api/version-history.md

@@ -1,6 +1,6 @@
 ---
-title: "Remote API"
-description: "API Documentation for Docker"
+title: "Engine API version history"
+description: "Documentation of changes that have been made to Engine API."
 keywords: "API, Docker, rcli, REST, documentation"
 ---
 
@@ -13,133 +13,9 @@ keywords: "API, Docker, rcli, REST, documentation"
      will be rejected.
 -->
 
-# Docker Remote API
+## v1.25 API changes
 
-Docker's Remote API uses an open schema model.  In this model, unknown
-properties in incoming messages are ignored. Client applications need to take
-this behavior into account to ensure they do not break when talking to newer
-Docker daemons.
-
-The API tends to be REST, but for some complex commands, like attach or pull,
-the HTTP connection is hijacked to transport STDOUT, STDIN, and STDERR.
-
-By default the Docker daemon listens on `unix:///var/run/docker.sock` and the
-client must have `root` access to interact with the daemon. If a group named
-`docker` exists on your system, `docker` applies ownership of the socket to the
-group.
-
-To connect to the Docker daemon with cURL you need to use cURL 7.40 or
-later, as these versions have the `--unix-socket` flag available. To
-run `curl` against the daemon on the default socket, use the
-following:
-
-When using cUrl 7.50 or later:
-
-```console
-$ curl --unix-socket /var/run/docker.sock http://localhost/v1.25/containers/json
-```
-
-When using cURL 7.40, `localhost` must be omitted:
-
-```console
-$ curl --unix-socket /var/run/docker.sock http://v1.25/containers/json
-```
-
-If you have bound the Docker daemon to a different socket path or TCP
-port, you would reference that in your cURL rather than the
-default.
-
-## Versioning
-
-It is required to to supply a version to API calls. This is done by prefixing
-the URL with the version number.
-
-The current version of the API is 1.25, so to call the `/info` endpoint, you
-would send a request to the URL `/v1.25/info`. To call, for example, version
-1.24 of the API instead, you would request `/v1.24/info`.
-
-If a newer daemon is installed, new properties may be returned even when
-calling older versions of the API.
-
-In previous versions of Docker, it was possible to access the API without
-providing a version. This behaviour is now deprecated will be removed in a
-future version of Docker.
-
-Use the table below to find the API version for a Docker version:
-
-Docker version  | API version                        | Changes
-----------------|------------------------------------|------------------------------------------------------
-1.13.x          | [1.25](docker_remote_api_v1.25.md) | [API changes](docker_remote_api.md#v1-25-api-changes)
-1.12.x          | [1.24](docker_remote_api_v1.24.md) | [API changes](docker_remote_api.md#v1-24-api-changes)
-1.11.x          | [1.23](docker_remote_api_v1.23.md) | [API changes](docker_remote_api.md#v1-23-api-changes)
-1.10.x          | [1.22](docker_remote_api_v1.22.md) | [API changes](docker_remote_api.md#v1-22-api-changes)
-1.9.x           | [1.21](docker_remote_api_v1.21.md) | [API changes](docker_remote_api.md#v1-21-api-changes)
-1.8.x           | [1.20](docker_remote_api_v1.20.md) | [API changes](docker_remote_api.md#v1-20-api-changes)
-1.7.x           | [1.19](docker_remote_api_v1.19.md) | [API changes](docker_remote_api.md#v1-19-api-changes)
-1.6.x           | [1.18](docker_remote_api_v1.18.md) | [API changes](docker_remote_api.md#v1-18-api-changes)
-
-Refer to the [GitHub repository](
-https://github.com/docker/docker/tree/master/docs/reference/api) for
-older releases.
-
-## Authentication
-
-Authentication configuration is handled client side, so the
-client has to send the `authConfig` as a `POST` in `/images/(name)/push`. The
-`authConfig`, set as the `X-Registry-Auth` header, is currently a Base64 encoded
-(JSON) string with the following structure:
-
-```JSON
-{"username": "string", "password": "string", "email": "string",
-   "serveraddress" : "string", "auth": ""}
-```
-
-Callers should leave the `auth` empty. The `serveraddress` is a domain/ip
-without protocol. Throughout this structure, double quotes are required.
-
-## Using Docker Machine with the API
-
-If you are using `docker-machine`, the Docker daemon is on a host that
-uses an encrypted TCP socket using TLS. This means, for Docker Machine users,
-you need to add extra parameters to `curl` or `wget` when making test
-API requests, for example:
-
-```
-curl --insecure \
-     --cert $DOCKER_CERT_PATH/cert.pem \
-     --key $DOCKER_CERT_PATH/key.pem \
-     https://YOUR_VM_IP:2376/v1.25/images/json
-
-wget --no-check-certificate --certificate=$DOCKER_CERT_PATH/cert.pem \
-     --private-key=$DOCKER_CERT_PATH/key.pem \
-     https://YOUR_VM_IP:2376/v1.25/images/json -O - -q
-```
-
-## Docker Events
-
-The following diagram depicts the container states accessible through the API.
-
-![States](images/event_state.png)
-
-Some container-related events are not affected by container state, so they are not included in this diagram. These events are:
-
-* **export** emitted by `docker export`
-* **exec_create** emitted by `docker exec`
-* **exec_start** emitted by `docker exec` after **exec_create**
-* **detach** emitted when client is detached from container process
-* **exec_detach** emitted when client is detached from exec process
-
-Running `docker rmi` emits an **untag** event when removing an image name.  The `rmi` command may also emit **delete** events when images are deleted by ID directly or by deleting the last tag referring to the image.
-
-> **Acknowledgment**: This diagram and the accompanying text were used with the permission of Matt Good and Gilder Labs. See Matt's original blog post [Docker Events Explained](https://gliderlabs.com/blog/2015/04/14/docker-events-explained/).
-
-## Version history
-
-This section lists each version from latest to oldest.  Each listing includes a link to the full documentation set and the changes relevant in that release.
-
-### v1.25 API changes
-
-[Docker Remote API v1.25](docker_remote_api_v1.25.md) documentation
+[Docker Engine API v1.25](v1.25.md) documentation
 
 * The API version is now required in all API calls. Instead of just requesting, for example, the URL `/containers/json`, you must now request `/v1.25/containers/json`.
 * `GET /version` now returns `MinAPIVersion`.
@@ -198,9 +74,9 @@ This section lists each version from latest to oldest.  Each listing includes a
 * `GET /images/json` now support a `reference` filter.
 
 
-### v1.24 API changes
+## v1.24 API changes
 
-[Docker Remote API v1.24](docker_remote_api_v1.24.md) documentation
+[Docker Engine API v1.24](v1.24.md) documentation
 
 * `POST /containers/create` now takes `StorageOpt` field.
 * `GET /info` now returns `SecurityOptions` field, showing if `apparmor`, `seccomp`, or `selinux` is supported.
@@ -230,9 +106,9 @@ This section lists each version from latest to oldest.  Each listing includes a
 * `POST /containers/create/` `HostConfig.PidMode` field now accepts `container:<name|id>`,
   to have the container join the PID namespace of an existing container.
 
-### v1.23 API changes
+## v1.23 API changes
 
-[Docker Remote API v1.23](docker_remote_api_v1.23.md) documentation
+[Docker Engine API v1.23](v1.23.md) documentation
 
 * `GET /containers/json` returns the state of the container, one of `created`, `restarting`, `running`, `paused`, `exited` or `dead`.
 * `GET /containers/json` returns the mount points for the container.
@@ -252,9 +128,9 @@ This section lists each version from latest to oldest.  Each listing includes a
 * `GET /containers/(id or name)/logs` now accepts a `details` query parameter to stream the extra attributes that were provided to the containers `LogOpts`, such as environment variables and labels, with the logs.
 * `POST /images/load` now returns progress information as a JSON stream, and has a `quiet` query parameter to suppress progress details.
 
-### v1.22 API changes
+## v1.22 API changes
 
-[Docker Remote API v1.22](docker_remote_api_v1.22.md) documentation
+[Docker Engine API v1.22](v1.22.md) documentation
 
 * `POST /container/(name)/update` updates the resources of a container.
 * `GET /containers/json` supports filter `isolation` on Windows.
@@ -286,9 +162,9 @@ This section lists each version from latest to oldest.  Each listing includes a
 * `GET /info` can now return a `SystemStatus` field useful for returning additional information about applications
   that are built on top of engine.
 
-### v1.21 API changes
+## v1.21 API changes
 
-[Docker Remote API v1.21](docker_remote_api_v1.21.md) documentation
+[Docker Engine API v1.21](v1.21.md) documentation
 
 * `GET /volumes` lists volumes from all volume drivers.
 * `POST /volumes/create` to create a volume.
@@ -321,9 +197,9 @@ This section lists each version from latest to oldest.  Each listing includes a
   badness heuristic. This heuristic selects which processes the OOM killer kills
   under out-of-memory conditions.
 
-### v1.20 API changes
+## v1.20 API changes
 
-[Docker Remote API v1.20](docker_remote_api_v1.20.md) documentation
+[Docker Engine API v1.20](v1.20.md) documentation
 
 * `GET /containers/(id)/archive` get an archive of filesystem content from a container.
 * `PUT /containers/(id)/archive` upload an archive of content to be extracted to
@@ -333,9 +209,9 @@ endpoint which can be used to download files and directories from a container.
 * The `hostConfig` option now accepts the field `GroupAdd`, which specifies a
 list of additional groups that the container process will run as.
 
-### v1.19 API changes
+## v1.19 API changes
 
-[Docker Remote API v1.19](docker_remote_api_v1.19.md) documentation
+[Docker Engine API v1.19](v1.19.md) documentation
 
 * When the daemon detects a version mismatch with the client, usually when
 the client is newer than the daemon, an HTTP 400 is now returned instead
@@ -349,9 +225,9 @@ end point now returns the new boolean fields `CpuCfsPeriod`, `CpuCfsQuota`, and
 * The `hostConfig` option now accepts the fields `CpuPeriod` and `CpuQuota`
 * `POST /build` accepts `cpuperiod` and `cpuquota` options
 
-### v1.18 API changes
+## v1.18 API changes
 
-[Docker Remote API v1.18](docker_remote_api_v1.18.md) documentation
+[Docker Engine API v1.18](v1.18.md) documentation
 
 * `GET /version` now returns `Os`, `Arch` and `KernelVersion`.
 * `POST /containers/create` and `POST /containers/(id)/start`allow you to  set ulimit settings for use in the container.

+ 12 - 1
docs/deprecated.md

@@ -242,7 +242,18 @@ of the `--changes` flag that allows to pass `Dockerfile` commands.
 
 ### Interacting with V1 registries
 
-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.
+**Disabled By Default In Release: v1.14**
+
+**Target For Removal In Release: v1.17**
+
+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 enabled by default, this signals the intent to deprecate
+the v1 protocol.
+
+Support for the v1 protocol to the public registry was removed in 1.13. Any
+mirror configurations using v1 should be updated to use a
+[v2 registry mirror](https://docs.docker.com/registry/recipes/mirror/).
 
 ### Docker Content Trust ENV passphrase variables name change
 **Deprecated In Release: [v1.9.0](https://github.com/docker/docker/releases/tag/v1.9.0)**

+ 22 - 20
docs/extend/config.md

@@ -16,6 +16,7 @@ keywords: "API, Usage, plugins, documentation, developer"
      will be rejected.
 -->
 
+
 # Plugin Config Version 0 of Plugin V2
 
 This document outlines the format of the V0 plugin configuration. The plugin
@@ -85,10 +86,6 @@ Config provides the base accessible fields for working with V0 plugin format
       	- **host**
       	- **none**
 
-- **`capabilities`** *array*
-
-   capabilities of the plugin (*Linux only*), see list [`here`](https://github.com/opencontainers/runc/blob/master/libcontainer/SPEC.md#security)
-
 - **`mounts`** *PluginMount array*
 
    mount of the plugin, struct consisting of the following fields, see [`MOUNTS`](https://github.com/opencontainers/runtime-spec/blob/master/config.md#mounts)
@@ -117,22 +114,6 @@ Config provides the base accessible fields for working with V0 plugin format
 
 	  options of the mount.
 
-- **`devices`** *PluginDevice array*
-
-    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)
-
-    - **`name`** *string*
-
-	  name of the device.
-
-    - **`description`** *string*
-
-      description of the device.
-
-    - **`path`** *string*
-
-	  path of the device.
-
 - **`env`** *PluginEnv array*
 
    env of the plugin, struct consisting of the following fields
@@ -165,6 +146,27 @@ Config provides the base accessible fields for working with V0 plugin format
 
 	  values of the args.
 
+- **`linux`** *PluginLinux*
+
+    - **`capabilities`** *string array*
+
+          capabilities of the plugin (*Linux only*), see list [`here`](https://github.com/opencontainers/runc/blob/master/libcontainer/SPEC.md#security)
+
+    - **`devices`** *PluginDevice array*
+
+          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)
+
+          - **`name`** *string*
+
+	      name of the device.
+
+          - **`description`** *string*
+
+              description of the device.
+
+          - **`path`** *string*
+
+              path of the device.
 
 ## Example Config
 

+ 3 - 0
docs/extend/index.md

@@ -27,6 +27,9 @@ volume drivers, but more plugin driver types will be available in future release
 For information about the legacy plugin system available in Docker Engine 1.12
 and earlier, see [Understand legacy Docker Engine plugins](legacy_plugins.md).
 
+> **Note**: Docker Engine managed plugins are currently not supported
+on Windows daemons.
+
 ## Installing and using a plugin
 
 Plugins are distributed as Docker images and can be hosted on Docker Hub or on

+ 2 - 2
docs/extend/plugins_authorization.md

@@ -22,7 +22,7 @@ refer to [Docker Engine plugin system](index.md).
 
 Docker's out-of-the-box authorization model is all or nothing. Any user with
 permission to access the Docker daemon can run any Docker client command. The
-same is true for callers using Docker's remote API to contact the daemon. If you
+same is true for callers using Docker's Engine API to contact the daemon. If you
 require greater access control, you can create authorization plugins and add
 them to your Docker daemon configuration. Using an authorization plugin, a
 Docker administrator can configure granular access policies for managing access
@@ -69,7 +69,7 @@ can be ordered. Each request to the daemon passes in order through the chain.
 Only when all the plugins grant access to the resource, is the access granted.
 
 When an HTTP request is made to the Docker daemon through the CLI or via the
-remote API, the authentication subsystem passes the request to the installed
+Engine API, the authentication subsystem passes the request to the installed
 authentication plugin(s). The request contains the user (caller) and command
 context. The plugin is responsible for deciding whether to allow or deny the
 request.

+ 0 - 22
docs/reference/api/README.md

@@ -1,22 +0,0 @@
----
-published: false
----
-
-<!-- This file is maintained within the docker/docker Github
-     repository at https://github.com/docker/docker/. Make all
-     pull requests against that repo. If you see this file in
-     another repository, consider it read-only there, as it will
-     periodically be overwritten by the definitive file. Pull
-     requests which include edits to this file in other repositories
-     will be rejected.
--->
-
-This directory holds the authoritative specifications of APIs defined and implemented by Docker. Currently this includes:
-
- * The remote API by which a docker node can be queried over HTTP
- * The registry API by which a docker node can download and upload
-   images for storage and sharing
- * The index search API by which a docker node can search the public
-   index for images to download
- * The docker.io OAuth and accounts API which 3rd party services can
-   use to access account information

BIN
docs/reference/api/_static/io_oauth_authorization_page.png


+ 0 - 20
docs/reference/api/docker-io_api.md

@@ -1,20 +0,0 @@
----
-published: false
-title: "Docker Hub API"
-description: "API Documentation for the Docker Hub API"
-keywords: "API, Docker, index, REST, documentation, Docker Hub, registry"
----
-
-<!-- This file is maintained within the docker/docker Github
-     repository at https://github.com/docker/docker/. Make all
-     pull requests against that repo. If you see this file in
-     another repository, consider it read-only there, as it will
-     periodically be overwritten by the definitive file. Pull
-     requests which include edits to this file in other repositories
-     will be rejected.
--->
-
-# Docker Hub API
-
-This API is deprecated as of 1.7. To view the old version, see the [Docker Hub
-API](https://docs.docker.com/v1.7/docker/reference/api/docker-io_api/) in the 1.7 documentation.

+ 0 - 281
docs/reference/api/docker_io_accounts_api.md

@@ -1,281 +0,0 @@
----
-title: "docker.io accounts API"
-description: "API Documentation for docker.io accounts."
-keywords: "API, Docker, accounts, REST, documentation"
----
-
-<!-- This file is maintained within the docker/docker Github
-     repository at https://github.com/docker/docker/. Make all
-     pull requests against that repo. If you see this file in
-     another repository, consider it read-only there, as it will
-     periodically be overwritten by the definitive file. Pull
-     requests which include edits to this file in other repositories
-     will be rejected.
--->
-
-# docker.io accounts API
-
-## Get a single user
-
-`GET /api/v1.1/users/:username/`
-
-Get profile info for the specified user.
-
-Parameters:
-
--   **username** – username of the user whose profile info is being
-        requested.
-
-Request Headers:
-
--   **Authorization** – required authentication credentials of
-        either type HTTP Basic or OAuth Bearer Token.
-
-Status Codes:
-
--   **200** – success, user data returned.
--   **401** – authentication error.
--   **403** – permission error, authenticated user must be the user
-        whose data is being requested, OAuth access tokens must have
-        `profile_read` scope.
--   **404** – the specified username does not exist.
-
-**Example request**:
-
-        GET /api/v1.1/users/janedoe/ HTTP/1.1
-        Host: www.docker.io
-        Accept: application/json
-        Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
-
-**Example response**:
-
-        HTTP/1.1 200 OK
-        Content-Type: application/json
-
-        {
-            "id": 2,
-            "username": "janedoe",
-            "url": "https://www.docker.io/api/v1.1/users/janedoe/",
-            "date_joined": "2014-02-12T17:58:01.431312Z",
-            "type": "User",
-            "full_name": "Jane Doe",
-            "location": "San Francisco, CA",
-            "company": "Success, Inc.",
-            "profile_url": "https://docker.io/",
-            "gravatar_url": "https://secure.gravatar.com/avatar/0212b397124be4acd4e7dea9aa357.jpg?s=80&r=g&d=mm"
-            "email": "jane.doe@example.com",
-            "is_active": true
-        }
-
-## Update a single user
-
-`PATCH /api/v1.1/users/:username/`
-
-Update profile info for the specified user.
-
-Parameters:
-
--   **username** – username of the user whose profile info is being
-        updated.
-
-Json Parameters:
-
--   **full_name** (*string*) – (optional) the new name of the user.
--   **location** (*string*) – (optional) the new location.
--   **company** (*string*) – (optional) the new company of the user.
--   **profile_url** (*string*) – (optional) the new profile url.
--   **gravatar_email** (*string*) – (optional) the new Gravatar
-        email address.
-
-Request Headers:
-
--   **Authorization** – required authentication credentials of
-        either type HTTP Basic or OAuth Bearer Token.
--   **Content-Type** – MIME Type of post data. JSON, url-encoded
-        form data, etc.
-
-Status Codes:
-
--   **200** – success, user data updated.
--   **400** – post data validation error.
--   **401** – authentication error.
--   **403** – permission error, authenticated user must be the user
-        whose data is being updated, OAuth access tokens must have
-        `profile_write` scope.
--   **404** – the specified username does not exist.
-
-**Example request**:
-
-        PATCH /api/v1.1/users/janedoe/ HTTP/1.1
-        Host: www.docker.io
-        Accept: application/json
-        Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
-
-        {
-            "location": "Private Island",
-            "profile_url": "http://janedoe.com/",
-            "company": "Retired",
-        }
-
-**Example response**:
-
-        HTTP/1.1 200 OK
-        Content-Type: application/json
-
-        {
-            "id": 2,
-            "username": "janedoe",
-            "url": "https://www.docker.io/api/v1.1/users/janedoe/",
-            "date_joined": "2014-02-12T17:58:01.431312Z",
-            "type": "User",
-            "full_name": "Jane Doe",
-            "location": "Private Island",
-            "company": "Retired",
-            "profile_url": "http://janedoe.com/",
-            "gravatar_url": "https://secure.gravatar.com/avatar/0212b397124be4acd4e7dea9aa357.jpg?s=80&r=g&d=mm"
-            "email": "jane.doe@example.com",
-            "is_active": true
-        }
-
-## List email addresses for a user
-
-`GET /api/v1.1/users/:username/emails/`
-
-List email info for the specified user.
-
-Parameters:
-
--   **username** – username of the user whose profile info is being
-        updated.
-
-Request Headers:
-
--   **Authorization** – required authentication credentials of
-        either type HTTP Basic or OAuth Bearer Token
-
-Status Codes:
-
--   **200** – success, user data updated.
--   **401** – authentication error.
--   **403** – permission error, authenticated user must be the user
-        whose data is being requested, OAuth access tokens must have
-        `email_read` scope.
--   **404** – the specified username does not exist.
-
-**Example request**:
-
-        GET /api/v1.1/users/janedoe/emails/ HTTP/1.1
-        Host: www.docker.io
-        Accept: application/json
-        Authorization: Bearer zAy0BxC1wDv2EuF3tGs4HrI6qJp6KoL7nM
-
-**Example response**:
-
-        HTTP/1.1 200 OK
-        Content-Type: application/json
-
-        [
-            {
-                "email": "jane.doe@example.com",
-                "verified": true,
-                "primary": true
-            }
-        ]
-
-## Add email address for a user
-
-`POST /api/v1.1/users/:username/emails/`
-
-Add a new email address to the specified user's account. The email
-address must be verified separately, a confirmation email is not
-automatically sent.
-
-Json Parameters:
-
--   **email** (*string*) – email address to be added.
-
-Request Headers:
-
--   **Authorization** – required authentication credentials of
-        either type HTTP Basic or OAuth Bearer Token.
--   **Content-Type** – MIME Type of post data. JSON, url-encoded
-        form data, etc.
-
-Status Codes:
-
--   **201** – success, new email added.
--   **400** – data validation error.
--   **401** – authentication error.
--   **403** – permission error, authenticated user must be the user
-        whose data is being requested, OAuth access tokens must have
-        `email_write` scope.
--   **404** – the specified username does not exist.
-
-**Example request**:
-
-        POST /api/v1.1/users/janedoe/emails/ HTTP/1.1
-        Host: www.docker.io
-        Accept: application/json
-        Content-Type: application/json
-        Authorization: Bearer zAy0BxC1wDv2EuF3tGs4HrI6qJp6KoL7nM
-
-        {
-            "email": "jane.doe+other@example.com"
-        }
-
-**Example response**:
-
-        HTTP/1.1 201 Created
-        Content-Type: application/json
-
-        {
-            "email": "jane.doe+other@example.com",
-            "verified": false,
-            "primary": false
-        }
-
-## Delete email address for a user
-
-`DELETE /api/v1.1/users/:username/emails/`
-
-Delete an email address from the specified user's account. You
-cannot delete a user's primary email address.
-
-Json Parameters:
-
--   **email** (*string*) – email address to be deleted.
-
-Request Headers:
-
--   **Authorization** – required authentication credentials of
-        either type HTTP Basic or OAuth Bearer Token.
--   **Content-Type** – MIME Type of post data. JSON, url-encoded
-        form data, etc.
-
-Status Codes:
-
--   **204** – success, email address removed.
--   **400** – validation error.
--   **401** – authentication error.
--   **403** – permission error, authenticated user must be the user
-        whose data is being requested, OAuth access tokens must have
-        `email_write` scope.
--   **404** – the specified username or email address does not
-        exist.
-
-**Example request**:
-
-        DELETE /api/v1.1/users/janedoe/emails/ HTTP/1.1
-        Host: www.docker.io
-        Accept: application/json
-        Content-Type: application/json
-        Authorization: Bearer zAy0BxC1wDv2EuF3tGs4HrI6qJp6KoL7nM
-
-        {
-            "email": "jane.doe+other@example.com"
-        }
-
-**Example response**:
-
-        HTTP/1.1 204 NO CONTENT
-        Content-Length: 0

+ 0 - 6163
docs/reference/api/docker_remote_api_v1.25.md

@@ -1,6163 +0,0 @@
----
-title: "Remote API v1.25"
-description: "API Documentation for Docker"
-keywords: "API, Docker, rcli, REST, documentation"
----
-
-<!-- This file is maintained within the docker/docker Github
-     repository at https://github.com/docker/docker/. Make all
-     pull requests against that repo. If you see this file in
-     another repository, consider it read-only there, as it will
-     periodically be overwritten by the definitive file. Pull
-     requests which include edits to this file in other repositories
-     will be rejected.
--->
-
-# Docker Remote API v1.25
-
-# 1. Brief introduction
-
- - The Remote API has replaced `rcli`.
- - The daemon listens on `unix:///var/run/docker.sock` but you can
-   [Bind Docker to another host/port or a Unix socket](../commandline/dockerd.md#bind-docker-to-another-host-port-or-a-unix-socket).
- - The API tends to be REST. However, for some complex commands, like `attach`
-   or `pull`, the HTTP connection is hijacked to transport `stdout`,
-   `stdin` and `stderr`.
-
-# 2. Errors
-
-The Remote API uses standard HTTP status codes to indicate the success or failure of the API call. The body of the response will be JSON in the following format:
-
-    {
-        "message": "page not found"
-    }
-
-The status codes that are returned for each endpoint are specified in the endpoint documentation below.
-
-# 3. Endpoints
-
-## 3.1 Containers
-
-### List containers
-
-`GET /containers/json`
-
-List containers
-
-**Example request**:
-
-    GET /v1.25/containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    [
-         {
-                 "Id": "8dfafdbc3a40",
-                 "Names":["/boring_feynman"],
-                 "Image": "ubuntu:latest",
-                 "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82",
-                 "Command": "echo 1",
-                 "Created": 1367854155,
-                 "State": "Exited",
-                 "Status": "Exit 0",
-                 "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}],
-                 "Labels": {
-                         "com.example.vendor": "Acme",
-                         "com.example.license": "GPL",
-                         "com.example.version": "1.0"
-                 },
-                 "SizeRw": 12288,
-                 "SizeRootFs": 0,
-                 "HostConfig": {
-                         "NetworkMode": "default"
-                 },
-                 "NetworkSettings": {
-                         "Networks": {
-                                 "bridge": {
-                                          "IPAMConfig": null,
-                                          "Links": null,
-                                          "Aliases": null,
-                                          "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812",
-                                          "EndpointID": "2cdc4edb1ded3631c81f57966563e5c8525b81121bb3706a9a9a3ae102711f3f",
-                                          "Gateway": "172.17.0.1",
-                                          "IPAddress": "172.17.0.2",
-                                          "IPPrefixLen": 16,
-                                          "IPv6Gateway": "",
-                                          "GlobalIPv6Address": "",
-                                          "GlobalIPv6PrefixLen": 0,
-                                          "MacAddress": "02:42:ac:11:00:02"
-                                  }
-                         }
-                 },
-                 "Mounts": [
-                         {
-                                  "Name": "fac362...80535",
-                                  "Source": "/data",
-                                  "Destination": "/data",
-                                  "Driver": "local",
-                                  "Mode": "ro,Z",
-                                  "RW": false,
-                                  "Propagation": ""
-                         }
-                 ]
-         },
-         {
-                 "Id": "9cd87474be90",
-                 "Names":["/coolName"],
-                 "Image": "ubuntu:latest",
-                 "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82",
-                 "Command": "echo 222222",
-                 "Created": 1367854155,
-                 "State": "Exited",
-                 "Status": "Exit 0",
-                 "Ports": [],
-                 "Labels": {},
-                 "SizeRw": 12288,
-                 "SizeRootFs": 0,
-                 "HostConfig": {
-                         "NetworkMode": "default"
-                 },
-                 "NetworkSettings": {
-                         "Networks": {
-                                 "bridge": {
-                                          "IPAMConfig": null,
-                                          "Links": null,
-                                          "Aliases": null,
-                                          "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812",
-                                          "EndpointID": "88eaed7b37b38c2a3f0c4bc796494fdf51b270c2d22656412a2ca5d559a64d7a",
-                                          "Gateway": "172.17.0.1",
-                                          "IPAddress": "172.17.0.8",
-                                          "IPPrefixLen": 16,
-                                          "IPv6Gateway": "",
-                                          "GlobalIPv6Address": "",
-                                          "GlobalIPv6PrefixLen": 0,
-                                          "MacAddress": "02:42:ac:11:00:08"
-                                  }
-                         }
-                 },
-                 "Mounts": []
-         },
-         {
-                 "Id": "3176a2479c92",
-                 "Names":["/sleepy_dog"],
-                 "Image": "ubuntu:latest",
-                 "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82",
-                 "Command": "echo 3333333333333333",
-                 "Created": 1367854154,
-                 "State": "Exited",
-                 "Status": "Exit 0",
-                 "Ports":[],
-                 "Labels": {},
-                 "SizeRw":12288,
-                 "SizeRootFs":0,
-                 "HostConfig": {
-                         "NetworkMode": "default"
-                 },
-                 "NetworkSettings": {
-                         "Networks": {
-                                 "bridge": {
-                                          "IPAMConfig": null,
-                                          "Links": null,
-                                          "Aliases": null,
-                                          "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812",
-                                          "EndpointID": "8b27c041c30326d59cd6e6f510d4f8d1d570a228466f956edf7815508f78e30d",
-                                          "Gateway": "172.17.0.1",
-                                          "IPAddress": "172.17.0.6",
-                                          "IPPrefixLen": 16,
-                                          "IPv6Gateway": "",
-                                          "GlobalIPv6Address": "",
-                                          "GlobalIPv6PrefixLen": 0,
-                                          "MacAddress": "02:42:ac:11:00:06"
-                                  }
-                         }
-                 },
-                 "Mounts": []
-         },
-         {
-                 "Id": "4cb07b47f9fb",
-                 "Names":["/running_cat"],
-                 "Image": "ubuntu:latest",
-                 "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82",
-                 "Command": "echo 444444444444444444444444444444444",
-                 "Created": 1367854152,
-                 "State": "Exited",
-                 "Status": "Exit 0",
-                 "Ports": [],
-                 "Labels": {},
-                 "SizeRw": 12288,
-                 "SizeRootFs": 0,
-                 "HostConfig": {
-                         "NetworkMode": "default"
-                 },
-                 "NetworkSettings": {
-                         "Networks": {
-                                 "bridge": {
-                                          "IPAMConfig": null,
-                                          "Links": null,
-                                          "Aliases": null,
-                                          "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812",
-                                          "EndpointID": "d91c7b2f0644403d7ef3095985ea0e2370325cd2332ff3a3225c4247328e66e9",
-                                          "Gateway": "172.17.0.1",
-                                          "IPAddress": "172.17.0.5",
-                                          "IPPrefixLen": 16,
-                                          "IPv6Gateway": "",
-                                          "GlobalIPv6Address": "",
-                                          "GlobalIPv6PrefixLen": 0,
-                                          "MacAddress": "02:42:ac:11:00:05"
-                                  }
-                         }
-                 },
-                 "Mounts": []
-         }
-    ]
-
-**Query parameters**:
-
--   **all** – 1/True/true or 0/False/false, Show all containers.
-        Only running containers are shown by default (i.e., this defaults to false)
--   **limit** – Show `limit` last created
-        containers, include non-running ones.
--   **since** – Show only containers created since Id, include
-        non-running ones.
--   **before** – Show only containers created before Id, include
-        non-running ones.
--   **size** – 1/True/true or 0/False/false, Show the containers
-        sizes
--   **filters** - a JSON encoded value of the filters (a `map[string][]string`) to process on the containers list. Available filters:
-  -   `exited=<int>`; -- containers with exit code of  `<int>` ;
-  -   `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`)
-  -   `label=key` or `label="key=value"` of a container label
-  -   `isolation=`(`default`|`process`|`hyperv`)   (Windows daemon only)
-      `id=<ID>` a container's ID
-      `name=<name>` a container's name
-      `is-task=`(`true`|`false`)
-  -   `ancestor`=(`<image-name>[:<tag>]`,  `<image id>` or `<image@digest>`)
-  -   `before`=(`<container id>` or `<container name>`)
-  -   `since`=(`<container id>` or `<container name>`)
-  -   `volume`=(`<volume name>` or `<mount point destination>`)
-  -   `network`=(`<network id>` or `<network name>`)
-  -   `health`=(`starting`|`healthy`|`unhealthy`|`none`)
-
-**Status codes**:
-
--   **200** – no error
--   **400** – bad parameter
--   **500** – server error
-
-### Create a container
-
-`POST /containers/create`
-
-Create a container
-
-**Example request**:
-
-    POST /v1.25/containers/create HTTP/1.1
-    Content-Type: application/json
-
-    {
-           "Hostname": "",
-           "Domainname": "",
-           "User": "",
-           "AttachStdin": false,
-           "AttachStdout": true,
-           "AttachStderr": true,
-           "Tty": false,
-           "OpenStdin": false,
-           "StdinOnce": false,
-           "Env": [
-                   "FOO=bar",
-                   "BAZ=quux"
-           ],
-           "Cmd": [
-                   "date"
-           ],
-           "Entrypoint": "",
-           "Image": "ubuntu",
-           "Labels": {
-                   "com.example.vendor": "Acme",
-                   "com.example.license": "GPL",
-                   "com.example.version": "1.0"
-           },
-           "Volumes": {
-             "/volumes/data": {}
-           },
-           "WorkingDir": "",
-           "NetworkDisabled": false,
-           "MacAddress": "12:34:56:78:9a:bc",
-           "ExposedPorts": {
-                   "22/tcp": {}
-           },
-           "StopSignal": "SIGTERM",
-           "StopTimeout": 10,
-           "HostConfig": {
-             "Binds": ["/tmp:/tmp"],
-             "Tmpfs": { "/run": "rw,noexec,nosuid,size=65536k" },
-             "Links": ["redis3:redis"],
-             "Memory": 0,
-             "MemorySwap": 0,
-             "MemoryReservation": 0,
-             "KernelMemory": 0,
-             "NanoCPUs": 500000,
-             "CpuCount": 4,
-             "CpuPercent": 80,
-             "CpuShares": 512,
-             "CpuPeriod": 100000,
-             "CpuRealtimePeriod": 1000000,
-             "CpuRealtimeRuntime": 10000,
-             "CpuQuota": 50000,
-             "CpusetCpus": "0,1",
-             "CpusetMems": "0,1",
-             "IOMaximumBandwidth": 0,
-             "IOMaximumIOps": 0,
-             "BlkioWeight": 300,
-             "BlkioWeightDevice": [{}],
-             "BlkioDeviceReadBps": [{}],
-             "BlkioDeviceReadIOps": [{}],
-             "BlkioDeviceWriteBps": [{}],
-             "BlkioDeviceWriteIOps": [{}],
-             "MemorySwappiness": 60,
-             "OomKillDisable": false,
-             "OomScoreAdj": 500,
-             "PidMode": "",
-             "PidsLimit": -1,
-             "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
-             "PublishAllPorts": false,
-             "Privileged": false,
-             "ReadonlyRootfs": false,
-             "Dns": ["8.8.8.8"],
-             "DnsOptions": [""],
-             "DnsSearch": [""],
-             "ExtraHosts": null,
-             "VolumesFrom": ["parent", "other:ro"],
-             "CapAdd": ["NET_ADMIN"],
-             "CapDrop": ["MKNOD"],
-             "GroupAdd": ["newgroup"],
-             "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 },
-             "AutoRemove": true,
-             "NetworkMode": "bridge",
-             "Devices": [],
-             "Sysctls": { "net.ipv4.ip_forward": "1" },
-             "Ulimits": [{}],
-             "LogConfig": { "Type": "json-file", "Config": {} },
-             "SecurityOpt": [],
-             "StorageOpt": {},
-             "CgroupParent": "",
-             "VolumeDriver": "",
-             "ShmSize": 67108864,
-             "Mounts": []
-          },
-          "NetworkingConfig": {
-              "EndpointsConfig": {
-                  "isolated_nw" : {
-                      "IPAMConfig": {
-                          "IPv4Address":"172.20.30.33",
-                          "IPv6Address":"2001:db8:abcd::3033",
-                          "LinkLocalIPs":["169.254.34.68", "fe80::3468"]
-                      },
-                      "Links":["container_1", "container_2"],
-                      "Aliases":["server_x", "server_y"]
-                  }
-              }
-          }
-      }
-
-**Example response**:
-
-      HTTP/1.1 201 Created
-      Content-Type: application/json
-
-      {
-           "Id":"e90e34656806",
-           "Warnings":[]
-      }
-
-**JSON parameters**:
-
--   **Hostname** - A string value containing the hostname to use for the
-      container. This must be a valid RFC 1123 hostname.
--   **Domainname** - A string value containing the domain name to use
-      for the container.
--   **User** - A string value specifying the user inside the container.
--   **AttachStdin** - Boolean value, attaches to `stdin`.
--   **AttachStdout** - Boolean value, attaches to `stdout`.
--   **AttachStderr** - Boolean value, attaches to `stderr`.
--   **Tty** - Boolean value, Attach standard streams to a `tty`, including `stdin` if it is not closed.
--   **OpenStdin** - Boolean value, opens `stdin`,
--   **StdinOnce** - Boolean value, close `stdin` after the 1 attached client disconnects.
--   **Env** - A list of environment variables in the form of `["VAR=value", ...]`
--   **Labels** - Adds a map of labels to a container. To specify a map: `{"key":"value", ... }`
--   **Cmd** - Command to run specified as a string or an array of strings.
--   **Entrypoint** - Set the entry point for the container as a string or an array
-      of strings. If the array consists of exactly one empty string (`[""]`) then the entry point
-      is reset to system default (i.e., the entry point used by docker when there is no `ENTRYPOINT`
-      instruction in the Dockerfile).
--   **Image** - A string specifying the image name to use for the container.
--   **Volumes** - An object mapping mount point paths (strings) inside the
-      container to empty objects.
--   **WorkingDir** - A string specifying the working directory for commands to
-      run in.
--   **NetworkDisabled** - Boolean value, when true disables networking for the
-      container
--   **ExposedPorts** - An object mapping ports to an empty object in the form of:
-      `"ExposedPorts": { "<port>/<tcp|udp>: {}" }`
--   **StopSignal** - Signal to stop a container as a string or unsigned integer. `SIGTERM` by default.
--   **StopTimeout** - Timeout (in seconds) to stop a container. 10 by default.
--   **HostConfig**
-    -   **Binds** – A list of volume bindings for this container. Each volume binding is a string in one of these forms:
-           + `host-src:container-dest` to bind-mount a host path into the
-             container. Both `host-src`, and `container-dest` must be an
-             _absolute_ path.
-           + `host-src:container-dest:ro` to make the bind-mount read-only
-             inside the container. Both `host-src`, and `container-dest` must be
-             an _absolute_ path.
-           + `volume-name:container-dest` to bind-mount a volume managed by a
-             volume driver into the container. `container-dest` must be an
-             _absolute_ path.
-           + `volume-name:container-dest:ro` to mount the volume read-only
-             inside the container.  `container-dest` must be an _absolute_ path.
-    -   **Tmpfs** – A map of container directories which should be replaced by tmpfs mounts, and their corresponding
-          mount options. A JSON object in the form `{ "/run": "rw,noexec,nosuid,size=65536k" }`.
-    -   **Links** - A list of links for the container. Each link entry should be
-          in the form of `container_name:alias`.
-    -   **Memory** - Memory limit in bytes.
-    -   **MemorySwap** - Total memory limit (memory + swap); set `-1` to enable unlimited swap.
-          You must use this with `memory` and make the swap value larger than `memory`.
-    -   **MemoryReservation** - Memory soft limit in bytes.
-    -   **KernelMemory** - Kernel memory limit in bytes.
-    -   **NanoCPUs** - CPU quota in units of 10<sup>-9</sup> CPUs. The default value is 0, which means there is no limit.
-    -   **CpuCount** - An integer value containing the number of usable CPUs.
-          Windows daemon only. On Windows Server containers,
-          the processor resource controls are mutually exclusive, the order of precedence
-          is CPUCount first, then CPUShares, and CPUPercent last.
-    -   **CpuPercent** - An integer value containing the usable percentage of
-          the available CPUs. Windows daemon only. On Windows Server containers,
-          the processor resource controls are mutually exclusive, the order of precedence
-          is CPUCount first, then CPUShares, and CPUPercent last.
-    -   **CpuShares** - An integer value containing the container's CPU Shares
-          (ie. the relative weight vs other containers).
-    -   **CpuPeriod** - The length of a CPU period in microseconds.
-    -   **CpuRealtimePeriod** - The length of a CPU real-time period in microseconds (0=no time allocated for rt tasks)
-    -   **CpuRealtimeRuntime** - The length of a CPU real-time runtime in microseconds (0=no time allocated for rt tasks)
-    -   **CpuQuota** - Microseconds of CPU time that the container can get in a CPU period.
-    -   **CpusetCpus** - String value containing the `cgroups CpusetCpus` to use.
-    -   **CpusetMems** - Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.
-    -   **IOMaximumBandwidth** - Maximum IO absolute rate in terms of IOps.
-    -   **IOMaximumIOps** - Maximum IO absolute rate in terms of bytes per second.
-    -   **BlkioWeight** - Block IO weight (relative weight) accepts a weight value between 10 and 1000.
-    -   **BlkioWeightDevice** - Block IO weight (relative device weight) in the form of:        `"BlkioWeightDevice": [{"Path": "device_path", "Weight": weight}]`
-    -   **BlkioDeviceReadBps** - Limit read rate (bytes per second) from a device in the form of:	`"BlkioDeviceReadBps": [{"Path": "device_path", "Rate": rate}]`, for example:
-        `"BlkioDeviceReadBps": [{"Path": "/dev/sda", "Rate": "1024"}]"`
-    -   **BlkioDeviceWriteBps** - Limit write rate (bytes per second) to a device in the form of:	`"BlkioDeviceWriteBps": [{"Path": "device_path", "Rate": rate}]`, for example:
-        `"BlkioDeviceWriteBps": [{"Path": "/dev/sda", "Rate": "1024"}]"`
-    -   **BlkioDeviceReadIOps** - Limit read rate (IO per second) from a device in the form of:	`"BlkioDeviceReadIOps": [{"Path": "device_path", "Rate": rate}]`, for example:
-        `"BlkioDeviceReadIOps": [{"Path": "/dev/sda", "Rate": "1000"}]`
-    -   **BlkioDeviceWiiteIOps** - Limit write rate (IO per second) to a device in the form of:	`"BlkioDeviceWriteIOps": [{"Path": "device_path", "Rate": rate}]`, for example:
-        `"BlkioDeviceWriteIOps": [{"Path": "/dev/sda", "Rate": "1000"}]`
-    -   **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
-    -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
-    -   **OomScoreAdj** - An integer value containing the score given to the container in order to tune OOM killer preferences.
-    -   **PidMode** - Set the PID (Process) Namespace mode for the container;
-          `"container:<name|id>"`: joins another container's PID namespace
-          `"host"`: use the host's PID namespace inside the container
-    -   **PidsLimit** - Tune a container's pids limit. Set -1 for unlimited.
-    -   **PortBindings** - A map of exposed container ports and the host port they
-          should map to. A JSON object in the form
-          `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
-          Take note that `port` is specified as a string and not an integer value.
-    -   **PublishAllPorts** - Allocates a random host port for all of a container's
-          exposed ports. Specified as a boolean value.
-    -   **Privileged** - Gives the container full access to the host. Specified as
-          a boolean value.
-    -   **ReadonlyRootfs** - Mount the container's root filesystem as read only.
-          Specified as a boolean value.
-    -   **Dns** - A list of DNS servers for the container to use.
-    -   **DnsOptions** - A list of DNS options
-    -   **DnsSearch** - A list of DNS search domains
-    -   **ExtraHosts** - A list of hostnames/IP mappings to add to the
-        container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`.
-    -   **VolumesFrom** - A list of volumes to inherit from another container.
-          Specified in the form `<container name>[:<ro|rw>]`
-    -   **CapAdd** - A list of kernel capabilities to add to the container.
-    -   **Capdrop** - A list of kernel capabilities to drop from the container.
-    -   **GroupAdd** - A list of additional groups that the container process will run as
-    -   **RestartPolicy** – The behavior to apply when the container exits.  The
-            value is an object with a `Name` property of either `"always"` to
-            always restart, `"unless-stopped"` to restart always except when
-            user has manually stopped the container or `"on-failure"` to restart only when the container
-            exit code is non-zero.  If `on-failure` is used, `MaximumRetryCount`
-            controls the number of times to retry before giving up.
-            The default is not to restart. (optional)
-            An ever increasing delay (double the previous delay, starting at 100mS)
-            is added before each restart to prevent flooding the server.
-    -   **AutoRemove** - Boolean value, set to `true` to automatically remove the container on daemon side
-            when the container's process exits. Note that `RestartPolicy` other than `none` is exclusive to `AutoRemove`.
-    -   **UsernsMode**  - Sets the usernamespace mode for the container when usernamespace remapping option is enabled.
-           supported values are: `host`.
-    -   **NetworkMode** - Sets the networking mode for the container. Supported
-          standard values are: `bridge`, `host`, `none`, and `container:<name|id>`. Any other value is taken
-          as a custom network's name to which this container should connect to.
-    -   **Devices** - A list of devices to add to the container specified as a JSON object in the
-      form
-          `{ "PathOnHost": "/dev/deviceName", "PathInContainer": "/dev/deviceName", "CgroupPermissions": "mrw"}`
-    -   **Ulimits** - A list of ulimits to set in the container, specified as
-          `{ "Name": <name>, "Soft": <soft limit>, "Hard": <hard limit> }`, for example:
-          `Ulimits: { "Name": "nofile", "Soft": 1024, "Hard": 2048 }`
-    -   **Sysctls** - A list of kernel parameters (sysctls) to set in the container, specified as
-          `{ <name>: <Value> }`, for example:
-	  `{ "net.ipv4.ip_forward": "1" }`
-    -   **SecurityOpt**: A list of string values to customize labels for MLS
-        systems, such as SELinux.
-    -   **StorageOpt**: Storage driver options per container. Options can be passed in the form
-        `{"size":"120G"}`
-    -   **LogConfig** - Log configuration for the container, specified as a JSON object in the form
-          `{ "Type": "<driver_name>", "Config": {"key1": "val1"}}`.
-          Available types: `json-file`, `syslog`, `journald`, `gelf`, `fluentd`, `awslogs`, `splunk`, `etwlogs`, `none`.
-          `json-file` logging driver.
-    -   **CgroupParent** - Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist.
-    -   **VolumeDriver** - Driver that this container users to mount volumes.
-    -   **ShmSize** - Size of `/dev/shm` in bytes. The size must be greater than 0.  If omitted the system uses 64MB.
-    -   **Mounts** – Specification for mounts to be added to the container.
-        - **Target** – Container path.
-        - **Source** – Mount source (e.g. a volume name, a host path).
-        - **Type** – The mount type (`bind`, `volume`, or `tmpfs`).
-          Available types (for the `Type` field):
-          - **bind** - Mounts a file or directory from the host into the container. Must exist prior to creating the container.
-          - **volume** - Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed.
-          - **tmpfs** - Create a tmpfs with the given options. The mount source cannot be specified for tmpfs.
-        - **ReadOnly** – A boolean indicating whether the mount should be read-only.
-        - **BindOptions** - Optional configuration for the `bind` type.
-          - **Propagation** – A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`.
-        - **VolumeOptions** – Optional configuration for the `volume` type.
-            - **NoCopy** – A boolean indicating if volume should be
-              populated with the data from the target. (Default false)
-            - **Labels** – User-defined name and labels for the volume as key/value pairs: `{"name": "value"}`
-            - **DriverConfig** – Map of driver-specific options.
-              - **Name** - Name of the driver to use to create the volume.
-              - **Options** - key/value map of driver specific options.
-        - **TmpfsOptions** – Optional configuration for the `tmpfs` type.
-            - **SizeBytes** – The size for the tmpfs mount in bytes.
-            - **Mode** – The permission mode for the tmpfs mount in an integer.
-
-
-**Query parameters**:
-
--   **name** – Assign the specified name to the container. Must
-    match `/?[a-zA-Z0-9_-]+`.
-
-**Status codes**:
-
--   **201** – no error
--   **400** – bad parameter
--   **404** – no such container
--   **406** – impossible to attach (container not running)
--   **409** – conflict
--   **500** – server error
-
-### Inspect a container
-
-`GET /containers/(id or name)/json`
-
-Return low-level information on the container `id`
-
-**Example request**:
-
-      GET /v1.25/containers/4fa6e0f0c678/json HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-	{
-		"AppArmorProfile": "",
-		"Args": [
-			"-c",
-			"exit 9"
-		],
-		"Config": {
-			"AttachStderr": true,
-			"AttachStdin": false,
-			"AttachStdout": true,
-			"Cmd": [
-				"/bin/sh",
-				"-c",
-				"exit 9"
-			],
-			"Domainname": "",
-			"Entrypoint": null,
-			"Env": [
-				"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
-			],
-			"ExposedPorts": null,
-			"Hostname": "ba033ac44011",
-			"Image": "ubuntu",
-			"Labels": {
-				"com.example.vendor": "Acme",
-				"com.example.license": "GPL",
-				"com.example.version": "1.0"
-			},
-			"MacAddress": "",
-			"NetworkDisabled": false,
-			"OnBuild": null,
-			"OpenStdin": false,
-			"StdinOnce": false,
-			"Tty": false,
-			"User": "",
-			"Volumes": {
-				"/volumes/data": {}
-			},
-			"WorkingDir": "",
-			"StopSignal": "SIGTERM",
-			"StopTimeout": 10
-		},
-		"Created": "2015-01-06T15:47:31.485331387Z",
-		"Driver": "devicemapper",
-		"ExecIDs": null,
-		"HostConfig": {
-			"Binds": null,
-			"IOMaximumBandwidth": 0,
-			"IOMaximumIOps": 0,
-			"BlkioWeight": 0,
-			"BlkioWeightDevice": [{}],
-			"BlkioDeviceReadBps": [{}],
-			"BlkioDeviceWriteBps": [{}],
-			"BlkioDeviceReadIOps": [{}],
-			"BlkioDeviceWriteIOps": [{}],
-			"CapAdd": null,
-			"CapDrop": null,
-			"ContainerIDFile": "",
-			"CpusetCpus": "",
-			"CpusetMems": "",
-			"CpuCount": 4,
-			"CpuPercent": 80,
-			"CpuShares": 0,
-			"CpuPeriod": 100000,
-			"CpuRealtimePeriod": 1000000,
-			"CpuRealtimeRuntime": 10000,
-			"Devices": [],
-			"Dns": null,
-			"DnsOptions": null,
-			"DnsSearch": null,
-			"ExtraHosts": null,
-			"IpcMode": "",
-			"Links": null,
-			"LxcConf": [],
-			"Memory": 0,
-			"MemorySwap": 0,
-			"MemoryReservation": 0,
-			"KernelMemory": 0,
-			"OomKillDisable": false,
-			"OomScoreAdj": 500,
-			"NetworkMode": "bridge",
-			"PidMode": "",
-			"PortBindings": {},
-			"Privileged": false,
-			"ReadonlyRootfs": false,
-			"PublishAllPorts": false,
-			"RestartPolicy": {
-				"MaximumRetryCount": 2,
-				"Name": "on-failure"
-			},
-			"AutoRemove": true,
-			"LogConfig": {
-				"Config": null,
-				"Type": "json-file"
-			},
-			"SecurityOpt": null,
-			"Sysctls": {
-			        "net.ipv4.ip_forward": "1"
-			},
-			"StorageOpt": null,
-			"VolumesFrom": null,
-			"Ulimits": [{}],
-			"VolumeDriver": "",
-			"ShmSize": 67108864,
-			"Mounts": []
-		},
-		"HostnamePath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname",
-		"HostsPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts",
-		"LogPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log",
-		"Id": "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39",
-		"Image": "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2",
-		"MountLabel": "",
-		"Name": "/boring_euclid",
-		"NetworkSettings": {
-			"Bridge": "",
-			"SandboxID": "",
-			"HairpinMode": false,
-			"LinkLocalIPv6Address": "",
-			"LinkLocalIPv6PrefixLen": 0,
-			"Ports": null,
-			"SandboxKey": "",
-			"SecondaryIPAddresses": null,
-			"SecondaryIPv6Addresses": null,
-			"EndpointID": "",
-			"Gateway": "",
-			"GlobalIPv6Address": "",
-			"GlobalIPv6PrefixLen": 0,
-			"IPAddress": "",
-			"IPPrefixLen": 0,
-			"IPv6Gateway": "",
-			"MacAddress": "",
-			"Networks": {
-				"bridge": {
-					"NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812",
-					"EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d",
-					"Gateway": "172.17.0.1",
-					"IPAddress": "172.17.0.2",
-					"IPPrefixLen": 16,
-					"IPv6Gateway": "",
-					"GlobalIPv6Address": "",
-					"GlobalIPv6PrefixLen": 0,
-					"MacAddress": "02:42:ac:12:00:02"
-				}
-			}
-		},
-		"Path": "/bin/sh",
-		"ProcessLabel": "",
-		"ResolvConfPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf",
-		"RestartCount": 1,
-		"State": {
-			"Error": "",
-			"ExitCode": 9,
-			"FinishedAt": "2015-01-06T15:47:32.080254511Z",
-			"OOMKilled": false,
-			"Dead": false,
-			"Paused": false,
-			"Pid": 0,
-			"Restarting": false,
-			"Running": true,
-			"StartedAt": "2015-01-06T15:47:32.072697474Z",
-			"Status": "running"
-		},
-		"Mounts": [
-			{
-				"Name": "fac362...80535",
-				"Source": "/data",
-				"Destination": "/data",
-				"Driver": "local",
-				"Mode": "ro,Z",
-				"RW": false,
-				"Propagation": ""
-			}
-		]
-	}
-
-**Example request, with size information**:
-
-    GET /v1.25/containers/4fa6e0f0c678/json?size=1 HTTP/1.1
-
-**Example response, with size information**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {
-    ....
-    "SizeRw": 0,
-    "SizeRootFs": 972,
-    ....
-    }
-
-**Query parameters**:
-
--   **size** – 1/True/true or 0/False/false, return container size information. Default is `false`.
-
-**Status codes**:
-
--   **200** – no error
--   **404** – no such container
--   **500** – server error
-
-### List processes running inside a container
-
-`GET /containers/(id or name)/top`
-
-List processes running inside the container `id`. On Unix systems this
-is done by running the `ps` command. This endpoint is not
-supported on Windows.
-
-**Example request**:
-
-    GET /v1.25/containers/4fa6e0f0c678/top HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {
-       "Titles" : [
-         "UID", "PID", "PPID", "C", "STIME", "TTY", "TIME", "CMD"
-       ],
-       "Processes" : [
-         [
-           "root", "13642", "882", "0", "17:03", "pts/0", "00:00:00", "/bin/bash"
-         ],
-         [
-           "root", "13735", "13642", "0", "17:06", "pts/0", "00:00:00", "sleep 10"
-         ]
-       ]
-    }
-
-**Example request**:
-
-    GET /v1.25/containers/4fa6e0f0c678/top?ps_args=aux HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {
-      "Titles" : [
-        "USER","PID","%CPU","%MEM","VSZ","RSS","TTY","STAT","START","TIME","COMMAND"
-      ]
-      "Processes" : [
-        [
-          "root","13642","0.0","0.1","18172","3184","pts/0","Ss","17:03","0:00","/bin/bash"
-        ],
-        [
-          "root","13895","0.0","0.0","4348","692","pts/0","S+","17:15","0:00","sleep 10"
-        ]
-      ],
-    }
-
-**Query parameters**:
-
--   **ps_args** – `ps` arguments to use (e.g., `aux`), defaults to `-ef`
-
-**Status codes**:
-
--   **200** – no error
--   **404** – no such container
--   **500** – server error
-
-### Get container logs
-
-`GET /containers/(id or name)/logs`
-
-Get `stdout` and `stderr` logs from the container ``id``
-
-> **Note**:
-> This endpoint works only for containers with the `json-file` or `journald` logging drivers.
-
-**Example request**:
-
-     GET /v1.25/containers/4fa6e0f0c678/logs?stderr=1&stdout=1&timestamps=1&follow=1&tail=10&since=1428990821 HTTP/1.1
-
-**Example response**:
-
-     HTTP/1.1 101 UPGRADED
-     Content-Type: application/vnd.docker.raw-stream
-     Connection: Upgrade
-     Upgrade: tcp
-
-     {% raw %}
-     {{ STREAM }}
-     {% endraw %}
-
-**Query parameters**:
-
--   **details** - 1/True/true or 0/False/flase, Show extra details provided to logs. Default `false`.
--   **follow** – 1/True/true or 0/False/false, return stream. Default `false`.
--   **stdout** – 1/True/true or 0/False/false, show `stdout` log. Default `false`.
--   **stderr** – 1/True/true or 0/False/false, show `stderr` log. Default `false`.
--   **since** – UNIX timestamp (integer) to filter logs. Specifying a timestamp
-    will only output log-entries since that timestamp. Default: 0 (unfiltered)
--   **timestamps** – 1/True/true or 0/False/false, print timestamps for
-        every log line. Default `false`.
--   **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all.
-
-**Status codes**:
-
--   **101** – no error, hints proxy about hijacking
--   **200** – no error, no upgrade header found
--   **404** – no such container
--   **500** – server error
-
-### Inspect changes on a container's filesystem
-
-`GET /containers/(id or name)/changes`
-
-Inspect changes on container `id`'s filesystem
-
-**Example request**:
-
-    GET /v1.25/containers/4fa6e0f0c678/changes HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    [
-         {
-                 "Path": "/dev",
-                 "Kind": 0
-         },
-         {
-                 "Path": "/dev/kmsg",
-                 "Kind": 1
-         },
-         {
-                 "Path": "/test",
-                 "Kind": 1
-         }
-    ]
-
-Values for `Kind`:
-
-- `0`: Modify
-- `1`: Add
-- `2`: Delete
-
-**Status codes**:
-
--   **200** – no error
--   **404** – no such container
--   **500** – server error
-
-### Export a container
-
-`GET /containers/(id or name)/export`
-
-Export the contents of container `id`
-
-**Example request**:
-
-    GET /v1.25/containers/4fa6e0f0c678/export HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/octet-stream
-
-    {% raw %}
-    {{ TAR STREAM }}
-    {% endraw %}
-
-**Status codes**:
-
--   **200** – no error
--   **404** – no such container
--   **500** – server error
-
-### Get container stats based on resource usage
-
-`GET /containers/(id or name)/stats`
-
-This endpoint returns a live stream of a container's resource usage statistics.
-
-**Example request**:
-
-    GET /v1.25/containers/redis1/stats HTTP/1.1
-
-**Example response**:
-
-      HTTP/1.1 200 OK
-      Content-Type: application/json
-
-      {
-         "read" : "2015-01-08T22:57:31.547920715Z",
-         "pids_stats": {
-            "current": 3
-         },
-         "networks": {
-                 "eth0": {
-                     "rx_bytes": 5338,
-                     "rx_dropped": 0,
-                     "rx_errors": 0,
-                     "rx_packets": 36,
-                     "tx_bytes": 648,
-                     "tx_dropped": 0,
-                     "tx_errors": 0,
-                     "tx_packets": 8
-                 },
-                 "eth5": {
-                     "rx_bytes": 4641,
-                     "rx_dropped": 0,
-                     "rx_errors": 0,
-                     "rx_packets": 26,
-                     "tx_bytes": 690,
-                     "tx_dropped": 0,
-                     "tx_errors": 0,
-                     "tx_packets": 9
-                 }
-         },
-         "memory_stats" : {
-            "stats" : {
-               "total_pgmajfault" : 0,
-               "cache" : 0,
-               "mapped_file" : 0,
-               "total_inactive_file" : 0,
-               "pgpgout" : 414,
-               "rss" : 6537216,
-               "total_mapped_file" : 0,
-               "writeback" : 0,
-               "unevictable" : 0,
-               "pgpgin" : 477,
-               "total_unevictable" : 0,
-               "pgmajfault" : 0,
-               "total_rss" : 6537216,
-               "total_rss_huge" : 6291456,
-               "total_writeback" : 0,
-               "total_inactive_anon" : 0,
-               "rss_huge" : 6291456,
-               "hierarchical_memory_limit" : 67108864,
-               "total_pgfault" : 964,
-               "total_active_file" : 0,
-               "active_anon" : 6537216,
-               "total_active_anon" : 6537216,
-               "total_pgpgout" : 414,
-               "total_cache" : 0,
-               "inactive_anon" : 0,
-               "active_file" : 0,
-               "pgfault" : 964,
-               "inactive_file" : 0,
-               "total_pgpgin" : 477
-            },
-            "max_usage" : 6651904,
-            "usage" : 6537216,
-            "failcnt" : 0,
-            "limit" : 67108864
-         },
-         "blkio_stats" : {},
-         "cpu_stats" : {
-            "cpu_usage" : {
-               "percpu_usage" : [
-                  8646879,
-                  24472255,
-                  36438778,
-                  30657443
-               ],
-               "usage_in_usermode" : 50000000,
-               "total_usage" : 100215355,
-               "usage_in_kernelmode" : 30000000
-            },
-            "system_cpu_usage" : 739306590000000,
-            "throttling_data" : {"periods":0,"throttled_periods":0,"throttled_time":0}
-         },
-         "precpu_stats" : {
-            "cpu_usage" : {
-               "percpu_usage" : [
-                  8646879,
-                  24350896,
-                  36438778,
-                  30657443
-               ],
-               "usage_in_usermode" : 50000000,
-               "total_usage" : 100093996,
-               "usage_in_kernelmode" : 30000000
-            },
-            "system_cpu_usage" : 9492140000000,
-            "throttling_data" : {"periods":0,"throttled_periods":0,"throttled_time":0}
-         }
-      }
-
-The precpu_stats is the cpu statistic of last read, which is used for calculating the cpu usage percent. It is not the exact copy of the “cpu_stats” field.
-
-**Query parameters**:
-
--   **stream** – 1/True/true or 0/False/false, pull stats once then disconnect. Default `true`.
-
-**Status codes**:
-
--   **200** – no error
--   **404** – no such container
--   **500** – server error
-
-### Resize a container TTY
-
-`POST /containers/(id or name)/resize`
-
-Resize the TTY for container with  `id`. The unit is number of characters. You must restart the container for the resize to take effect.
-
-**Example request**:
-
-      POST /v1.25/containers/4fa6e0f0c678/resize?h=40&w=80 HTTP/1.1
-
-**Example response**:
-
-      HTTP/1.1 200 OK
-      Content-Length: 0
-      Content-Type: text/plain; charset=utf-8
-
-**Query parameters**:
-
--   **h** – height of `tty` session
--   **w** – width
-
-**Status codes**:
-
--   **200** – no error
--   **404** – No such container
--   **500** – Cannot resize container
-
-### Start a container
-
-`POST /containers/(id or name)/start`
-
-Start the container `id`
-
-**Example request**:
-
-    POST /v1.25/containers/e90e34656806/start HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 204 No Content
-
-**Query parameters**:
-
--   **detachKeys** – Override the key sequence for detaching a
-        container. Format is a single character `[a-Z]` or `ctrl-<value>`
-        where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`.
-
-**Status codes**:
-
--   **204** – no error
--   **304** – container already started
--   **404** – no such container
--   **500** – server error
-
-### Stop a container
-
-`POST /containers/(id or name)/stop`
-
-Stop the container `id`
-
-**Example request**:
-
-    POST /v1.25/containers/e90e34656806/stop?t=5 HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 204 No Content
-
-**Query parameters**:
-
--   **t** – number of seconds to wait before killing the container
-
-**Status codes**:
-
--   **204** – no error
--   **304** – container already stopped
--   **404** – no such container
--   **500** – server error
-
-### Restart a container
-
-`POST /containers/(id or name)/restart`
-
-Restart the container `id`
-
-**Example request**:
-
-    POST /v1.25/containers/e90e34656806/restart?t=5 HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 204 No Content
-
-**Query parameters**:
-
--   **t** – number of seconds to wait before killing the container
-
-**Status codes**:
-
--   **204** – no error
--   **404** – no such container
--   **500** – server error
-
-### Kill a container
-
-`POST /containers/(id or name)/kill`
-
-Kill the container `id`
-
-**Example request**:
-
-    POST /v1.25/containers/e90e34656806/kill HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 204 No Content
-
-**Query parameters**:
-
--   **signal** - Signal to send to the container: integer or string like `SIGINT`.
-        When not set, `SIGKILL` is assumed and the call waits for the container to exit.
-
-**Status codes**:
-
--   **204** – no error
--   **404** – no such container
--   **500** – server error
-
-### Update a container
-
-`POST /containers/(id or name)/update`
-
-Update configuration of one or more containers.
-
-**Example request**:
-
-       POST /v1.25/containers/e90e34656806/update HTTP/1.1
-       Content-Type: application/json
-
-       {
-         "BlkioWeight": 300,
-         "CpuShares": 512,
-         "CpuPeriod": 100000,
-         "CpuRealtimePeriod": 1000000,
-         "CpuRealtimeRuntime": 10000,
-         "CpuQuota": 50000,
-         "CpusetCpus": "0,1",
-         "CpusetMems": "0",
-         "Memory": 314572800,
-         "MemorySwap": 514288000,
-         "MemoryReservation": 209715200,
-         "KernelMemory": 52428800,
-         "RestartPolicy": {
-           "MaximumRetryCount": 4,
-           "Name": "on-failure"
-         },
-       }
-
-**Example response**:
-
-       HTTP/1.1 200 OK
-       Content-Type: application/json
-
-       {
-           "Warnings": []
-       }
-
-**Status codes**:
-
--   **200** – no error
--   **400** – bad parameter
--   **404** – no such container
--   **500** – server error
-
-### Rename a container
-
-`POST /containers/(id or name)/rename`
-
-Rename the container `id` to a `new_name`
-
-**Example request**:
-
-    POST /v1.25/containers/e90e34656806/rename?name=new_name HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 204 No Content
-
-**Query parameters**:
-
--   **name** – new name for the container
-
-**Status codes**:
-
--   **204** – no error
--   **404** – no such container
--   **409** - conflict name already assigned
--   **500** – server error
-
-### Pause a container
-
-`POST /containers/(id or name)/pause`
-
-Pause the container `id`
-
-**Example request**:
-
-    POST /v1.25/containers/e90e34656806/pause HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 204 No Content
-
-**Status codes**:
-
--   **204** – no error
--   **404** – no such container
--   **500** – server error
-
-### Unpause a container
-
-`POST /containers/(id or name)/unpause`
-
-Unpause the container `id`
-
-**Example request**:
-
-    POST /v1.25/containers/e90e34656806/unpause HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 204 No Content
-
-**Status codes**:
-
--   **204** – no error
--   **404** – no such container
--   **500** – server error
-
-### Attach to a container
-
-`POST /containers/(id or name)/attach`
-
-Attach to the container `id`
-
-**Example request**:
-
-    POST /v1.25/containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 101 UPGRADED
-    Content-Type: application/vnd.docker.raw-stream
-    Connection: Upgrade
-    Upgrade: tcp
-
-    {% raw %}
-    {{ STREAM }}
-    {% endraw %}
-
-**Query parameters**:
-
--   **detachKeys** – Override the key sequence for detaching a
-        container. Format is a single character `[a-Z]` or `ctrl-<value>`
-        where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`.
--   **logs** – 1/True/true or 0/False/false, return logs. Default `false`.
--   **stream** – 1/True/true or 0/False/false, return stream.
-        Default `false`.
--   **stdin** – 1/True/true or 0/False/false, if `stream=true`, attach
-        to `stdin`. Default `false`.
--   **stdout** – 1/True/true or 0/False/false, if `logs=true`, return
-        `stdout` log, if `stream=true`, attach to `stdout`. Default `false`.
--   **stderr** – 1/True/true or 0/False/false, if `logs=true`, return
-        `stderr` log, if `stream=true`, attach to `stderr`. Default `false`.
-
-**Status codes**:
-
--   **101** – no error, hints proxy about hijacking
--   **200** – no error, no upgrade header found
--   **400** – bad parameter
--   **404** – no such container
--   **409** - container is paused
--   **500** – server error
-
-**Stream details**:
-
-When using the TTY setting is enabled in
-[`POST /containers/create`
-](#create-a-container),
-the stream is the raw data from the process PTY and client's `stdin`.
-When the TTY is disabled, then the stream is multiplexed to separate
-`stdout` and `stderr`.
-
-The format is a **Header** and a **Payload** (frame).
-
-**HEADER**
-
-The header contains the information which the stream writes (`stdout` or
-`stderr`). It also contains the size of the associated frame encoded in the
-last four bytes (`uint32`).
-
-It is encoded on the first eight bytes like this:
-
-    header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}
-
-`STREAM_TYPE` can be:
-
--   0: `stdin` (is written on `stdout`)
--   1: `stdout`
--   2: `stderr`
-
-`SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of
-the `uint32` size encoded as big endian.
-
-**PAYLOAD**
-
-The payload is the raw stream.
-
-**IMPLEMENTATION**
-
-The simplest way to implement the Attach protocol is the following:
-
-    1.  Read eight bytes.
-    2.  Choose `stdout` or `stderr` depending on the first byte.
-    3.  Extract the frame size from the last four bytes.
-    4.  Read the extracted size and output it on the correct output.
-    5.  Goto 1.
-
-### Attach to a container (websocket)
-
-`GET /containers/(id or name)/attach/ws`
-
-Attach to the container `id` via websocket
-
-Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)
-
-**Example request**
-
-    GET /v1.25/containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1
-
-**Example response**
-
-    {% raw %}
-    {{ STREAM }}
-    {% endraw %}
-
-**Query parameters**:
-
--   **detachKeys** – Override the key sequence for detaching a
-        container. Format is a single character `[a-Z]` or `ctrl-<value>`
-        where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`.
--   **logs** – 1/True/true or 0/False/false, return logs. Default `false`.
--   **stream** – 1/True/true or 0/False/false, return stream.
-        Default `false`.
--   **stdin** – 1/True/true or 0/False/false, if `stream=true`, attach
-        to `stdin`. Default `false`.
--   **stdout** – 1/True/true or 0/False/false, if `logs=true`, return
-        `stdout` log, if `stream=true`, attach to `stdout`. Default `false`.
--   **stderr** – 1/True/true or 0/False/false, if `logs=true`, return
-        `stderr` log, if `stream=true`, attach to `stderr`. Default `false`.
-
-**Status codes**:
-
--   **200** – no error
--   **400** – bad parameter
--   **404** – no such container
--   **500** – server error
-
-### Wait a container
-
-`POST /containers/(id or name)/wait`
-
-Block until container `id` stops, then returns the exit code
-
-**Example request**:
-
-    POST /v1.25/containers/16253994b7c4/wait HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {"StatusCode": 0}
-
-**Status codes**:
-
--   **200** – no error
--   **404** – no such container
--   **500** – server error
-
-### Remove a container
-
-`DELETE /containers/(id or name)`
-
-Remove the container `id` from the filesystem
-
-**Example request**:
-
-    DELETE /v1.25/containers/16253994b7c4?v=1 HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 204 No Content
-
-**Query parameters**:
-
--   **v** – 1/True/true or 0/False/false, Remove the volumes
-        associated to the container. Default `false`.
--   **force** - 1/True/true or 0/False/false, Kill then remove the container.
-        Default `false`.
-
-**Status codes**:
-
--   **204** – no error
--   **400** – bad parameter
--   **404** – no such container
--   **409** – conflict
--   **500** – server error
-
-### Retrieving information about files and folders in a container
-
-`HEAD /containers/(id or name)/archive`
-
-See the description of the `X-Docker-Container-Path-Stat` header in the
-following section.
-
-### Get an archive of a filesystem resource in a container
-
-`GET /containers/(id or name)/archive`
-
-Get a tar archive of a resource in the filesystem of container `id`.
-
-**Query parameters**:
-
-- **path** - resource in the container's filesystem to archive. Required.
-
-    If not an absolute path, it is relative to the container's root directory.
-    The resource specified by **path** must exist. To assert that the resource
-    is expected to be a directory, **path** should end in `/` or  `/.`
-    (assuming a path separator of `/`). If **path** ends in `/.` then this
-    indicates that only the contents of the **path** directory should be
-    copied. A symlink is always resolved to its target.
-
-    > **Note**: It is not possible to copy certain system files such as resources
-    > under `/proc`, `/sys`, `/dev`, and mounts created by the user in the
-    > container.
-
-**Example request**:
-
-    GET /v1.25/containers/8cce319429b2/archive?path=/root HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/x-tar
-    X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0=
-
-    {% raw %}
-    {{ TAR STREAM }}
-    {% endraw %}
-
-On success, a response header `X-Docker-Container-Path-Stat` will be set to a
-base64-encoded JSON object containing some filesystem header information about
-the archived resource. The above example value would decode to the following
-JSON object (whitespace added for readability):
-
-```json
-{
-    "name": "root",
-    "size": 4096,
-    "mode": 2147484096,
-    "mtime": "2014-02-27T20:51:23Z",
-    "linkTarget": ""
-}
-```
-
-A `HEAD` request can also be made to this endpoint if only this information is
-desired.
-
-**Status codes**:
-
-- **200** - success, returns archive of copied resource
-- **400** - client error, bad parameter, details in JSON response body, one of:
-    - must specify path parameter (**path** cannot be empty)
-    - not a directory (**path** was asserted to be a directory but exists as a
-      file)
-- **404** - client error, resource not found, one of:
-    – no such container (container `id` does not exist)
-    - no such file or directory (**path** does not exist)
-- **500** - server error
-
-### Extract an archive of files or folders to a directory in a container
-
-`PUT /containers/(id or name)/archive`
-
-Upload a tar archive to be extracted to a path in the filesystem of container
-`id`.
-
-**Query parameters**:
-
-- **path** - path to a directory in the container
-    to extract the archive's contents into. Required.
-
-    If not an absolute path, it is relative to the container's root directory.
-    The **path** resource must exist.
-- **noOverwriteDirNonDir** - If "1", "true", or "True" then it will be an error
-    if unpacking the given content would cause an existing directory to be
-    replaced with a non-directory and vice versa.
-
-**Example request**:
-
-    PUT /v1.25/containers/8cce319429b2/archive?path=/vol1 HTTP/1.1
-    Content-Type: application/x-tar
-
-    {% raw %}
-    {{ TAR STREAM }}
-    {% endraw %}
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-
-**Status codes**:
-
-- **200** – the content was extracted successfully
-- **400** - client error, bad parameter, details in JSON response body, one of:
-    - must specify path parameter (**path** cannot be empty)
-    - not a directory (**path** should be a directory but exists as a file)
-    - unable to overwrite existing directory with non-directory
-      (if **noOverwriteDirNonDir**)
-    - unable to overwrite existing non-directory with directory
-      (if **noOverwriteDirNonDir**)
-- **403** - client error, permission denied, the volume
-    or container rootfs is marked as read-only.
-- **404** - client error, resource not found, one of:
-    – no such container (container `id` does not exist)
-    - no such file or directory (**path** resource does not exist)
-- **500** – server error
-
-
-### Prune stopped containers
-
-`POST /containers/prune`
-
-Delete stopped containers
-
-**Example request**:
-
-    POST /v1.25/containers/prune HTTP/1.1
-    Content-Type: application/json
-
-    {
-    }
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {
-        "ContainersDeleted": [
-            "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148"
-        ],
-        "SpaceReclaimed": 109
-    }
-
-**Status codes**:
-
--   **200** – no error
--   **500** – server error
-
-## 3.2 Images
-
-### List Images
-
-`GET /images/json`
-
-**Example request**:
-
-    GET /v1.25/images/json?all=0 HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    [
-      {
-         "RepoTags": [
-           "ubuntu:12.04",
-           "ubuntu:precise",
-           "ubuntu:latest"
-         ],
-         "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c",
-         "Created": 1365714795,
-         "Size": 131506275,
-         "VirtualSize": 131506275,
-         "Labels": {}
-      },
-      {
-         "RepoTags": [
-           "ubuntu:12.10",
-           "ubuntu:quantal"
-         ],
-         "ParentId": "27cf784147099545",
-         "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc",
-         "Created": 1364102658,
-         "Size": 24653,
-         "VirtualSize": 180116135,
-         "Labels": {
-            "com.example.version": "v1"
-         }
-      }
-    ]
-
-**Example request, with digest information**:
-
-    GET /v1.25/images/json?digests=1 HTTP/1.1
-
-**Example response, with digest information**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    [
-      {
-        "Created": 1420064636,
-        "Id": "4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125",
-        "ParentId": "ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2",
-        "RepoDigests": [
-          "localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf"
-        ],
-        "RepoTags": [
-          "localhost:5000/test/busybox:latest",
-          "playdate:latest"
-        ],
-        "Size": 0,
-        "VirtualSize": 2429728,
-        "Labels": {}
-      }
-    ]
-
-The response shows a single image `Id` associated with two repositories
-(`RepoTags`): `localhost:5000/test/busybox`: and `playdate`. A caller can use
-either of the `RepoTags` values `localhost:5000/test/busybox:latest` or
-`playdate:latest` to reference the image.
-
-You can also use `RepoDigests` values to reference an image. In this response,
-the array has only one reference and that is to the
-`localhost:5000/test/busybox` repository; the `playdate` repository has no
-digest. You can reference this digest using the value:
-`localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d...`
-
-See the `docker run` and `docker build` commands for examples of digest and tag
-references on the command line.
-
-**Query parameters**:
-
--   **all** – 1/True/true or 0/False/false, default false
--   **filters** – a JSON encoded value of the filters (a map[string][]string) to process on the images list. Available filters:
-  -   `dangling=true`
-  -   `label=key` or `label="key=value"` of an image label
-  -   `before`=(`<image-name>[:<tag>]`,  `<image id>` or `<image@digest>`)
-  -   `since`=(`<image-name>[:<tag>]`,  `<image id>` or `<image@digest>`)
-  -   `reference`=(`<image-name>[:<tag>]`)
-
-### Build image from a Dockerfile
-
-`POST /build`
-
-Build an image from a Dockerfile
-
-**Example request**:
-
-    POST /v1.25/build HTTP/1.1
-
-    {% raw %}
-    {{ TAR STREAM }}
-    {% endraw %}
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {"stream": "Step 1/5..."}
-    {"stream": "..."}
-    {"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}}
-
-The input stream must be a `tar` archive compressed with one of the
-following algorithms: `identity` (no compression), `gzip`, `bzip2`, `xz`.
-
-The archive must include a build instructions file, typically called
-`Dockerfile` at the archive's root. The `dockerfile` parameter may be
-used to specify a different build instructions file. To do this, its value must be
-the path to the alternate build instructions file to use.
-
-The archive may include any number of other files,
-which are accessible in the build context (See the [*ADD build
-command*](../../reference/builder.md#add)).
-
-The Docker daemon performs a preliminary validation of the `Dockerfile` before
-starting the build, and returns an error if the syntax is incorrect. After that,
-each instruction is run one-by-one until the ID of the new image is output.
-
-The build is canceled if the client drops the connection by quitting
-or being killed.
-
-**Query parameters**:
-
--   **dockerfile** - Path within the build context to the `Dockerfile`. This is
-        ignored if `remote` is specified and points to an external `Dockerfile`.
--   **t** – A name and optional tag to apply to the image in the `name:tag` format.
-        If you omit the `tag` the default `latest` value is assumed.
-        You can provide one or more `t` parameters.
--   **remote** – A Git repository URI or HTTP/HTTPS context URI. If the
-        URI points to a single text file, the file's contents are placed into
-        a file called `Dockerfile` and the image is built from that file. If
-        the URI points to a tarball, the file is downloaded by the daemon and
-        the contents therein used as the context for the build. If the URI
-        points to a tarball and the `dockerfile` parameter is also specified,
-        there must be a file with the corresponding path inside the tarball.
--   **q** – Suppress verbose build output.
--   **nocache** – Do not use the cache when building the image.
--   **cachefrom** - JSON array of images used for build cache resolution.
--   **pull** - Attempt to pull the image even if an older image exists locally.
--   **rm** - Remove intermediate containers after a successful build (default behavior).
--   **forcerm** - Always remove intermediate containers (includes `rm`).
--   **memory** - Set memory limit for build.
--   **memswap** - Total memory (memory + swap), `-1` to enable unlimited swap.
--   **cpushares** - CPU shares (relative weight).
--   **cpusetcpus** - CPUs in which to allow execution (e.g., `0-3`, `0,1`).
--   **cpuperiod** - The length of a CPU period in microseconds.
--   **cpuquota** - Microseconds of CPU time that the container can get in a CPU period.
--   **buildargs** – JSON map of string pairs for build-time variables. Users pass
-        these values at build-time. Docker uses the `buildargs` as the environment
-        context for command(s) run via the Dockerfile's `RUN` instruction or for
-        variable expansion in other Dockerfile instructions. This is not meant for
-        passing secret values. [Read more about the buildargs instruction](../../reference/builder.md#arg)
--   **shmsize** - Size of `/dev/shm` in bytes. The size must be greater than 0.  If omitted the system uses 64MB.
--   **squash** - squash the resulting images layers into a single layer (boolean) **Experimental Only**
--   **labels** – JSON map of string pairs for labels to set on the image.
--   **networkmode** - Sets the networking mode for the run commands during
-        build. Supported standard values are: `bridge`, `host`, `none`, and
-        `container:<name|id>`. Any other value is taken as a custom network's
-        name to which this container should connect to.
-
-
-**Request Headers**:
-
--   **Content-type** – Set to `"application/tar"`.
--   **X-Registry-Config** – A base64-url-safe-encoded Registry Auth Config JSON
-        object with the following structure:
-
-            {
-                "docker.example.com": {
-                    "username": "janedoe",
-                    "password": "hunter2"
-                },
-                "https://index.docker.io/v1/": {
-                    "username": "mobydock",
-                    "password": "conta1n3rize14"
-                }
-            }
-
-    This object maps the hostname of a registry to an object containing the
-    "username" and "password" for that registry. Multiple registries may
-    be specified as the build may be based on an image requiring
-    authentication to pull from any arbitrary registry. Only the registry
-    domain name (and port if not the default "443") are required. However
-    (for legacy reasons) the "official" Docker, Inc. hosted registry must
-    be specified with both a "https://" prefix and a "/v1/" suffix even
-    though Docker will prefer to use the v2 registry API.
-
-**Status codes**:
-
--   **200** – no error
--   **500** – server error
-
-### Create an image
-
-`POST /images/create`
-
-Create an image either by pulling it from the registry or by importing it
-
-**Example request**:
-
-    POST /v1.25/images/create?fromImage=busybox&tag=latest HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {"status":"Pulling from library/busybox","id":"latest"}
-    {"status":"Pulling fs layer","progressDetail":{},"id":"8ddc19f16526"}
-    {"status":"Downloading","progressDetail":{"current":15881,"total":667590},"progress":"[=\u003e                                                 ] 15.88 kB/667.6 kB","id":"8ddc19f16526"}
-    {"status":"Downloading","progressDetail":{"current":556269,"total":667590},"progress":"[=========================================\u003e         ] 556.3 kB/667.6 kB","id":"8ddc19f16526"}
-    {"status":"Download complete","progressDetail":{},"id":"8ddc19f16526"}
-    {"status":"Extracting","progressDetail":{"current":32768,"total":667590},"progress":"[==\u003e                                                ] 32.77 kB/667.6 kB","id":"8ddc19f16526"}
-    {"status":"Extracting","progressDetail":{"current":491520,"total":667590},"progress":"[====================================\u003e              ] 491.5 kB/667.6 kB","id":"8ddc19f16526"}
-    {"status":"Extracting","progressDetail":{"current":667590,"total":667590},"progress":"[==================================================\u003e] 667.6 kB/667.6 kB","id":"8ddc19f16526"}
-    {"status":"Extracting","progressDetail":{"current":667590,"total":667590},"progress":"[==================================================\u003e] 667.6 kB/667.6 kB","id":"8ddc19f16526"}
-    {"status":"Pull complete","progressDetail":{},"id":"8ddc19f16526"}
-    {"status":"Digest: sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6"}
-    {"status":"Status: Downloaded newer image for busybox:latest"}
-    ...
-
-When using this endpoint to pull an image from the registry, the
-`X-Registry-Auth` header can be used to include
-a base64-encoded AuthConfig object.
-
-**Query parameters**:
-
--   **fromImage** – Name of the image to pull. The name may include a tag or
-        digest. This parameter may only be used when pulling an image.
-        The pull is cancelled if the HTTP connection is closed.
--   **fromSrc** – Source to import.  The value may be a URL from which the image
-        can be retrieved or `-` to read the image from the request body.
-        This parameter may only be used when importing an image.
--   **repo** – Repository name given to an image when it is imported.
-        The repo may include a tag. This parameter may only be used when importing
-        an image.
--   **tag** – Tag or digest. If empty when pulling an image, this causes all tags
-        for the given image to be pulled.
-
-**Request Headers**:
-
--   **X-Registry-Auth** – base64-encoded AuthConfig object, containing either login information, or a token
-    - Credential based login:
-
-        ```
-    {
-            "username": "jdoe",
-            "password": "secret",
-            "email": "jdoe@acme.com"
-    }
-        ```
-
-    - Token based login:
-
-        ```
-    {
-            "identitytoken": "9cbaf023786cd7..."
-    }
-        ```
-
-**Status codes**:
-
--   **200** – no error
--   **500** – server error
-
-
-
-### Inspect an image
-
-`GET /images/(name)/json`
-
-Return low-level information on the image `name`
-
-**Example request**:
-
-    GET /v1.25/images/example/json HTTP/1.1
-
-**Example response (Linux daemon)**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {
-       "Id" : "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c",
-       "Container" : "cb91e48a60d01f1e27028b4fc6819f4f290b3cf12496c8176ec714d0d390984a",
-       "Comment" : "",
-       "Os" : "linux",
-       "Architecture" : "amd64",
-       "Parent" : "sha256:91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c",
-       "ContainerConfig" : {
-          "Tty" : false,
-          "Hostname" : "e611e15f9c9d",
-          "Volumes" : null,
-          "Domainname" : "",
-          "AttachStdout" : false,
-          "PublishService" : "",
-          "AttachStdin" : false,
-          "OpenStdin" : false,
-          "StdinOnce" : false,
-          "NetworkDisabled" : false,
-          "OnBuild" : [],
-          "Image" : "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c",
-          "User" : "",
-          "WorkingDir" : "",
-          "Entrypoint" : null,
-          "MacAddress" : "",
-          "AttachStderr" : false,
-          "Labels" : {
-             "com.example.license" : "GPL",
-             "com.example.version" : "1.0",
-             "com.example.vendor" : "Acme"
-          },
-          "Env" : [
-             "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
-          ],
-          "ExposedPorts" : null,
-          "Cmd" : [
-             "/bin/sh",
-             "-c",
-             "#(nop) LABEL com.example.vendor=Acme com.example.license=GPL com.example.version=1.0"
-          ]
-       },
-       "DockerVersion" : "1.9.0-dev",
-       "VirtualSize" : 188359297,
-       "Size" : 0,
-       "Author" : "",
-       "Created" : "2015-09-10T08:30:53.26995814Z",
-       "GraphDriver" : {
-          "Name" : "aufs",
-          "Data" : null
-       },
-       "RepoDigests" : [
-          "localhost:5000/test/busybox/example@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf"
-       ],
-       "RepoTags" : [
-          "example:1.0",
-          "example:latest",
-          "example:stable"
-       ],
-       "Config" : {
-          "Image" : "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c",
-          "NetworkDisabled" : false,
-          "OnBuild" : [],
-          "StdinOnce" : false,
-          "PublishService" : "",
-          "AttachStdin" : false,
-          "OpenStdin" : false,
-          "Domainname" : "",
-          "AttachStdout" : false,
-          "Tty" : false,
-          "Hostname" : "e611e15f9c9d",
-          "Volumes" : null,
-          "Cmd" : [
-             "/bin/bash"
-          ],
-          "ExposedPorts" : null,
-          "Env" : [
-             "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
-          ],
-          "Labels" : {
-             "com.example.vendor" : "Acme",
-             "com.example.version" : "1.0",
-             "com.example.license" : "GPL"
-          },
-          "Entrypoint" : null,
-          "MacAddress" : "",
-          "AttachStderr" : false,
-          "WorkingDir" : "",
-          "User" : ""
-       },
-       "RootFS": {
-           "Type": "layers",
-           "Layers": [
-               "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6",
-               "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef"
-           ]
-       }
-    }
-
-**Example response (Windows daemon)**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    [
-        {
-            "Id": "sha256:105d76d0f40e38427c63023ffe649bf36fa85058d3469551e43e4dcc2431fb31",
-            "RepoTags": [
-                "microsoft/nanoserver:latest"
-            ],
-            "RepoDigests": [
-                "microsoft/nanoserver@sha256:aee7d4330fe3dc5987c808f647441c16ed2fa1c7d9c6ef49d6498e5c9860b50b"
-            ],
-            "Parent": "",
-            "Comment": "",
-            "Created": "2016-09-22T02:39:30.9154862-07:00",
-            "Container": "",
-            "ContainerConfig": {
-                "Hostname": "",
-                "Domainname": "",
-                "User": "",
-                "AttachStdin": false,
-                "AttachStdout": false,
-                "AttachStderr": false,
-                "Tty": false,
-                "OpenStdin": false,
-                "StdinOnce": false,
-                "Env": null,
-                "Cmd": null,
-                "Image": "",
-                "Volumes": null,
-                "WorkingDir": "",
-                "Entrypoint": null,
-                "OnBuild": null,
-                "Labels": null
-            },
-            "DockerVersion": "",
-            "Author": "",
-            "Config": {
-                "Hostname": "",
-                "Domainname": "",
-                "User": "",
-                "AttachStdin": false,
-                "AttachStdout": false,
-                "AttachStderr": false,
-                "Tty": false,
-                "OpenStdin": false,
-                "StdinOnce": false,
-                "Env": null,
-                "Cmd": [
-                    "c:\\windows\\system32\\cmd.exe"
-                ],
-                "Image": "",
-                "Volumes": null,
-                "WorkingDir": "",
-                "Entrypoint": null,
-                "OnBuild": null,
-                "Labels": null
-            },
-            "Architecture": "",
-            "Os": "windows",
-            "OsVersion": "10.0.14393",
-            "Size": 651862727,
-            "VirtualSize": 651862727,
-            "GraphDriver": {
-                "Name": "windowsfilter",
-                "Data": {
-                    "dir": "C:\\control\\windowsfilter\\6fe6a289b98276a6a5ca0345156ca61d7b38f3da6bb49ef95af1d0f1ac37e5bf"
-                }
-            },
-            "RootFS": {
-                "Type": "layers",
-                "Layers": [
-                    "sha256:342d4e407550c52261edd20cd901b5ce438f0b1e940336de3978210612365063"
-                ]
-            }
-        }
-    ]
-
-**Status codes**:
-
--   **200** – no error
--   **404** – no such image
--   **500** – server error
-
-### Get the history of an image
-
-`GET /images/(name)/history`
-
-Return the history of the image `name`
-
-**Example request**:
-
-    GET /v1.25/images/ubuntu/history HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    [
-        {
-            "Id": "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710",
-            "Created": 1398108230,
-            "CreatedBy": "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /",
-            "Tags": [
-                "ubuntu:lucid",
-                "ubuntu:10.04"
-            ],
-            "Size": 182964289,
-            "Comment": ""
-        },
-        {
-            "Id": "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8",
-            "Created": 1398108222,
-            "CreatedBy": "/bin/sh -c #(nop) MAINTAINER Tianon Gravi <admwiggin@gmail.com> - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/",
-            "Tags": null,
-            "Size": 0,
-            "Comment": ""
-        },
-        {
-            "Id": "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158",
-            "Created": 1371157430,
-            "CreatedBy": "",
-            "Tags": [
-                "scratch12:latest",
-                "scratch:latest"
-            ],
-            "Size": 0,
-            "Comment": "Imported from -"
-        }
-    ]
-
-**Status codes**:
-
--   **200** – no error
--   **404** – no such image
--   **500** – server error
-
-### Push an image on the registry
-
-`POST /images/(name)/push`
-
-Push the image `name` on the registry
-
-**Example request**:
-
-    POST /v1.25/images/test/push HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {"status": "Pushing..."}
-    {"status": "Pushing", "progress": "1/? (n/a)", "progressDetail": {"current": 1}}}
-    {"error": "Invalid..."}
-    ...
-
-If you wish to push an image on to a private registry, that image must already have a tag
-into a repository which references that registry `hostname` and `port`.  This repository name should
-then be used in the URL. This duplicates the command line's flow.
-
-The push is cancelled if the HTTP connection is closed.
-
-**Example request**:
-
-    POST /v1.25/images/registry.acme.com:5000/test/push HTTP/1.1
-
-
-**Query parameters**:
-
--   **tag** – The tag to associate with the image on the registry. This is optional.
-
-**Request Headers**:
-
--   **X-Registry-Auth** – base64-encoded AuthConfig object, containing either login information, or a token
-    - Credential based login:
-
-        ```
-    {
-            "username": "jdoe",
-            "password": "secret",
-            "email": "jdoe@acme.com",
-    }
-        ```
-
-    - Identity token based login:
-
-        ```
-    {
-            "identitytoken": "9cbaf023786cd7..."
-    }
-        ```
-
-**Status codes**:
-
--   **200** – no error
--   **404** – no such image
--   **500** – server error
-
-### Tag an image into a repository
-
-`POST /images/(name)/tag`
-
-Tag the image `name` into a repository
-
-**Example request**:
-
-    POST /v1.25/images/test/tag?repo=myrepo&tag=v42 HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 201 Created
-
-**Query parameters**:
-
--   **repo** – The repository to tag in
--   **tag** - The new tag name
-
-**Status codes**:
-
--   **201** – no error
--   **400** – bad parameter
--   **404** – no such image
--   **409** – conflict
--   **500** – server error
-
-### Remove an image
-
-`DELETE /images/(name)`
-
-Remove the image `name` from the filesystem
-
-**Example request**:
-
-    DELETE /v1.25/images/test HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-type: application/json
-
-    [
-     {"Untagged": "3e2f21a89f"},
-     {"Deleted": "3e2f21a89f"},
-     {"Deleted": "53b4f83ac9"}
-    ]
-
-**Query parameters**:
-
--   **force** – 1/True/true or 0/False/false, default false
--   **noprune** – 1/True/true or 0/False/false, default false
-
-**Status codes**:
-
--   **200** – no error
--   **404** – no such image
--   **409** – conflict
--   **500** – server error
-
-### Search images
-
-`GET /images/search`
-
-Search for an image on [Docker Hub](https://hub.docker.com).
-
-> **Note**:
-> The response keys have changed from API v1.6 to reflect the JSON
-> sent by the registry server to the docker daemon's request.
-
-**Example request**:
-
-    GET /v1.25/images/search?term=sshd HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    [
-            {
-                "description": "",
-                "is_official": false,
-                "is_automated": false,
-                "name": "wma55/u1210sshd",
-                "star_count": 0
-            },
-            {
-                "description": "",
-                "is_official": false,
-                "is_automated": false,
-                "name": "jdswinbank/sshd",
-                "star_count": 0
-            },
-            {
-                "description": "",
-                "is_official": false,
-                "is_automated": false,
-                "name": "vgauthier/sshd",
-                "star_count": 0
-            }
-    ...
-    ]
-
-**Query parameters**:
-
--   **term** – term to search
--   **limit** – maximum returned search results
--   **filters** – a JSON encoded value of the filters (a map[string][]string) to process on the images list. Available filters:
-  -   `stars=<number>`
-  -   `is-automated=(true|false)`
-  -   `is-official=(true|false)`
-
-**Status codes**:
-
--   **200** – no error
--   **500** – server error
-
-### Prune unused images
-
-`POST /images/prune`
-
-Delete unused images
-
-**Example request**:
-
-    POST /v1.25/images/prune HTTP/1.1
-    Content-Type: application/json
-
-    {
-        "DanglingOnly": false
-    }
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {
-        "ImagesDeleted": [
-            {
-                "Untagged": "busybox:latest"
-            },
-            {
-                "Untagged": "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6"
-            },
-            {
-                "Deleted": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749"
-            },
-            {
-                "Deleted": "sha256:8ac8bfaff55af948c796026ee867448c5b5b5d9dd3549f4006d9759b25d4a893"
-            }
-        ],
-        "SpaceReclaimed": 1092588
-    }
-
-**JSON parameters**:
-
-- **DanglingOnly**: if `true` only delete unused *and* untagged images. Default to `false` if omitted
-
-**Status codes**:
-
--   **200** – no error
--   **500** – server error
-
-
-## 3.3 Misc
-
-### Check auth configuration
-
-`POST /auth`
-
-Validate credentials for a registry and get identity token,
-if available, for accessing the registry without password.
-
-**Example request**:
-
-    POST /v1.25/auth HTTP/1.1
-    Content-Type: application/json
-
-    {
-         "username": "hannibal",
-         "password": "xxxx",
-         "serveraddress": "https://index.docker.io/v1/"
-    }
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-
-    {
-         "Status": "Login Succeeded",
-         "IdentityToken": "9cbaf023786cd7..."
-    }
-
-**Status codes**:
-
--   **200** – no error
--   **204** – no error
--   **500** – server error
-
-### Display system-wide information
-
-`GET /info`
-
-Display system-wide information
-
-**Example request**:
-
-    GET /v1.25/info HTTP/1.1
-
-**Example response (Linux)**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {
-        "Architecture": "x86_64",
-        "ClusterStore": "etcd://localhost:2379",
-        "CgroupDriver": "cgroupfs",
-        "Containers": 11,
-        "ContainersRunning": 7,
-        "ContainersStopped": 3,
-        "ContainersPaused": 1,
-        "CpuCfsPeriod": true,
-        "CpuCfsQuota": true,
-        "Debug": false,
-        "DockerRootDir": "/var/lib/docker",
-        "Driver": "btrfs",
-        "DriverStatus": [[""]],
-        "ExperimentalBuild": false,
-        "HttpProxy": "http://test:test@localhost:8080",
-        "HttpsProxy": "https://test:test@localhost:8080",
-        "ID": "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS",
-        "IPv4Forwarding": true,
-        "Images": 16,
-        "IndexServerAddress": "https://index.docker.io/v1/",
-        "InitPath": "/usr/bin/docker",
-        "InitSha1": "",
-        "KernelMemory": true,
-        "KernelVersion": "3.12.0-1-amd64",
-        "Labels": [
-            "storage=ssd"
-        ],
-        "MemTotal": 2099236864,
-        "MemoryLimit": true,
-        "NCPU": 1,
-        "NEventsListener": 0,
-        "NFd": 11,
-        "NGoroutines": 21,
-        "Name": "prod-server-42",
-        "NoProxy": "9.81.1.160",
-        "OomKillDisable": true,
-        "OSType": "linux",
-        "OperatingSystem": "Boot2Docker",
-        "Plugins": {
-            "Volume": [
-                "local"
-            ],
-            "Network": [
-                "null",
-                "host",
-                "bridge"
-            ]
-        },
-        "RegistryConfig": {
-            "IndexConfigs": {
-                "docker.io": {
-                    "Mirrors": null,
-                    "Name": "docker.io",
-                    "Official": true,
-                    "Secure": true
-                }
-            },
-            "InsecureRegistryCIDRs": [
-                "127.0.0.0/8"
-            ]
-        },
-        "SecurityOptions": [
-            {
-                "Key": "Name",
-                "Value": "seccomp"
-            },
-            {
-                "Key": "Profile",
-                "Value": "default"
-            },
-            {
-                "Key": "Name",
-                "Value": "apparmor"
-            },
-            {
-                "Key": "Name",
-                "Value": "selinux"
-            },
-            {
-                "Key": "Name",
-                "Value": "userns"
-            }
-        ],
-        "ServerVersion": "1.9.0",
-        "SwapLimit": false,
-        "SystemStatus": [["State", "Healthy"]],
-        "SystemTime": "2015-03-10T11:11:23.730591467-07:00"
-    }
-
-
-**Example response (Windows)**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {
-        "ID": "NYMS:B5VK:UMSL:FVDZ:EWB5:FKVK:LPFL:FJMQ:H6FT:BZJ6:L2TD:XH62",
-        "Containers": 1,
-        "ContainersRunning": 0,
-        "ContainersPaused": 0,
-        "ContainersStopped": 1,
-        "Images": 17,
-        "Driver": "windowsfilter",
-        "DriverStatus": [
-            ["Windows", ""]
-        ],
-        "SystemStatus": null,
-            "Plugins": {
-                "Volume": ["local"],
-                "Network": ["nat", "null", "overlay"],
-                "Authorization": null
-            },
-        "MemoryLimit": false,
-        "SwapLimit": false,
-        "KernelMemory": false,
-        "CpuCfsPeriod": false,
-        "CpuCfsQuota": false,
-        "CPUShares": false,
-        "CPUSet": false,
-        "IPv4Forwarding": true,
-        "BridgeNfIptables": true,
-        "BridgeNfIp6tables": true,
-        "Debug": false,
-        "NFd": -1,
-        "OomKillDisable": false,
-        "NGoroutines": 11,
-        "SystemTime": "2016-09-23T11:59:58.9843533-07:00",
-        "LoggingDriver": "json-file",
-        "CgroupDriver": "",
-        "NEventsListener": 0,
-        "KernelVersion": "10.0 14393 (14393.206.amd64fre.rs1_release.160912-1937)",
-        "OperatingSystem": "Windows Server 2016 Datacenter",
-        "OSType": "windows",
-        "Architecture": "x86_64",
-        "IndexServerAddress": "https://index.docker.io/v1/",
-        "RegistryConfig": {
-                "InsecureRegistryCIDRs": ["127.0.0.0/8"],
-                "IndexConfigs": {
-                    "docker.io": {
-                        "Name": "docker.io",
-                        "Mirrors": null,
-                        "Secure": true,
-                        "Official": true
-                    }
-                },
-                "Mirrors": null
-        },
-        "NCPU": 8,
-        "MemTotal": 4293828608,
-        "DockerRootDir": "C:\\control",
-        "HttpProxy": "",
-        "HttpsProxy": "",
-        "NoProxy": "",
-        "Name": "WIN-V0V70C0LU5P",
-        "Labels": null,
-        "ExperimentalBuild": false,
-        "ServerVersion": "1.13.0",
-        "ClusterStore": "",
-        "ClusterAdvertise": "",
-        "SecurityOptions": null,
-        "Runtimes": null,
-        "DefaultRuntime": "",
-        "Swarm": {
-            "NodeID": "",
-            "NodeAddr": "",
-            "LocalNodeState": "inactive",
-            "ControlAvailable": false,
-            "Error": "",
-            "RemoteManagers": null,
-            "Nodes": 0,
-            "Managers": 0,
-            "Cluster": {
-                "ID": "",
-                "Version": {},
-                "CreatedAt": "0001-01-01T00:00:00Z",
-                "UpdatedAt": "0001-01-01T00:00:00Z",
-                "Spec": {
-                    "Orchestration": {},
-                    "Raft": {
-                        "ElectionTick": 0,
-                        "HeartbeatTick": 0
-                    },
-                    "Dispatcher": {},
-                    "CAConfig": {},
-                    "TaskDefaults": {}
-                }
-            }
-        },
-        "LiveRestoreEnabled": false,
-        "Isolation": "process"
-    }
-
-**Status codes**:
-
--   **200** – no error
--   **500** – server error
-
-### Show docker data usage information
-
-`GET /system/df`
-
-Return docker data usage information
-
-**Example request**:
-
-    GET /v1.25/system/df HTTP/1.1
-
-**Example response**:
-
-    {
-        "LayersSize": 1092588,
-        "Images": [
-            {
-                "Id": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749",
-                "ParentId": "",
-                "RepoTags": [
-                    "busybox:latest"
-                ],
-                "RepoDigests": [
-                    "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6"
-                ],
-                "Created": 1466724217,
-                "Size": 1092588,
-                "SharedSize": 0,
-                "VirtualSize": 1092588,
-                "Labels": {},
-                "Containers": 1
-            }
-        ],
-        "Containers": [
-            {
-                "Id": "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148",
-                "Names": [
-                    "/top"
-                ],
-                "Image": "busybox",
-                "ImageID": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749",
-                "Command": "top",
-                "Created": 1472592424,
-                "Ports": [],
-                "SizeRootFs": 1092588,
-                "Labels": {},
-                "State": "exited",
-                "Status": "Exited (0) 56 minutes ago",
-                "HostConfig": {
-                    "NetworkMode": "default"
-                },
-                "NetworkSettings": {
-                    "Networks": {
-                        "bridge": {
-                            "IPAMConfig": null,
-                            "Links": null,
-                            "Aliases": null,
-                            "NetworkID": "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92",
-                            "EndpointID": "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a",
-                            "Gateway": "172.18.0.1",
-                            "IPAddress": "172.18.0.2",
-                            "IPPrefixLen": 16,
-                            "IPv6Gateway": "",
-                            "GlobalIPv6Address": "",
-                            "GlobalIPv6PrefixLen": 0,
-                            "MacAddress": "02:42:ac:12:00:02"
-                        }
-                    }
-                },
-                "Mounts": []
-            }
-        ],
-        "Volumes": [
-                {
-                    "Name": "my-volume",
-                    "Driver": "local",
-                    "Mountpoint": "",
-                    "Labels": null,
-                    "Scope": "",
-                    "Options": null
-                    "UsageData": {
-                        "Size": 0,
-                        "RefCount": 0
-                    }
-                }
-        ]
-    }
-
-**Status codes**:
-
--   **200** – no error
--   **500** – server error
-
-### Show the docker version information
-
-`GET /version`
-
-Show the docker version information
-
-**Example request**:
-
-    GET /v1.25/version HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {
-         "Version": "1.13.0",
-         "Os": "linux",
-         "KernelVersion": "3.19.0-23-generic",
-         "GoVersion": "go1.6.3",
-         "GitCommit": "deadbee",
-         "Arch": "amd64",
-         "ApiVersion": "1.25",
-         "MinAPIVersion": "1.12",
-         "BuildTime": "2016-06-14T07:09:13.444803460+00:00",
-         "Experimental": true
-    }
-
-**Status codes**:
-
--   **200** – no error
--   **500** – server error
-
-### Ping the docker server
-
-`GET /_ping`
-
-Ping the docker server
-
-**Example request**:
-
-    GET /v1.25/_ping HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: text/plain
-
-    OK
-
-**Status codes**:
-
--   **200** - no error
--   **500** - server error
-
-### Create a new image from a container's changes
-
-`POST /commit`
-
-Create a new image from a container's changes
-
-**Example request**:
-
-    POST /v1.25/commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1
-    Content-Type: application/json
-
-    {
-         "Hostname": "",
-         "Domainname": "",
-         "User": "",
-         "AttachStdin": false,
-         "AttachStdout": true,
-         "AttachStderr": true,
-         "Tty": false,
-         "OpenStdin": false,
-         "StdinOnce": false,
-         "Env": null,
-         "Cmd": [
-                 "date"
-         ],
-         "Mounts": [
-           {
-             "Source": "/data",
-             "Destination": "/data",
-             "Mode": "ro,Z",
-             "RW": false
-           }
-         ],
-         "Labels": {
-                 "key1": "value1",
-                 "key2": "value2"
-          },
-         "WorkingDir": "",
-         "NetworkDisabled": false,
-         "ExposedPorts": {
-                 "22/tcp": {}
-         }
-    }
-
-**Example response**:
-
-    HTTP/1.1 201 Created
-    Content-Type: application/json
-
-    {"Id": "596069db4bf5"}
-
-**JSON parameters**:
-
--  **config** - the container's configuration
-
-**Query parameters**:
-
--   **container** – source container
--   **repo** – repository
--   **tag** – tag
--   **comment** – commit message
--   **author** – author (e.g., "John Hannibal Smith
-    <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>")
--   **pause** – 1/True/true or 0/False/false, whether to pause the container before committing
--   **changes** – Dockerfile instructions to apply while committing
-
-**Status codes**:
-
--   **201** – no error
--   **404** – no such container
--   **500** – server error
-
-### Monitor Docker's events
-
-`GET /events`
-
-Get container events from docker, in real time via streaming.
-
-Docker containers report the following events:
-
-    attach, commit, copy, create, destroy, detach, die, exec_create, exec_detach, exec_start, export, kill, oom, pause, rename, resize, restart, start, stop, top, unpause, update
-
-Docker images report the following events:
-
-    delete, import, load, pull, push, save, tag, untag
-
-Docker volumes report the following events:
-
-    create, mount, unmount, destroy
-
-Docker networks report the following events:
-
-    create, connect, disconnect, destroy
-
-Docker daemon report the following event:
-
-    reload
-
-**Example request**:
-
-    GET /v1.25/events?since=1374067924
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-    Server: Docker/1.13.0 (linux)
-    Date: Fri, 29 Apr 2016 15:18:06 GMT
-    Transfer-Encoding: chunked
-
-    {
-      "status": "pull",
-      "id": "alpine:latest",
-      "Type": "image",
-      "Action": "pull",
-      "Actor": {
-        "ID": "alpine:latest",
-        "Attributes": {
-          "name": "alpine"
-        }
-      },
-      "time": 1461943101,
-      "timeNano": 1461943101301854122
-    }
-    {
-      "status": "create",
-      "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
-      "from": "alpine",
-      "Type": "container",
-      "Action": "create",
-      "Actor": {
-        "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
-        "Attributes": {
-          "com.example.some-label": "some-label-value",
-          "image": "alpine",
-          "name": "my-container"
-        }
-      },
-      "time": 1461943101,
-      "timeNano": 1461943101381709551
-    }
-    {
-      "status": "attach",
-      "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
-      "from": "alpine",
-      "Type": "container",
-      "Action": "attach",
-      "Actor": {
-        "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
-        "Attributes": {
-          "com.example.some-label": "some-label-value",
-          "image": "alpine",
-          "name": "my-container"
-        }
-      },
-      "time": 1461943101,
-      "timeNano": 1461943101383858412
-    }
-    {
-      "Type": "network",
-      "Action": "connect",
-      "Actor": {
-        "ID": "7dc8ac97d5d29ef6c31b6052f3938c1e8f2749abbd17d1bd1febf2608db1b474",
-        "Attributes": {
-          "container": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
-          "name": "bridge",
-          "type": "bridge"
-        }
-      },
-      "time": 1461943101,
-      "timeNano": 1461943101394865557
-    }
-    {
-      "status": "start",
-      "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
-      "from": "alpine",
-      "Type": "container",
-      "Action": "start",
-      "Actor": {
-        "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
-        "Attributes": {
-          "com.example.some-label": "some-label-value",
-          "image": "alpine",
-          "name": "my-container"
-        }
-      },
-      "time": 1461943101,
-      "timeNano": 1461943101607533796
-    }
-    {
-      "status": "resize",
-      "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
-      "from": "alpine",
-      "Type": "container",
-      "Action": "resize",
-      "Actor": {
-        "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
-        "Attributes": {
-          "com.example.some-label": "some-label-value",
-          "height": "46",
-          "image": "alpine",
-          "name": "my-container",
-          "width": "204"
-        }
-      },
-      "time": 1461943101,
-      "timeNano": 1461943101610269268
-    }
-    {
-      "status": "die",
-      "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
-      "from": "alpine",
-      "Type": "container",
-      "Action": "die",
-      "Actor": {
-        "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
-        "Attributes": {
-          "com.example.some-label": "some-label-value",
-          "exitCode": "0",
-          "image": "alpine",
-          "name": "my-container"
-        }
-      },
-      "time": 1461943105,
-      "timeNano": 1461943105079144137
-    }
-    {
-      "Type": "network",
-      "Action": "disconnect",
-      "Actor": {
-        "ID": "7dc8ac97d5d29ef6c31b6052f3938c1e8f2749abbd17d1bd1febf2608db1b474",
-        "Attributes": {
-          "container": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
-          "name": "bridge",
-          "type": "bridge"
-        }
-      },
-      "time": 1461943105,
-      "timeNano": 1461943105230860245
-    }
-    {
-      "status": "destroy",
-      "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
-      "from": "alpine",
-      "Type": "container",
-      "Action": "destroy",
-      "Actor": {
-        "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
-        "Attributes": {
-          "com.example.some-label": "some-label-value",
-          "image": "alpine",
-          "name": "my-container"
-        }
-      },
-      "time": 1461943105,
-      "timeNano": 1461943105338056026
-    }
-
-**Query parameters**:
-
--   **since** – Timestamp. Show all events created since timestamp and then stream
--   **until** – Timestamp. Show events created until given timestamp and stop streaming
--   **filters** – A json encoded value of the filters (a map[string][]string) to process on the event list. Available filters:
-  -   `container=<string>`; -- container to filter
-  -   `event=<string>`; -- event to filter
-  -   `image=<string>`; -- image to filter
-  -   `label=<string>`; -- image and container label to filter
-  -   `type=<string>`; -- either `container` or `image` or `volume` or `network` or `daemon`
-  -   `volume=<string>`; -- volume to filter
-  -   `network=<string>`; -- network to filter
-  -   `daemon=<string>`; -- daemon name or id to filter
-
-**Status codes**:
-
--   **200** – no error
--   **500** – server error
-
-### Get a tarball containing all images in a repository
-
-`GET /images/(name)/get`
-
-Get a tarball containing all images and metadata for the repository specified
-by `name`.
-
-If `name` is a specific name and tag (e.g. ubuntu:latest), then only that image
-(and its parents) are returned. If `name` is an image ID, similarly only that
-image (and its parents) are returned, but with the exclusion of the
-'repositories' file in the tarball, as there were no image names referenced.
-
-See the [image tarball format](#image-tarball-format) for more details.
-
-**Example request**
-
-    GET /v1.25/images/ubuntu/get
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/x-tar
-
-    Binary data stream
-
-**Status codes**:
-
--   **200** – no error
--   **500** – server error
-
-### Get a tarball containing all images
-
-`GET /images/get`
-
-Get a tarball containing all images and metadata for one or more repositories.
-
-For each value of the `names` parameter: if it is a specific name and tag (e.g.
-`ubuntu:latest`), then only that image (and its parents) are returned; if it is
-an image ID, similarly only that image (and its parents) are returned and there
-would be no names referenced in the 'repositories' file for this image ID.
-
-See the [image tarball format](#image-tarball-format) for more details.
-
-**Example request**
-
-    GET /v1.25/images/get?names=myname%2Fmyapp%3Alatest&names=busybox
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/x-tar
-
-    Binary data stream
-
-**Status codes**:
-
--   **200** – no error
--   **500** – server error
-
-### Load a tarball with a set of images and tags into docker
-
-`POST /images/load`
-
-Load a set of images and tags into a Docker repository.
-See the [image tarball format](#image-tarball-format) for more details.
-
-**Example request**
-
-    POST /v1.25/images/load
-    Content-Type: application/x-tar
-
-    Tarball in body
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-    Transfer-Encoding: chunked
-
-    {"status":"Loading layer","progressDetail":{"current":32768,"total":1292800},"progress":"[=                                                 ] 32.77 kB/1.293 MB","id":"8ac8bfaff55a"}
-    {"status":"Loading layer","progressDetail":{"current":65536,"total":1292800},"progress":"[==                                                ] 65.54 kB/1.293 MB","id":"8ac8bfaff55a"}
-    {"status":"Loading layer","progressDetail":{"current":98304,"total":1292800},"progress":"[===                                               ]  98.3 kB/1.293 MB","id":"8ac8bfaff55a"}
-    {"status":"Loading layer","progressDetail":{"current":131072,"total":1292800},"progress":"[=====                                             ] 131.1 kB/1.293 MB","id":"8ac8bfaff55a"}
-    ...
-    {"stream":"Loaded image: busybox:latest\n"}
-
-**Example response**:
-
-If the "quiet" query parameter is set to `true` / `1` (`?quiet=1`), progress
-details are suppressed, and only a confirmation message is returned once the
-action completes.
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-    Transfer-Encoding: chunked
-
-    {"stream":"Loaded image: busybox:latest\n"}
-
-**Query parameters**:
-
--   **quiet** – Boolean value, suppress progress details during load. Defaults
-      to `0` / `false` if omitted.
-
-**Status codes**:
-
--   **200** – no error
--   **500** – server error
-
-### Image tarball format
-
-An image tarball contains one directory per image layer (named using its long ID),
-each containing these files:
-
-- `VERSION`: currently `1.0` - the file format version
-- `json`: detailed layer information, similar to `docker inspect layer_id`
-- `layer.tar`: A tarfile containing the filesystem changes in this layer
-
-The `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories
-for storing attribute changes and deletions.
-
-If the tarball defines a repository, the tarball should also include a `repositories` file at
-the root that contains a list of repository and tag names mapped to layer IDs.
-
-```
-{"hello-world":
-    {"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"}
-}
-```
-
-### Exec Create
-
-`POST /containers/(id or name)/exec`
-
-Sets up an exec instance in a running container `id`
-
-**Example request**:
-
-    POST /v1.25/containers/e90e34656806/exec HTTP/1.1
-    Content-Type: application/json
-
-    {
-      "AttachStdin": true,
-      "AttachStdout": true,
-      "AttachStderr": true,
-      "Cmd": ["sh"],
-      "DetachKeys": "ctrl-p,ctrl-q",
-      "Env": [
-        "FOO=bar",
-        "BAZ=quux"
-      ],
-      "Privileged": true,
-      "Tty": true,
-      "User": "123:456"
-    }
-
-**Example response**:
-
-    HTTP/1.1 201 Created
-    Content-Type: application/json
-
-    {
-         "Id": "f90e34656806",
-         "Warnings":[]
-    }
-
-**JSON parameters**:
-
--   **AttachStdin** - Boolean value, attaches to `stdin` of the `exec` command.
--   **AttachStdout** - Boolean value, attaches to `stdout` of the `exec` command.
--   **AttachStderr** - Boolean value, attaches to `stderr` of the `exec` command.
--   **DetachKeys** – Override the key sequence for detaching a
-        container. Format is a single character `[a-Z]` or `ctrl-<value>`
-        where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`.
--   **Tty** - Boolean value to allocate a pseudo-TTY.
--   **Env** - A list of environment variables in the form of `["VAR=value", ...]`
--   **Cmd** - Command to run specified as a string or an array of strings.
--   **Privileged** - Boolean value, runs the exec process with extended privileges.
--   **User** - A string value specifying the user, and optionally, group to run
-        the exec process inside the container. Format is one of: `"user"`,
-        `"user:group"`, `"uid"`, or `"uid:gid"`.
-
-**Status codes**:
-
--   **201** – no error
--   **404** – no such container
--   **409** - container is paused
--   **500** - server error
-
-### Exec Start
-
-`POST /exec/(id)/start`
-
-Starts a previously set up `exec` instance `id`. If `detach` is true, this API
-returns after starting the `exec` command. Otherwise, this API sets up an
-interactive session with the `exec` command.
-
-**Example request**:
-
-    POST /v1.25/exec/e90e34656806/start HTTP/1.1
-    Content-Type: application/json
-
-    {
-     "Detach": false,
-     "Tty": false
-    }
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/vnd.docker.raw-stream
-
-    {% raw %}
-    {{ STREAM }}
-    {% endraw %}
-
-**JSON parameters**:
-
--   **Detach** - Detach from the `exec` command.
--   **Tty** - Boolean value to allocate a pseudo-TTY.
-
-**Status codes**:
-
--   **200** – no error
--   **404** – no such exec instance
--   **409** - container is paused
-
-**Stream details**:
-
-Similar to the stream behavior of `POST /containers/(id or name)/attach` API
-
-### Exec Resize
-
-`POST /exec/(id)/resize`
-
-Resizes the `tty` session used by the `exec` command `id`.  The unit is number of characters.
-This API is valid only if `tty` was specified as part of creating and starting the `exec` command.
-
-**Example request**:
-
-    POST /v1.25/exec/e90e34656806/resize?h=40&w=80 HTTP/1.1
-    Content-Type: text/plain
-
-**Example response**:
-
-    HTTP/1.1 201 Created
-    Content-Type: text/plain
-
-**Query parameters**:
-
--   **h** – height of `tty` session
--   **w** – width
-
-**Status codes**:
-
--   **201** – no error
--   **404** – no such exec instance
-
-### Exec Inspect
-
-`GET /exec/(id)/json`
-
-Return low-level information about the `exec` command `id`.
-
-**Example request**:
-
-    GET /v1.25/exec/11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39/json HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {
-      "CanRemove": false,
-      "ContainerID": "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126",
-      "DetachKeys": "",
-      "ExitCode": 2,
-      "ID": "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b",
-      "OpenStderr": true,
-      "OpenStdin": true,
-      "OpenStdout": true,
-      "ProcessConfig": {
-        "arguments": [
-          "-c",
-          "exit 2"
-        ],
-        "entrypoint": "sh",
-        "privileged": false,
-        "tty": true,
-        "user": "1000"
-      },
-      "Running": false,
-      "Pid": "42000"
-    }
-
-**Status codes**:
-
--   **200** – no error
--   **404** – no such exec instance
--   **500** - server error
-
-## 3.4 Volumes
-
-### List volumes
-
-`GET /volumes`
-
-**Example request**:
-
-    GET /v1.25/volumes HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {
-      "Volumes": [
-        {
-          "Name": "tardis",
-          "Driver": "local",
-          "Mountpoint": "/var/lib/docker/volumes/tardis",
-          "Labels":{
-            "com.example.some-label": "some-value",
-            "com.example.some-other-label": "some-other-value"
-          },
-          "Scope": "local",
-          "Options": {
-            "device": "tmpfs",
-            "o": "size=100m,uid=1000",
-            "type": "tmpfs"
-          }
-        }
-      ],
-      "Warnings": []
-    }
-
-**Query parameters**:
-
-- **filters** - JSON encoded value of the filters (a `map[string][]string`) to process on the volumes list. Available filters:
-  -   `name=<volume-name>` Matches all or part of a volume name.
-  -   `dangling=<boolean>` When set to `true` (or `1`), returns all volumes that are "dangling" (not in use by a container). When set to `false` (or `0`), only volumes that are in use by one or more containers are returned.
-  -   `driver=<volume-driver-name>` Matches all or part of a volume driver name.
-
-**Status codes**:
-
--   **200** - no error
--   **500** - server error
-
-### Create a volume
-
-`POST /volumes/create`
-
-Create a volume
-
-**Example request**:
-
-    POST /v1.25/volumes/create HTTP/1.1
-    Content-Type: application/json
-
-    {
-      "Name": "tardis",
-      "Labels": {
-        "com.example.some-label": "some-value",
-        "com.example.some-other-label": "some-other-value"
-      },
-      "Driver": "custom"
-    }
-
-**Example response**:
-
-    HTTP/1.1 201 Created
-    Content-Type: application/json
-
-    {
-      "Name": "tardis",
-      "Driver": "custom",
-      "Mountpoint": "/var/lib/docker/volumes/tardis",
-      "Status": {
-        "hello": "world"
-      },
-      "Labels": {
-        "com.example.some-label": "some-value",
-        "com.example.some-other-label": "some-other-value"
-      },
-      "Scope": "local",
-      "Options": null
-    }
-
-**Status codes**:
-
-- **201** - no error
-- **500**  - server error
-
-**JSON parameters**:
-
-- **Name** - The new volume's name. If not specified, Docker generates a name.
-- **Driver** - Name of the volume driver to use. Defaults to `local` for the name.
-- **DriverOpts** - A mapping of driver options and values. These options are
-    passed directly to the driver and are driver specific.
-- **Labels** - Labels to set on the volume, specified as a map: `{"key":"value","key2":"value2"}`
-
-**JSON fields in response**:
-
-Refer to the [inspect a volume](#inspect-a-volume) section or details about the
-JSON fields returned in the response.
-
-### Inspect a volume
-
-`GET /volumes/(name)`
-
-Return low-level information on the volume `name`
-
-**Example request**:
-
-    GET /v1.25/volumes/tardis
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {
-      "Name": "tardis",
-      "Driver": "custom",
-      "Mountpoint": "/var/lib/docker/volumes/tardis/_data",
-      "Status": {
-        "hello": "world"
-      },
-      "Labels": {
-          "com.example.some-label": "some-value",
-          "com.example.some-other-label": "some-other-value"
-      },
-      "Scope": "local",
-      "Options": {
-          "some-key": "some-value",
-          "some-other-key": "some-other-value"
-      },
-    }
-
-**Status codes**:
-
--   **200** - no error
--   **404** - no such volume
--   **500** - server error
-
-**JSON fields in response**:
-
-The following fields can be returned in the API response. Empty fields, or
-fields that are not supported by the volume's driver may be omitted in the
-response.
-
-- **Name** - Name of the volume.
-- **Driver** - Name of the volume driver used by the volume.
-- **Mountpoint** - Mount path of the volume on the host.
-- **Status** - Low-level details about the volume, provided by the volume driver.
-    Details are returned as a map with key/value pairs: `{"key":"value","key2":"value2"}`.
-    The `Status` field is optional, and is omitted if the volume driver does not
-    support this feature.
-- **Labels** - Labels set on the volume, specified as a map: `{"key":"value","key2":"value2"}`.
-- **Scope** - Scope describes the level at which the volume exists, can be one of
-    `global` for cluster-wide or `local` for machine level. The default is `local`.
-- **Options** - Options holds the driver specific options to use for when creating the volume.
-
-### Remove a volume
-
-`DELETE /volumes/(name)`
-
-Instruct the driver to remove the volume (`name`).
-
-**Example request**:
-
-    DELETE /v1.25/volumes/tardis HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 204 No Content
-
-**Query Parameters**:
-
--   **force** - 1/True/true or 0/False/false, Force the removal of the volume.
-        Default `false`.
-
-**Status codes**:
-
--   **204** - no error
--   **404** - no such volume or volume driver
--   **409** - volume is in use and cannot be removed
--   **500** - server error
-
-### Prune unused volumes
-
-`POST /volumes/prune`
-
-Delete unused volumes
-
-**Example request**:
-
-    POST /v1.25/volumes/prune HTTP/1.1
-    Content-Type: application/json
-
-    {
-    }
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {
-        "VolumesDeleted": [
-            "my-volume"
-        ],
-        "SpaceReclaimed": 42
-    }
-
-**Status codes**:
-
--   **200** – no error
--   **500** – server error
-
-
-## 3.5 Networks
-
-### List networks
-
-`GET /networks`
-
-**Example request**:
-
-    GET /v1.25/networks?filters={"type":{"custom":true}} HTTP/1.1
-
-**Example response**:
-
-```
-HTTP/1.1 200 OK
-Content-Type: application/json
-
-[
-  {
-    "Name": "bridge",
-    "Id": "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566",
-    "Created": "2016-10-19T06:21:00.416543526Z",
-    "Scope": "local",
-    "Driver": "bridge",
-    "EnableIPv6": false,
-    "Internal": false,
-    "IPAM": {
-      "Driver": "default",
-      "Config": [
-        {
-          "Subnet": "172.17.0.0/16"
-        }
-      ]
-    },
-    "Containers": {
-      "39b69226f9d79f5634485fb236a23b2fe4e96a0a94128390a7fbbcc167065867": {
-        "EndpointID": "ed2419a97c1d9954d05b46e462e7002ea552f216e9b136b80a7db8d98b442eda",
-        "MacAddress": "02:42:ac:11:00:02",
-        "IPv4Address": "172.17.0.2/16",
-        "IPv6Address": ""
-      }
-    },
-    "Options": {
-      "com.docker.network.bridge.default_bridge": "true",
-      "com.docker.network.bridge.enable_icc": "true",
-      "com.docker.network.bridge.enable_ip_masquerade": "true",
-      "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
-      "com.docker.network.bridge.name": "docker0",
-      "com.docker.network.driver.mtu": "1500"
-    }
-  },
-  {
-    "Name": "none",
-    "Id": "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794",
-    "Created": "0001-01-01T00:00:00Z",
-    "Scope": "local",
-    "Driver": "null",
-    "EnableIPv6": false,
-    "Internal": false,
-    "IPAM": {
-      "Driver": "default",
-      "Config": []
-    },
-    "Containers": {},
-    "Options": {}
-  },
-  {
-    "Name": "host",
-    "Id": "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e",
-    "Created": "0001-01-01T00:00:00Z",
-    "Scope": "local",
-    "Driver": "host",
-    "EnableIPv6": false,
-    "Internal": false,
-    "IPAM": {
-      "Driver": "default",
-      "Config": []
-    },
-    "Containers": {},
-    "Options": {}
-  }
-]
-```
-
-**Query parameters**:
-
-- **filters** - JSON encoded network list filter. The filter value is one of:
-  -   `driver=<driver-name>` Matches a network's driver.
-  -   `id=<network-id>` Matches all or part of a network id.
-  -   `label=<key>` or `label=<key>=<value>` of a network label.
-  -   `name=<network-name>` Matches all or part of a network name.
-  -   `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks.
-
-**Status codes**:
-
--   **200** - no error
--   **500** - server error
-
-### Inspect network
-
-`GET /networks/<network-id>`
-
-**Example request**:
-
-    GET /v1.25/networks/7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99 HTTP/1.1
-
-**Example response**:
-
-```
-HTTP/1.1 200 OK
-Content-Type: application/json
-
-{
-  "Name": "net01",
-  "Id": "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99",
-  "Created": "2016-10-19T04:33:30.360899459Z",
-  "Scope": "local",
-  "Driver": "bridge",
-  "EnableIPv6": false,
-  "IPAM": {
-    "Driver": "default",
-    "Config": [
-      {
-        "Subnet": "172.19.0.0/16",
-        "Gateway": "172.19.0.1"
-      }
-    ],
-    "Options": {
-        "foo": "bar"
-    }
-  },
-  "Internal": false,
-  "Containers": {
-    "19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c": {
-      "Name": "test",
-      "EndpointID": "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a",
-      "MacAddress": "02:42:ac:13:00:02",
-      "IPv4Address": "172.19.0.2/16",
-      "IPv6Address": ""
-    }
-  },
-  "Options": {
-    "com.docker.network.bridge.default_bridge": "true",
-    "com.docker.network.bridge.enable_icc": "true",
-    "com.docker.network.bridge.enable_ip_masquerade": "true",
-    "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
-    "com.docker.network.bridge.name": "docker0",
-    "com.docker.network.driver.mtu": "1500"
-  },
-  "Labels": {
-    "com.example.some-label": "some-value",
-    "com.example.some-other-label": "some-other-value"
-  }
-}
-```
-
-**Status codes**:
-
--   **200** - no error
--   **404** - network not found
-
-### Create a network
-
-`POST /networks/create`
-
-Create a network
-
-**Example request**:
-
-```
-POST /v1.25/networks/create HTTP/1.1
-Content-Type: application/json
-
-{
-  "Name":"isolated_nw",
-  "CheckDuplicate":true,
-  "Driver":"bridge",
-  "EnableIPv6": true,
-  "IPAM":{
-    "Driver": "default",
-    "Config":[
-      {
-        "Subnet":"172.20.0.0/16",
-        "IPRange":"172.20.10.0/24",
-        "Gateway":"172.20.10.11"
-      },
-      {
-        "Subnet":"2001:db8:abcd::/64",
-        "Gateway":"2001:db8:abcd::1011"
-      }
-    ],
-    "Options": {
-      "foo": "bar"
-    }
-  },
-  "Internal":true,
-  "Options": {
-    "com.docker.network.bridge.default_bridge": "true",
-    "com.docker.network.bridge.enable_icc": "true",
-    "com.docker.network.bridge.enable_ip_masquerade": "true",
-    "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
-    "com.docker.network.bridge.name": "docker0",
-    "com.docker.network.driver.mtu": "1500"
-  },
-  "Labels": {
-    "com.example.some-label": "some-value",
-    "com.example.some-other-label": "some-other-value"
-  }
-}
-```
-
-**Example response**:
-
-```
-HTTP/1.1 201 Created
-Content-Type: application/json
-
-{
-  "Id": "22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30",
-  "Warning": ""
-}
-```
-
-**Status codes**:
-
-- **201** - no error
-- **404** - plugin not found
-- **500** - server error
-
-**JSON parameters**:
-
-- **Name** - The new network's name. this is a mandatory field
-- **CheckDuplicate** - Requests daemon to check for networks with same name. Defaults to `false`
-- **Driver** - Name of the network driver plugin to use. Defaults to `bridge` driver
-- **Internal** - Restrict external access to the network
-- **IPAM** - Optional custom IP scheme for the network
-  - **Driver** - Name of the IPAM driver to use. Defaults to `default` driver
-  - **Config** - List of IPAM configuration options, specified as a map:
-      `{"Subnet": <CIDR>, "IPRange": <CIDR>, "Gateway": <IP address>, "AuxAddress": <device_name:IP address>}`
-  - **Options** - Driver-specific options, specified as a map: `{"option":"value" [,"option2":"value2"]}`
-- **EnableIPv6** - Enable IPv6 on the network
-- **Options** - Network specific options to be used by the drivers
-- **Labels** - Labels to set on the network, specified as a map: `{"key":"value" [,"key2":"value2"]}`
-
-### Connect a container to a network
-
-`POST /networks/(id)/connect`
-
-Connect a container to a network
-
-**Example request**:
-
-```
-POST /v1.25/networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30/connect HTTP/1.1
-Content-Type: application/json
-
-{
-  "Container":"3613f73ba0e4",
-  "EndpointConfig": {
-    "IPAMConfig": {
-        "IPv4Address":"172.24.56.89",
-        "IPv6Address":"2001:db8::5689"
-    }
-  }
-}
-```
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-
-**Status codes**:
-
-- **200** - no error
-- **403** - operation not supported for swarm scoped networks
-- **404** - network or container is not found
-- **500** - Internal Server Error
-
-**JSON parameters**:
-
-- **container** - container-id/name to be connected to the network
-
-### Disconnect a container from a network
-
-`POST /networks/(id)/disconnect`
-
-Disconnect a container from a network
-
-**Example request**:
-
-```
-POST /v1.25/networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30/disconnect HTTP/1.1
-Content-Type: application/json
-
-{
-  "Container":"3613f73ba0e4",
-  "Force":false
-}
-```
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-
-**Status codes**:
-
-- **200** - no error
-- **403** - operation not supported for swarm scoped networks
-- **404** - network or container not found
-- **500** - Internal Server Error
-
-**JSON parameters**:
-
-- **Container** - container-id/name to be disconnected from a network
-- **Force** - Force the container to disconnect from a network
-
-### Remove a network
-
-`DELETE /networks/(id)`
-
-Instruct the driver to remove the network (`id`).
-
-**Example request**:
-
-    DELETE /v1.25/networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30 HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 204 No Content
-
-**Status codes**:
-
--   **204** - no error
--   **404** - no such network
--   **500** - server error
-
-### Prune unused networks
-
-`POST /networks/prune`
-
-Delete unused networks
-
-**Example request**:
-
-    POST /v1.25/networks/prune HTTP/1.1
-    Content-Type: application/json
-
-    {
-    }
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {
-        "NetworksDeleted": [
-            "n1"
-        ],
-    }
-
-**Status codes**:
-
--   **200** – no error
--   **500** – server error
-
-## 3.6 Plugins
-
-### List plugins
-
-`GET /plugins`
-
-Returns information about installed plugins.
-
-**Example request**:
-
-    GET /v1.25/plugins HTTP/1.1
-
-**Example response**:
-
-```
-HTTP/1.1 200 OK
-Content-Type: application/json
-
-[
-  {
-    "Id": "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078",
-    "Name": "tiborvass/no-remove",
-    "Tag": "latest",
-    "Active": 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": "https://docs.docker.com/engine/extend/plugins/",
-      "Interface": {
-        "Types": [
-          "docker.volumedriver/1.0"
-        ],
-        "Socket": "plugins.sock"
-      },
-      "Entrypoint": [
-        "plugin-no-remove",
-        "/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": [
-
-        ]
-      }
-    }
-  }
-]
-```
-
-**Status codes**:
-
--   **200** - no error
--   **500** - server error
-
-### Install a plugin
-
-`POST /plugins/pull?name=<plugin name>`
-
-Pulls and installs a plugin. After the plugin is installed, it can be enabled
-using the [`POST /plugins/(plugin name)/enable` endpoint](#enable-a-plugin).
-
-**Example request**:
-
-```
-POST /v1.25/plugins/pull?name=tiborvass/no-remove:latest HTTP/1.1
-```
-
-The `:latest` tag is optional, and is used as default if omitted. When using
-this endpoint to pull a plugin from the registry, the `X-Registry-Auth` header
-can be used to include a base64-encoded AuthConfig object. Refer to the [create
-an image](#create-an-image) section for more details.
-
-**Example response**:
-
-```
-HTTP/1.1 200 OK
-Content-Type: application/json
-Content-Length: 175
-
-[
-  {
-    "Name": "network",
-    "Description": "",
-    "Value": [
-      "host"
-    ]
-  },
-  {
-    "Name": "mount",
-    "Description": "",
-    "Value": [
-      "/data"
-    ]
-  },
-  {
-    "Name": "device",
-    "Description": "",
-    "Value": [
-      "/dev/cpu_dma_latency"
-    ]
-  }
-]
-```
-
-**Query parameters**:
-
-- **name** -  Name of the plugin to pull. The name may include a tag or digest.
-    This parameter is required.
-
-**Status codes**:
-
--   **200** - no error
--   **500** - error parsing reference / not a valid repository/tag: repository
-      name must have at least one component
--   **500** - plugin already exists
-
-### Inspect a plugin
-
-`GET /plugins/(plugin name)`
-
-Returns detailed information about an installed plugin.
-
-**Example request**:
-
-```
-GET /v1.25/plugins/tiborvass/no-remove:latest HTTP/1.1
-```
-
-The `:latest` tag is optional, and is used as default if omitted.
-
-
-**Example response**:
-
-```
-HTTP/1.1 200 OK
-Content-Type: application/json
-
-{
-  "Id": "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078",
-  "Name": "tiborvass/no-remove",
-  "Tag": "latest",
-  "Active": false,
-  "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": "https://docs.docker.com/engine/extend/plugins/",
-    "Interface": {
-      "Types": [
-        "docker.volumedriver/1.0"
-      ],
-      "Socket": "plugins.sock"
-    },
-    "Entrypoint": [
-      "plugin-no-remove",
-      "/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": [
-
-      ]
-    }
-  }
-}
-```
-
-**Status codes**:
-
--   **200** - no error
--   **404** - plugin not installed
-
-### Configure a plugin
-
-`POST /plugins/(plugin name)/set`
-
-**Example request**:
-
-
-    POST /v1.25/plugins/tiborvass/no-remove/set
-    Content-Type: application/json
-
-    ["DEBUG=1"]
-
-**Example response**:
-
-    HTTP/1.1 204 No Content
-
-**Status codes**:
-
--   **204** - no error
--   **404** - plugin not installed
-
-### Enable a plugin
-
-`POST /plugins/(plugin name)/enable`
-
-Enables a plugin
-
-**Example request**:
-
-```
-POST /v1.25/plugins/tiborvass/no-remove:latest/enable HTTP/1.1
-```
-
-The `:latest` tag is optional, and is used as default if omitted.
-
-
-**Example response**:
-
-```
-HTTP/1.1 200 OK
-Content-Length: 0
-Content-Type: text/plain; charset=utf-8
-```
-
-**Status codes**:
-
--   **200** - no error
--   **500** - plugin is already enabled
-
-### Disable a plugin
-
-`POST /plugins/(plugin name)/disable`
-
-Disables a plugin
-
-**Example request**:
-
-```
-POST /v1.25/plugins/tiborvass/no-remove:latest/disable HTTP/1.1
-```
-
-The `:latest` tag is optional, and is used as default if omitted.
-
-
-**Example response**:
-
-```
-HTTP/1.1 200 OK
-Content-Length: 0
-Content-Type: text/plain; charset=utf-8
-```
-
-**Status codes**:
-
--   **200** - no error
--   **500** - plugin is already disabled
-
-### Remove a plugin
-
-`DELETE /plugins/(plugin name)`
-
-Removes a plugin
-
-**Example request**:
-
-```
-DELETE /v1.25/plugins/tiborvass/no-remove:latest HTTP/1.1
-```
-
-The `:latest` tag is optional, and is used as default if omitted.
-
-**Example response**:
-
-```
-HTTP/1.1 200 OK
-Content-Length: 0
-Content-Type: text/plain; charset=utf-8
-```
-
-**Query parameters**:
-
-- **force** - Boolean value, set to `1` / `True` / `true` to force removing the
-    plugin. Forcing removal disables the plugin before removing, but may result
-    in issues if the plugin is in use by a container.
-
-**Status codes**:
-
--   **200** - no error
--   **404** - plugin not installed
--   **500** - plugin is active
-
-### Create a plugin
-
-`POST /v1.25/plugins/create?name=(plugin name)`
-
-Create a plugin
-
-**Example request**:
-
-To create a plugin named `plugin`
-
-```
-POST /v1.25/plugins/create?name=plugin:latest HTTP/1.1
-Content-Type: application/x-tar
-
-{% raw %}
-{{ TAR STREAM }}
-{% endraw %}
-```
-
-The `:latest` tag is optional, and is used as default if omitted.
-
-**Example response**:
-
-```
-HTTP/1.1 204 No Content
-Content-Length: 0
-Content-Type: text/plain; charset=utf-8
-```
-
-**Query parameters**:
-
-- **name** - A name and optional tag to apply for the plugin in the `name:tag format`. If you omit the `tag` the default `:latest` value is assumed.
-
-**Status codes**:
-
--   **204** - no error
--   **500** - server error
-
-### Push a plugin
-
-`POST /v1.25/plugins/(plugin name)/push`
-
-Pushes a plugin to the registry.
-
-**Example request**:
-
-```
-POST /v1.25/plugins/tiborvass/no-remove:latest HTTP/1.1
-```
-
-The `:latest` tag is optional, and is used as default if omitted. When using
-this endpoint to push a plugin to the registry, the `X-Registry-Auth` header
-can be used to include a base64-encoded AuthConfig object. Refer to the [create
-an image](#create-an-image) section for more details.
-
-**Example response**:
-
-**Status codes**:
-
--   **200** - no error
--   **404** - plugin not installed
-
-
-## 3.7 Nodes
-
-**Note**: Node operations require the engine to be part of a swarm.
-
-### List nodes
-
-
-`GET /nodes`
-
-List nodes
-
-**Example request**:
-
-    GET /v1.25/nodes HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    [
-      {
-        "ID": "24ifsmvkjbyhk",
-        "Version": {
-          "Index": 8
-        },
-        "CreatedAt": "2016-06-07T20:31:11.853781916Z",
-        "UpdatedAt": "2016-06-07T20:31:11.999868824Z",
-        "Spec": {
-          "Name": "my-node",
-          "Role": "manager",
-          "Availability": "active"
-          "Labels": {
-              "foo": "bar"
-          }
-        },
-        "Description": {
-          "Hostname": "bf3067039e47",
-          "Platform": {
-            "Architecture": "x86_64",
-            "OS": "linux"
-          },
-          "Resources": {
-            "NanoCPUs": 4000000000,
-            "MemoryBytes": 8272408576
-          },
-          "Engine": {
-            "EngineVersion": "1.13.0",
-            "Labels": {
-                "foo": "bar",
-            }
-            "Plugins": [
-              {
-                "Type": "Volume",
-                "Name": "local"
-              },
-              {
-                "Type": "Network",
-                "Name": "bridge"
-              }
-              {
-                "Type": "Network",
-                "Name": "null"
-              }
-              {
-                "Type": "Network",
-                "Name": "overlay"
-              }
-            ]
-          }
-        },
-        "Status": {
-          "State": "ready",
-          "Addr": "172.17.0.2"
-        },
-        "ManagerStatus": {
-          "Leader": true,
-          "Reachability": "reachable",
-          "Addr": "172.17.0.2:2377""
-        }
-      }
-    ]
-
-**Query parameters**:
-
-- **filters** – a JSON encoded value of the filters (a `map[string][]string`) to process on the
-  nodes list. Available filters:
-  - `id=<node id>`
-  - `label=<engine label>`
-  - `membership=`(`accepted`|`pending`)`
-  - `name=<node name>`
-  - `role=`(`manager`|`worker`)`
-
-**Status codes**:
-
-- **200** – no error
-- **500** – server error
-
-### Inspect a node
-
-
-`GET /nodes/(id or name)`
-
-Return low-level information on the node `id`
-
-**Example request**:
-
-      GET /v1.25/nodes/24ifsmvkjbyhk HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {
-      "ID": "24ifsmvkjbyhk",
-      "Version": {
-        "Index": 8
-      },
-      "CreatedAt": "2016-06-07T20:31:11.853781916Z",
-      "UpdatedAt": "2016-06-07T20:31:11.999868824Z",
-      "Spec": {
-        "Name": "my-node",
-        "Role": "manager",
-        "Availability": "active"
-        "Labels": {
-            "foo": "bar"
-        }
-      },
-      "Description": {
-        "Hostname": "bf3067039e47",
-        "Platform": {
-          "Architecture": "x86_64",
-          "OS": "linux"
-        },
-        "Resources": {
-          "NanoCPUs": 4000000000,
-          "MemoryBytes": 8272408576
-        },
-        "Engine": {
-          "EngineVersion": "1.13.0",
-          "Labels": {
-              "foo": "bar",
-          }
-          "Plugins": [
-            {
-              "Type": "Volume",
-              "Name": "local"
-            },
-            {
-              "Type": "Network",
-              "Name": "bridge"
-            }
-            {
-              "Type": "Network",
-              "Name": "null"
-            }
-            {
-              "Type": "Network",
-              "Name": "overlay"
-            }
-          ]
-        }
-      },
-      "Status": {
-        "State": "ready",
-        "Addr": "172.17.0.2"
-      },
-      "ManagerStatus": {
-        "Leader": true,
-        "Reachability": "reachable",
-        "Addr": "172.17.0.2:2377""
-      }
-    }
-
-**Status codes**:
-
--   **200** – no error
--   **404** – no such node
--   **500** – server error
-
-### Remove a node
-
-
-`DELETE /nodes/(id or name)`
-
-Remove a node from the swarm.
-
-**Example request**:
-
-    DELETE /v1.25/nodes/24ifsmvkjbyhk HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Length: 0
-    Content-Type: text/plain; charset=utf-8
-
-**Query parameters**:
-
--   **force** - 1/True/true or 0/False/false, Force remove a node from the swarm.
-        Default `false`.
-
-**Status codes**:
-
--   **200** – no error
--   **404** – no such node
--   **500** – server error
-
-### Update a node
-
-
-`POST /nodes/(id or name)/update`
-
-Update a node.
-
-The payload of the `POST` request is the new `NodeSpec` and
-overrides the current `NodeSpec` for the specified node.
-
-If `Availability` or `Role` are omitted, this returns an
-error. Any other field omitted resets the current value to either
-an empty value or the default cluster-wide value.
-
-**Example Request**
-
-    POST /v1.25/nodes/24ifsmvkjbyhk/update?version=8 HTTP/1.1
-    Content-Type: application/json
-
-    {
-      "Availability": "active",
-      "Name": "node-name",
-      "Role": "manager",
-      "Labels": {
-        "foo": "bar"
-      }
-    }
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Length: 0
-    Content-Type: text/plain; charset=utf-8
-
-**Query parameters**:
-
-- **version** – The version number of the node object being updated. This is
-  required to avoid conflicting writes.
-
-JSON Parameters:
-
-- **Annotations** – Optional medata to associate with the node.
-    - **Name** – User-defined name for the node.
-    - **Labels** – A map of labels to associate with the node (e.g.,
-      `{"key":"value", "key2":"value2"}`).
-- **Role** - Role of the node (worker/manager).
-- **Availability** - Availability of the node (active/pause/drain).
-
-
-**Status codes**:
-
--   **200** – no error
--   **404** – no such node
--   **500** – server error
-
-## 3.8 Swarm
-
-### Inspect swarm
-
-
-`GET /swarm`
-
-Inspect swarm
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {
-      "CreatedAt" : "2016-08-15T16:00:20.349727406Z",
-      "Spec" : {
-        "Dispatcher" : {
-          "HeartbeatPeriod" : 5000000000
-        },
-        "Orchestration" : {
-         "TaskHistoryRetentionLimit" : 10
-        },
-        "CAConfig" : {
-          "NodeCertExpiry" : 7776000000000000
-        },
-        "Raft" : {
-          "LogEntriesForSlowFollowers" : 500,
-          "HeartbeatTick" : 1,
-          "SnapshotInterval" : 10000,
-          "ElectionTick" : 3
-        },
-        "TaskDefaults" : {},
-        "EncryptionConfig" : {
-          "AutoLockManagers": false
-        },
-        "Name" : "default"
-      },
-      "JoinTokens" : {
-        "Worker" : "SWMTKN-1-1h8aps2yszaiqmz2l3oc5392pgk8e49qhx2aj3nyv0ui0hez2a-6qmn92w6bu3jdvnglku58u11a",
-        "Manager" : "SWMTKN-1-1h8aps2yszaiqmz2l3oc5392pgk8e49qhx2aj3nyv0ui0hez2a-8llk83c4wm9lwioey2s316r9l"
-      },
-      "ID" : "70ilmkj2f6sp2137c753w2nmt",
-      "UpdatedAt" : "2016-08-15T16:32:09.623207604Z",
-      "Version" : {
-        "Index" : 51
-      }
-    }
-
-**Status codes**:
-
-- **200** - no error
-
-### Initialize a new swarm
-
-
-`POST /swarm/init`
-
-Initialize a new swarm. The body of the HTTP response includes the node ID.
-
-**Example request**:
-
-    POST /v1.25/swarm/init HTTP/1.1
-    Content-Type: application/json
-
-    {
-      "ListenAddr": "0.0.0.0:2377",
-      "AdvertiseAddr": "192.168.1.1:2377",
-      "ForceNewCluster": false,
-      "Spec": {
-        "Orchestration": {},
-        "Raft": {},
-        "Dispatcher": {},
-        "CAConfig": {},
-        "EncryptionConfig" : {
-          "AutoLockManagers": false
-        }
-      }
-    }
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Length: 28
-    Content-Type: application/json
-    Date: Thu, 01 Sep 2016 21:49:13 GMT
-    Server: Docker/1.13.0 (linux)
-
-    "7v2t30z9blmxuhnyo6s4cpenp"
-
-**Status codes**:
-
-- **200** – no error
-- **400** – bad parameter
-- **503** – node is already part of a swarm
-
-JSON Parameters:
-
-- **ListenAddr** – Listen address used for inter-manager communication, as well as determining
-  the networking interface used for the VXLAN Tunnel Endpoint (VTEP). This can either be an
-  address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port
-  number, like `eth0:4567`. If the port number is omitted, the default swarm listening port is
-  used.
-- **AdvertiseAddr** – Externally reachable address advertised to other nodes. This can either be
-  an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port
-  number, like `eth0:4567`. If the port number is omitted, the port number from the listen
-  address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when
-  possible.
-- **ForceNewCluster** – Force creation of a new swarm.
-- **Spec** – Configuration settings for the new swarm.
-    - **Orchestration** – Configuration settings for the orchestration aspects of the swarm.
-        - **TaskHistoryRetentionLimit** – Maximum number of tasks history stored.
-    - **Raft** – Raft related configuration.
-        - **SnapshotInterval** – Number of logs entries between snapshot.
-        - **KeepOldSnapshots** – Number of snapshots to keep beyond the current snapshot.
-        - **LogEntriesForSlowFollowers** – Number of log entries to keep around to sync up slow
-          followers after a snapshot is created.
-        - **HeartbeatTick** – Amount of ticks (in seconds) between each heartbeat.
-        - **ElectionTick** – Amount of ticks (in seconds) needed without a leader to trigger a new
-          election.
-    - **Dispatcher** – Configuration settings for the task dispatcher.
-        - **HeartbeatPeriod** – The delay for an agent to send a heartbeat to the dispatcher.
-    - **CAConfig** – Certificate authority configuration.
-        - **NodeCertExpiry** – Automatic expiry for nodes certificates.
-        - **ExternalCA** - Configuration for forwarding signing requests to an external
-          certificate authority.
-            - **Protocol** - Protocol for communication with the external CA
-              (currently only "cfssl" is supported).
-            - **URL** - URL where certificate signing requests should be sent.
-            - **Options** - An object with key/value pairs that are interpreted
-              as protocol-specific options for the external CA driver.
-    - **EncryptionConfig** – Parameters related to encryption-at-rest.
-        - **AutoLockManagers**: If set, generate a key and use it to lock data stored on the
-          managers.
-
-### Join an existing swarm
-
-`POST /swarm/join`
-
-Join an existing swarm
-
-**Example request**:
-
-    POST /v1.25/swarm/join HTTP/1.1
-    Content-Type: application/json
-
-    {
-      "ListenAddr": "0.0.0.0:2377",
-      "AdvertiseAddr": "192.168.1.1:2377",
-      "RemoteAddrs": ["node1:2377"],
-      "JoinToken": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2"
-    }
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Length: 0
-    Content-Type: text/plain; charset=utf-8
-
-**Status codes**:
-
-- **200** – no error
-- **400** – bad parameter
-- **503** – node is already part of a swarm
-
-JSON Parameters:
-
-- **ListenAddr** – Listen address used for inter-manager communication if the node gets promoted to
-  manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP).
-- **AdvertiseAddr** – Externally reachable address advertised to other nodes. This can either be
-  an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port
-  number, like `eth0:4567`. If the port number is omitted, the port number from the listen
-  address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when
-  possible.
-- **RemoteAddr** – Address of any manager node already participating in the swarm.
-- **JoinToken** – Secret token for joining this swarm.
-
-### Leave a swarm
-
-
-`POST /swarm/leave`
-
-Leave a swarm
-
-**Example request**:
-
-    POST /v1.25/swarm/leave HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Length: 0
-    Content-Type: text/plain; charset=utf-8
-
-**Query parameters**:
-
-- **force** - Boolean (0/1, false/true). Force leave swarm, even if this is the last manager or that it will break the cluster.
-
-**Status codes**:
-
-- **200** – no error
-- **503** – node is not part of a swarm
-
-### Retrieve the swarm's unlock key
-
-`GET /swarm/unlockkey`
-
-Get unlock key
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {
-      "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8"
-    }
-
-**Status codes**:
-
-- **200** - no error
-
-### Unlock a locked manager
-
-`POST /swarm/unlock`
-
-Unlock a manager
-
-**Example request**:
-
-    POST /v1.25/swarm/unlock HTTP/1.1
-    Content-Type: application/json
-
-    {
-      "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8"
-    }
-
-**Status codes**:
-
-- **200** - no error
-
-### Update a swarm
-
-
-`POST /swarm/update`
-
-Update a swarm
-
-**Example request**:
-
-    POST /v1.25/swarm/update HTTP/1.1
-
-    {
-      "Name": "default",
-      "Orchestration": {
-        "TaskHistoryRetentionLimit": 10
-      },
-      "Raft": {
-        "SnapshotInterval": 10000,
-        "LogEntriesForSlowFollowers": 500,
-        "HeartbeatTick": 1,
-        "ElectionTick": 3
-      },
-      "Dispatcher": {
-        "HeartbeatPeriod": 5000000000
-      },
-      "CAConfig": {
-        "NodeCertExpiry": 7776000000000000
-      },
-      "JoinTokens": {
-        "Worker": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx",
-        "Manager": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2"
-      },
-      "EncryptionConfig": {
-        "AutoLockManagers": false
-      }
-    }
-
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Length: 0
-    Content-Type: text/plain; charset=utf-8
-
-**Query parameters**:
-
-- **version** – The version number of the swarm object being updated. This is
-  required to avoid conflicting writes.
-- **rotateWorkerToken** - Set to `true` (or `1`) to rotate the worker join token.
-- **rotateManagerToken** - Set to `true` (or `1`) to rotate the manager join token.
-- **rotateManagerUnlockKey** - Set to `true` (or `1`) to rotate the manager unlock key.
-
-**Status codes**:
-
-- **200** – no error
-- **400** – bad parameter
-- **503** – node is not part of a swarm
-
-JSON Parameters:
-
-- **Orchestration** – Configuration settings for the orchestration aspects of the swarm.
-    - **TaskHistoryRetentionLimit** – Maximum number of tasks history stored.
-- **Raft** – Raft related configuration.
-    - **SnapshotInterval** – Number of logs entries between snapshot.
-    - **KeepOldSnapshots** – Number of snapshots to keep beyond the current snapshot.
-    - **LogEntriesForSlowFollowers** – Number of log entries to keep around to sync up slow
-      followers after a snapshot is created.
-    - **HeartbeatTick** – Amount of ticks (in seconds) between each heartbeat.
-    - **ElectionTick** – Amount of ticks (in seconds) needed without a leader to trigger a new
-      election.
-- **Dispatcher** – Configuration settings for the task dispatcher.
-    - **HeartbeatPeriod** – The delay for an agent to send a heartbeat to the dispatcher.
-- **CAConfig** – CA configuration.
-    - **NodeCertExpiry** – Automatic expiry for nodes certificates.
-    - **ExternalCA** - Configuration for forwarding signing requests to an external
-      certificate authority.
-        - **Protocol** - Protocol for communication with the external CA
-          (currently only "cfssl" is supported).
-        - **URL** - URL where certificate signing requests should be sent.
-        - **Options** - An object with key/value pairs that are interpreted
-          as protocol-specific options for the external CA driver.
-- **JoinTokens** - Tokens that can be used by other nodes to join the swarm.
-    - **Worker** - Token to use for joining as a worker.
-    - **Manager** - Token to use for joining as a manager.
-- **EncryptionConfig** – Parameters related to encryption-at-rest.
-    - **AutoLockManagers**: If set, generate a key and use it to lock data stored on the
-      managers.
-
-## 3.9 Services
-
-**Note**: Service operations require to first be part of a swarm.
-
-### List services
-
-
-`GET /services`
-
-List services
-
-**Example request**:
-
-    GET /v1.25/services HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    [
-      {
-        "ID": "9mnpnzenvg8p8tdbtq4wvbkcz",
-        "Version": {
-          "Index": 19
-        },
-        "CreatedAt": "2016-06-07T21:05:51.880065305Z",
-        "UpdatedAt": "2016-06-07T21:07:29.962229872Z",
-        "Spec": {
-          "Name": "hopeful_cori",
-          "TaskTemplate": {
-            "ContainerSpec": {
-              "Image": "redis"
-            },
-            "Resources": {
-              "Limits": {},
-              "Reservations": {}
-            },
-            "RestartPolicy": {
-              "Condition": "any",
-              "MaxAttempts": 0
-            },
-            "Placement": {},
-            "ForceUpdate": 0
-          },
-          "Mode": {
-            "Replicated": {
-              "Replicas": 1
-            }
-          },
-          "UpdateConfig": {
-            "Parallelism": 1,
-            "FailureAction": "pause",
-            "Monitor": 15000000000,
-            "MaxFailureRatio": 0.15
-          },
-          "EndpointSpec": {
-            "Mode": "vip",
-            "Ports": [
-              {
-                "Protocol": "tcp",
-                "TargetPort": 6379,
-                "PublishedPort": 30001
-              }
-            ]
-          }
-        },
-        "Endpoint": {
-          "Spec": {
-            "Mode": "vip",
-            "Ports": [
-              {
-                "Protocol": "tcp",
-                "TargetPort": 6379,
-                "PublishedPort": 30001
-              }
-            ]
-          },
-          "Ports": [
-            {
-              "Protocol": "tcp",
-              "TargetPort": 6379,
-              "PublishedPort": 30001
-            }
-          ],
-          "VirtualIPs": [
-            {
-              "NetworkID": "4qvuz4ko70xaltuqbt8956gd1",
-              "Addr": "10.255.0.2/16"
-            },
-            {
-              "NetworkID": "4qvuz4ko70xaltuqbt8956gd1",
-              "Addr": "10.255.0.3/16"
-            }
-          ]
-        }
-      }
-    ]
-
-**Query parameters**:
-
-- **filters** – a JSON encoded value of the filters (a `map[string][]string`) to process on the
-  services list. Available filters:
-  - `id=<service id>`
-  - `label=<service label>`
-  - `name=<service name>`
-
-**Status codes**:
-
-- **200** – no error
-- **500** – server error
-
-### Create a service
-
-`POST /services/create`
-
-Create a service. When using this endpoint to create a service using a private
-repository from the registry, the `X-Registry-Auth` header must be used to
-include a base64-encoded AuthConfig object. Refer to the [create an
-image](#create-an-image) section for more details.
-
-**Example request**:
-
-    POST /v1.25/services/create HTTP/1.1
-    Content-Type: application/json
-
-    {
-      "Name": "web",
-      "TaskTemplate": {
-        "ContainerSpec": {
-          "Image": "nginx:alpine",
-          "Mounts": [
-            {
-              "ReadOnly": true,
-              "Source": "web-data",
-              "Target": "/usr/share/nginx/html",
-              "Type": "volume",
-              "VolumeOptions": {
-                "DriverConfig": {
-                },
-                "Labels": {
-                  "com.example.something": "something-value"
-                }
-              }
-            }
-          ],
-          "User": "33",
-          "TTY": false,
-          "DNSConfig": {
-            "Nameservers": ["8.8.8.8"],
-            "Search": ["example.org"],
-            "Options": ["timeout:3"]
-          }
-        },
-        "LogDriver": {
-          "Name": "json-file",
-          "Options": {
-            "max-file": "3",
-            "max-size": "10M"
-          }
-        },
-        "Placement": {},
-        "Resources": {
-          "Limits": {
-            "MemoryBytes": 104857600.0
-          },
-          "Reservations": {
-          }
-        },
-        "RestartPolicy": {
-          "Condition": "on-failure",
-          "Delay": 10000000000.0,
-          "MaxAttempts": 10
-        },
-        "ForceUpdate": 0
-      },
-      "Mode": {
-        "Replicated": {
-          "Replicas": 4
-        }
-      },
-      "UpdateConfig": {
-        "Delay": 30000000000.0,
-        "Parallelism": 2,
-        "FailureAction": "pause"
-      },
-      "EndpointSpec": {
-        "Ports": [
-          {
-            "Protocol": "tcp",
-            "PublishedPort": 8080,
-            "TargetPort": 80
-          }
-        ]
-      },
-      "Labels": {
-        "foo": "bar"
-      }
-    }
-
-**Example response**:
-
-    HTTP/1.1 201 Created
-    Content-Type: application/json
-
-    {
-      "ID": "ak7w3gjqoa3kuz8xcpnyy0pvl",
-      "Warnings": ["unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found"]
-    }
-
-**Status codes**:
-
-- **201** – no error
-- **409** – name conflicts with an existing object
-- **503** – server error or node is not part of a swarm
-
-**JSON Parameters**:
-
-- **Name** – User-defined name for the service.
-- **Labels** – A map of labels to associate with the service (e.g., `{"key":"value", "key2":"value2"}`).
-- **TaskTemplate** – Specification of the tasks to start as part of the new service.
-    - **ContainerSpec** - Container settings for containers started as part of this task.
-        - **Image** – A string specifying the image name to use for the container.
-        - **Command** – The command to be run in the image.
-        - **Args** – Arguments to the command.
-        - **Env** – A list of environment variables in the form of `["VAR=value"[,"VAR2=value2"]]`.
-        - **Dir** – A string specifying the working directory for commands to run in.
-        - **User** – A string value specifying the user inside the container.
-        - **Labels** – A map of labels to associate with the service (e.g.,
-          `{"key":"value", "key2":"value2"}`).
-        - **TTY** – A boolean indicating whether a pseudo-TTY should be allocated.
-        - **Mounts** – Specification for mounts to be added to containers
-          created as part of the service.
-            - **Target** – Container path.
-            - **Source** – Mount source (e.g. a volume name, a host path).
-            - **Type** – The mount type (`bind`, or `volume`).
-            - **ReadOnly** – A boolean indicating whether the mount should be read-only.
-            - **BindOptions** - Optional configuration for the `bind` type.
-              - **Propagation** – A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`.
-            - **VolumeOptions** – Optional configuration for the `volume` type.
-                - **NoCopy** – A boolean indicating if volume should be
-                  populated with the data from the target. (Default false)
-                - **Labels** – User-defined name and labels for the volume.
-                - **DriverConfig** – Map of driver-specific options.
-                  - **Name** - Name of the driver to use to create the volume.
-                  - **Options** - key/value map of driver specific options.
-        - **StopGracePeriod** – Amount of time to wait for the container to terminate before
-          forcefully killing it.
-        - **DNSConfig** – Specification for DNS related configurations in
-          resolver configuration file (resolv.conf).
-            - **Nameservers** – A list of the IP addresses of the name servers.
-            - **Search** – A search list for host-name lookup.
-            - **Options** – A list of internal resolver variables to be modified (e.g., `debug`, `ndots:3`, etc.).
-    - **LogDriver** - Log configuration for containers created as part of the
-      service.
-        - **Name** - Name of the logging driver to use (`json-file`, `syslog`,
-          `journald`, `gelf`, `fluentd`, `awslogs`, `splunk`, `etwlogs`, `none`).
-        - **Options** - Driver-specific options.
-    - **Resources** – Resource requirements which apply to each individual container created as part
-      of the service.
-        - **Limits** – Define resources limits.
-            - **NanoCPUs** – CPU limit in units of 10<sup>-9</sup> CPU shares.
-            - **MemoryBytes** – Memory limit in Bytes.
-        - **Reservation** – Define resources reservation.
-            - **NanoCPUs** – CPU reservation in units of 10<sup>-9</sup> CPU shares.
-            - **MemoryBytes** – Memory reservation in Bytes.
-    - **RestartPolicy** – Specification for the restart policy which applies to containers created
-      as part of this service.
-        - **Condition** – Condition for restart (`none`, `on-failure`, or `any`).
-        - **Delay** – Delay between restart attempts, in nanoseconds.
-        - **MaxAttempts** – Maximum attempts to restart a given container before giving up (default value
-          is 0, which is ignored).
-        - **Window** – Windows is the time window used to evaluate the restart policy (default value is
-          0, which is unbounded).
-    - **Placement** – An array of constraints.
-    - **ForceUpdate**: A counter that triggers an update even if no relevant parameters have been changed.
-- **Mode** – Scheduling mode for the service (`replicated` or `global`, defaults to `replicated`).
-- **UpdateConfig** – Specification for the update strategy of the service.
-    - **Parallelism** – Maximum number of tasks to be updated in one iteration (0 means unlimited
-      parallelism).
-    - **Delay** – Amount of time between updates, in nanoseconds.
-    - **FailureAction** - Action to take if an updated task fails to run, or stops running during the
-      update. Values are `continue` and `pause`.
-    - **Monitor** - Amount of time to monitor each updated task for failures, in nanoseconds.
-    - **MaxFailureRatio** - The fraction of tasks that may fail during an update before the
-      failure action is invoked, specified as a floating point number between 0 and 1. The default is 0.
-- **Networks** – Array of network names or IDs to attach the service to.
-- **EndpointSpec** – Properties that can be configured to access and load balance a service.
-    - **Mode** – The mode of resolution to use for internal load balancing
-      between tasks (`vip` or `dnsrr`). Defaults to `vip` if not provided.
-    - **Ports** – List of exposed ports that this service is accessible on from
-      the outside, in the form of:
-      `{"Protocol": <"tcp"|"udp">, "PublishedPort": <port>, "TargetPort": <port>}`.
-      Ports can only be provided if `vip` resolution mode is used.
-
-**Request Headers**:
-
-- **Content-type** – Set to `"application/json"`.
-- **X-Registry-Auth** – base64-encoded AuthConfig object, containing either
-  login information, or a token. Refer to the [create an image](#create-an-image)
-  section for more details.
-
-
-### Remove a service
-
-
-`DELETE /services/(id or name)`
-
-Stop and remove the service `id`
-
-**Example request**:
-
-    DELETE /v1.25/services/16253994b7c4 HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Length: 0
-    Content-Type: text/plain; charset=utf-8
-
-**Status codes**:
-
--   **200** – no error
--   **404** – no such service
--   **500** – server error
-
-### Inspect one or more services
-
-
-`GET /services/(id or name)`
-
-Return information on the service `id`.
-
-**Example request**:
-
-    GET /v1.25/services/1cb4dnqcyx6m66g2t538x3rxha HTTP/1.1
-
-**Example response**:
-
-    {
-      "ID": "ak7w3gjqoa3kuz8xcpnyy0pvl",
-      "Version": {
-        "Index": 95
-      },
-      "CreatedAt": "2016-06-07T21:10:20.269723157Z",
-      "UpdatedAt": "2016-06-07T21:10:20.276301259Z",
-      "Spec": {
-        "Name": "redis",
-        "TaskTemplate": {
-          "ContainerSpec": {
-            "Image": "redis"
-          },
-          "Resources": {
-            "Limits": {},
-            "Reservations": {}
-          },
-          "RestartPolicy": {
-            "Condition": "any",
-            "MaxAttempts": 0
-          },
-          "Placement": {}
-        },
-        "Mode": {
-          "Replicated": {
-            "Replicas": 1
-          }
-        },
-        "UpdateConfig": {
-          "Parallelism": 1,
-          "FailureAction": "pause"
-        },
-        "EndpointSpec": {
-          "Mode": "vip",
-          "Ports": [
-            {
-              "Protocol": "tcp",
-              "TargetPort": 6379,
-              "PublishedPort": 30001
-            }
-          ]
-        }
-      },
-      "Endpoint": {
-        "Spec": {
-          "Mode": "vip",
-          "Ports": [
-            {
-              "Protocol": "tcp",
-              "TargetPort": 6379,
-              "PublishedPort": 30001
-            }
-          ]
-        },
-        "Ports": [
-          {
-            "Protocol": "tcp",
-            "TargetPort": 6379,
-            "PublishedPort": 30001
-          }
-        ],
-        "VirtualIPs": [
-          {
-            "NetworkID": "4qvuz4ko70xaltuqbt8956gd1",
-            "Addr": "10.255.0.4/16"
-          }
-        ]
-      }
-    }
-
-**Status codes**:
-
--   **200** – no error
--   **404** – no such service
--   **500** – server error
-
-### Update a service
-
-`POST /services/(id or name)/update`
-
-Update a service. When using this endpoint to create a service using a
-private repository from the registry, the `X-Registry-Auth` header can be used
-to update the authentication information for that is stored for the service.
-The header contains a base64-encoded AuthConfig object. Refer to the [create an
-image](#create-an-image) section for more details.
-
-**Example request**:
-
-    POST /v1.25/services/1cb4dnqcyx6m66g2t538x3rxha/update?version=23 HTTP/1.1
-    Content-Type: application/json
-
-    {
-      "Name": "top",
-      "TaskTemplate": {
-        "ContainerSpec": {
-          "Image": "busybox",
-          "Args": [
-            "top"
-          ],
-          "TTY": true,
-          "DNSConfig": {
-            "Nameservers": ["8.8.8.8"],
-            "Search": ["example.org"],
-            "Options": ["timeout:3"]
-          }
-        },
-        "Resources": {
-          "Limits": {},
-          "Reservations": {}
-        },
-        "RestartPolicy": {
-          "Condition": "any",
-          "MaxAttempts": 0
-        },
-        "Placement": {},
-        "ForceUpdate": 0
-      },
-      "Mode": {
-        "Replicated": {
-          "Replicas": 1
-        }
-      },
-      "UpdateConfig": {
-        "Parallelism": 1,
-        "Monitor": 15000000000,
-        "MaxFailureRatio": 0.15
-      },
-      "EndpointSpec": {
-        "Mode": "vip"
-      }
-    }
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Length: 0
-    Content-Type: text/plain; charset=utf-8
-
-**JSON Parameters**:
-
-- **Name** – User-defined name for the service. Note that renaming services is not supported.
-- **Labels** – A map of labels to associate with the service (e.g., `{"key":"value", "key2":"value2"}`).
-- **TaskTemplate** – Specification of the tasks to start as part of the new service.
-    - **ContainerSpec** - Container settings for containers started as part of this task.
-        - **Image** – A string specifying the image name to use for the container.
-        - **Command** – The command to be run in the image.
-        - **Args** – Arguments to the command.
-        - **Env** – A list of environment variables in the form of `["VAR=value"[,"VAR2=value2"]]`.
-        - **Dir** – A string specifying the working directory for commands to run in.
-        - **User** – A string value specifying the user inside the container.
-        - **Labels** – A map of labels to associate with the service (e.g.,
-          `{"key":"value", "key2":"value2"}`).
-        - **TTY** – A boolean indicating whether a pseudo-TTY should be allocated.
-        - **Mounts** – Specification for mounts to be added to containers created as part of the new
-          service.
-            - **Target** – Container path.
-            - **Source** – Mount source (e.g. a volume name, a host path).
-            - **Type** – The mount type (`bind`, or `volume`).
-            - **ReadOnly** – A boolean indicating whether the mount should be read-only.
-            - **BindOptions** - Optional configuration for the `bind` type
-              - **Propagation** – A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`.
-            - **VolumeOptions** – Optional configuration for the `volume` type.
-                - **NoCopy** – A boolean indicating if volume should be
-                  populated with the data from the target. (Default false)
-                - **Labels** – User-defined name and labels for the volume.
-                - **DriverConfig** – Map of driver-specific options.
-                  - **Name** - Name of the driver to use to create the volume
-                  - **Options** - key/value map of driver specific options
-        - **StopGracePeriod** – Amount of time to wait for the container to terminate before
-          forcefully killing it.
-        - **DNSConfig** – Specification for DNS related configurations in
-          resolver configuration file (resolv.conf).
-            - **Nameservers** – A list of the IP addresses of the name servers.
-            - **Search** – A search list for host-name lookup.
-            - **Options** – A list of internal resolver variables to be modified (e.g., `debug`, `ndots:3`, etc.).
-    - **Resources** – Resource requirements which apply to each individual container created as part
-      of the service.
-        - **Limits** – Define resources limits.
-            - **CPU** – CPU limit
-            - **Memory** – Memory limit
-        - **Reservation** – Define resources reservation.
-            - **CPU** – CPU reservation
-            - **Memory** – Memory reservation
-    - **RestartPolicy** – Specification for the restart policy which applies to containers created
-      as part of this service.
-        - **Condition** – Condition for restart (`none`, `on-failure`, or `any`).
-        - **Delay** – Delay between restart attempts, in nanoseconds.
-        - **MaxAttempts** – Maximum attempts to restart a given container before giving up (default value
-          is 0, which is ignored).
-        - **Window** – Windows is the time window used to evaluate the restart policy (default value is
-          0, which is unbounded).
-    - **Placement** – An array of constraints.
-    - **ForceUpdate**: A counter that triggers an update even if no relevant parameters have been changed.
-- **Mode** – Scheduling mode for the service (`replicated` or `global`, defaults to `replicated`).
-- **UpdateConfig** – Specification for the update strategy of the service.
-    - **Parallelism** – Maximum number of tasks to be updated in one iteration (0 means unlimited
-      parallelism).
-    - **Delay** – Amount of time between updates, in nanoseconds.
-    - **FailureAction** - Action to take if an updated task fails to run, or stops running during the
-      update. Values are `continue` and `pause`.
-    - **Monitor** - Amount of time to monitor each updated task for failures, in nanoseconds.
-    - **MaxFailureRatio** - The fraction of tasks that may fail during an update before the
-      failure action is invoked, specified as a floating point number between 0 and 1. The default is 0.
-- **Networks** – Array of network names or IDs to attach the service to.
-- **EndpointSpec** – Properties that can be configured to access and load balance a service.
-    - **Mode** – The mode of resolution to use for internal load balancing
-      between tasks (`vip` or `dnsrr`). Defaults to `vip` if not provided.
-    - **Ports** – List of exposed ports that this service is accessible on from
-      the outside, in the form of:
-      `{"Protocol": <"tcp"|"udp">, "PublishedPort": <port>, "TargetPort": <port>}`.
-      Ports can only be provided if `vip` resolution mode is used.
-
-**Query parameters**:
-
-- **version** – The version number of the service object being updated. This is
-  required to avoid conflicting writes.
-- **registryAuthFrom** - If the X-Registry-Auth header is not specified, this
-  parameter indicates where to find registry authorization credentials. The
-  valid values are `spec` and `previous-spec`. If unspecified, the default is
-  `spec`.
-
-**Request Headers**:
-
-- **Content-type** – Set to `"application/json"`.
-- **X-Registry-Auth** – base64-encoded AuthConfig object, containing either
-  login information, or a token. Refer to the [create an image](#create-an-image)
-  section for more details.
-
-**Status codes**:
-
--   **200** – no error
--   **404** – no such service
--   **500** – server error
-
-**Example response**:
-
-    HTTP/1.1 200 OK
-    Content-Type: application/json
-
-    {
-      "Warnings": ["unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found"]
-    }
-
-
-### Get service logs
-
-`GET /services/(id or name)/logs`
-
-Get `stdout` and `stderr` logs from the service ``id``
-
-> **Note**:
-> This endpoint works only for services with the `json-file` or `journald` logging drivers.
-
-**Example request**:
-
-     GET /v1.25/services/4fa6e0f0c678/logs?stderr=1&stdout=1&timestamps=1&follow=1&tail=10&since=1428990821 HTTP/1.1
-
-**Example response**:
-
-     HTTP/1.1 101 UPGRADED
-     Content-Type: application/vnd.docker.raw-stream
-     Connection: Upgrade
-     Upgrade: tcp
-
-     {% raw %}
-     {{ STREAM }}
-     {% endraw %}
-
-**Query parameters**:
-
--   **details** - 1/True/true or 0/False/flase, Show extra details provided to logs. Default `false`.
--   **follow** – 1/True/true or 0/False/false, return stream. Default `false`.
--   **stdout** – 1/True/true or 0/False/false, show `stdout` log. Default `false`.
--   **stderr** – 1/True/true or 0/False/false, show `stderr` log. Default `false`.
--   **since** – UNIX timestamp (integer) to filter logs. Specifying a timestamp
-    will only output log-entries since that timestamp. Default: 0 (unfiltered)
--   **timestamps** – 1/True/true or 0/False/false, print timestamps for
-        every log line. Default `false`.
--   **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all.
-
-**Status codes**:
-
--   **101** – no error, hints proxy about hijacking
--   **200** – no error, no upgrade header found
--   **404** – no such service
--   **500** – server error
-
-## 3.10 Tasks
-
-**Note**: Task operations require the engine to be part of a swarm.
-
-### List tasks
-
-
-`GET /tasks`
-
-List tasks
-
-**Example request**:
-
-    GET /v1.25/tasks HTTP/1.1
-
-**Example response**:
-
-    [
-      {
-        "ID": "0kzzo1i0y4jz6027t0k7aezc7",
-        "Version": {
-          "Index": 71
-        },
-        "CreatedAt": "2016-06-07T21:07:31.171892745Z",
-        "UpdatedAt": "2016-06-07T21:07:31.376370513Z",
-        "Spec": {
-          "ContainerSpec": {
-            "Image": "redis"
-          },
-          "Resources": {
-            "Limits": {},
-            "Reservations": {}
-          },
-          "RestartPolicy": {
-            "Condition": "any",
-            "MaxAttempts": 0
-          },
-          "Placement": {}
-        },
-        "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz",
-        "Slot": 1,
-        "NodeID": "60gvrl6tm78dmak4yl7srz94v",
-        "Status": {
-          "Timestamp": "2016-06-07T21:07:31.290032978Z",
-          "State": "running",
-          "Message": "started",
-          "ContainerStatus": {
-            "ContainerID": "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035",
-            "PID": 677
-          }
-        },
-        "DesiredState": "running",
-        "NetworksAttachments": [
-          {
-            "Network": {
-              "ID": "4qvuz4ko70xaltuqbt8956gd1",
-              "Version": {
-                "Index": 18
-              },
-              "CreatedAt": "2016-06-07T20:31:11.912919752Z",
-              "UpdatedAt": "2016-06-07T21:07:29.955277358Z",
-              "Spec": {
-                "Name": "ingress",
-                "Labels": {
-                  "com.docker.swarm.internal": "true"
-                },
-                "DriverConfiguration": {},
-                "IPAMOptions": {
-                  "Driver": {},
-                  "Configs": [
-                    {
-                      "Subnet": "10.255.0.0/16",
-                      "Gateway": "10.255.0.1"
-                    }
-                  ]
-                }
-              },
-              "DriverState": {
-                "Name": "overlay",
-                "Options": {
-                  "com.docker.network.driver.overlay.vxlanid_list": "256"
-                }
-              },
-              "IPAMOptions": {
-                "Driver": {
-                  "Name": "default"
-                },
-                "Configs": [
-                  {
-                    "Subnet": "10.255.0.0/16",
-                    "Gateway": "10.255.0.1"
-                  }
-                ]
-              }
-            },
-            "Addresses": [
-              "10.255.0.10/16"
-            ]
-          }
-        ],
-      },
-      {
-        "ID": "1yljwbmlr8er2waf8orvqpwms",
-        "Version": {
-          "Index": 30
-        },
-        "CreatedAt": "2016-06-07T21:07:30.019104782Z",
-        "UpdatedAt": "2016-06-07T21:07:30.231958098Z",
-        "Name": "hopeful_cori",
-        "Spec": {
-          "ContainerSpec": {
-            "Image": "redis"
-          },
-          "Resources": {
-            "Limits": {},
-            "Reservations": {}
-          },
-          "RestartPolicy": {
-            "Condition": "any",
-            "MaxAttempts": 0
-          },
-          "Placement": {}
-        },
-        "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz",
-        "Slot": 1,
-        "NodeID": "60gvrl6tm78dmak4yl7srz94v",
-        "Status": {
-          "Timestamp": "2016-06-07T21:07:30.202183143Z",
-          "State": "shutdown",
-          "Message": "shutdown",
-          "ContainerStatus": {
-            "ContainerID": "1cf8d63d18e79668b0004a4be4c6ee58cddfad2dae29506d8781581d0688a213"
-          }
-        },
-        "DesiredState": "shutdown",
-        "NetworksAttachments": [
-          {
-            "Network": {
-              "ID": "4qvuz4ko70xaltuqbt8956gd1",
-              "Version": {
-                "Index": 18
-              },
-              "CreatedAt": "2016-06-07T20:31:11.912919752Z",
-              "UpdatedAt": "2016-06-07T21:07:29.955277358Z",
-              "Spec": {
-                "Name": "ingress",
-                "Labels": {
-                  "com.docker.swarm.internal": "true"
-                },
-                "DriverConfiguration": {},
-                "IPAMOptions": {
-                  "Driver": {},
-                  "Configs": [
-                    {
-                      "Subnet": "10.255.0.0/16",
-                      "Gateway": "10.255.0.1"
-                    }
-                  ]
-                }
-              },
-              "DriverState": {
-                "Name": "overlay",
-                "Options": {
-                  "com.docker.network.driver.overlay.vxlanid_list": "256"
-                }
-              },
-              "IPAMOptions": {
-                "Driver": {
-                  "Name": "default"
-                },
-                "Configs": [
-                  {
-                    "Subnet": "10.255.0.0/16",
-                    "Gateway": "10.255.0.1"
-                  }
-                ]
-              }
-            },
-            "Addresses": [
-              "10.255.0.5/16"
-            ]
-          }
-        ]
-      }
-    ]
-
-**Query parameters**:
-
-- **filters** – a JSON encoded value of the filters (a `map[string][]string`) to process on the
-  services list. Available filters:
-  - `id=<task id>`
-  - `name=<task name>`
-  - `service=<service name>`
-  - `node=<node id or name>`
-  - `label=key` or `label="key=value"`
-  - `desired-state=(running | shutdown | accepted)`
-
-**Status codes**:
-
-- **200** – no error
-- **500** – server error
-
-### Inspect a task
-
-
-`GET /tasks/(task id)`
-
-Get details on a task
-
-**Example request**:
-
-    GET /v1.25/tasks/0kzzo1i0y4jz6027t0k7aezc7 HTTP/1.1
-
-**Example response**:
-
-    {
-      "ID": "0kzzo1i0y4jz6027t0k7aezc7",
-      "Version": {
-        "Index": 71
-      },
-      "CreatedAt": "2016-06-07T21:07:31.171892745Z",
-      "UpdatedAt": "2016-06-07T21:07:31.376370513Z",
-      "Spec": {
-        "ContainerSpec": {
-          "Image": "redis"
-        },
-        "Resources": {
-          "Limits": {},
-          "Reservations": {}
-        },
-        "RestartPolicy": {
-          "Condition": "any",
-          "MaxAttempts": 0
-        },
-        "Placement": {}
-      },
-      "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz",
-      "Slot": 1,
-      "NodeID": "60gvrl6tm78dmak4yl7srz94v",
-      "Status": {
-        "Timestamp": "2016-06-07T21:07:31.290032978Z",
-        "State": "running",
-        "Message": "started",
-        "ContainerStatus": {
-          "ContainerID": "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035",
-          "PID": 677
-        }
-      },
-      "DesiredState": "running",
-      "NetworksAttachments": [
-        {
-          "Network": {
-            "ID": "4qvuz4ko70xaltuqbt8956gd1",
-            "Version": {
-              "Index": 18
-            },
-            "CreatedAt": "2016-06-07T20:31:11.912919752Z",
-            "UpdatedAt": "2016-06-07T21:07:29.955277358Z",
-            "Spec": {
-              "Name": "ingress",
-              "Labels": {
-                "com.docker.swarm.internal": "true"
-              },
-              "DriverConfiguration": {},
-              "IPAMOptions": {
-                "Driver": {},
-                "Configs": [
-                  {
-                    "Subnet": "10.255.0.0/16",
-                    "Gateway": "10.255.0.1"
-                  }
-                ]
-              }
-            },
-            "DriverState": {
-              "Name": "overlay",
-              "Options": {
-                "com.docker.network.driver.overlay.vxlanid_list": "256"
-              }
-            },
-            "IPAMOptions": {
-              "Driver": {
-                "Name": "default"
-              },
-              "Configs": [
-                {
-                  "Subnet": "10.255.0.0/16",
-                  "Gateway": "10.255.0.1"
-                }
-              ]
-            }
-          },
-          "Addresses": [
-            "10.255.0.10/16"
-          ]
-        }
-      ]
-    }
-
-**Status codes**:
-
-- **200** – no error
-- **404** – unknown task
-- **500** – server error
-
-## 3.11 Secrets
-
-**Note**: Secret operations require the engine to be part of a swarm.
-
-### List secrets
-
-`GET /secrets`
-
-List secrets
-
-**Example request**:
-
-    GET /v1.25/secrets HTTP/1.1
-
-**Example response**:
-
-    [
-      {
-        "ID": "ktnbjxoalbkvbvedmg1urrz8h",
-        "Version": {
-          "Index": 11
-        },
-        "CreatedAt": "2016-11-05T01:20:17.327670065Z",
-        "UpdatedAt": "2016-11-05T01:20:17.327670065Z",
-        "Spec": {
-          "Name": "app-dev.crt"
-        },
-        "Digest": "sha256:11d7c6f38253b73e608153c9f662a191ae605e1a3d9b756b0b3426388f91d3fa",
-        "SecretSize": 31
-      }
-    ]
-
-
-**Query parameters**:
-
--   **filters** - a JSON encoded value of the filters (a `map[string][]string`) to process on the secrets list. Available filters:
-  -   `names=<secret name>`
-
-**Status codes**:
-
--   **200** – no error
-
-### Create a secret
-
-`POST /secrets/create`
-
-Create a secret
-
-**Example request**:
-
-    POST /v1.25/secrets/create HTTP/1.1
-    Content-Type: application/json
-
-    {
-      "Name": "app-key.crt",
-      "Labels": {
-        "foo": "bar"
-      },
-      "Data": "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg=="
-    }
-
-**Example response**:
-
-    HTTP/1.1 201 Created
-    Content-Type: application/json
-
-    {
-      "ID": "ktnbjxoalbkvbvedmg1urrz8h"
-    }
-
-**Status codes**:
-
-- **201** – no error
-- **409** – name conflicts with an existing object
-- **503** – server error or node is not part of a swarm
-
-**JSON Parameters**:
-
-- **Name** – User-defined name for the secret.
-- **Labels** – A map of labels to associate with the secret (e.g., `{"key":"value", "key2":"value2"}`).
-- **Data** – Base64-url-safe-encoded secret data
-
-### Inspect a secret
-
-`GET /secrets/(id)`
-
-Get details on the secret `id`
-
-**Example request**:
-
-    GET /v1.25/secrets/ktnbjxoalbkvbvedmg1urrz8h HTTP/1.1
-
-**Example response**:
-
-    {
-      "ID": "ktnbjxoalbkvbvedmg1urrz8h",
-      "Version": {
-        "Index": 11
-      },
-      "CreatedAt": "2016-11-05T01:20:17.327670065Z",
-      "UpdatedAt": "2016-11-05T01:20:17.327670065Z",
-      "Spec": {
-        "Name": "app-dev.crt"
-      },
-      "Digest": "sha256:11d7c6f38253b73e608153c9f662a191ae605e1a3d9b756b0b3426388f91d3fa",
-      "SecretSize": 31
-    }
-
-**Status codes**:
-
-- **200** – no error
-- **404** – unknown secret
-- **406** – node is not part of a swarm
-- **500** – server error
-
-### Remove a secret
-
-`DELETE /secrets/(id)`
-
-Remove the secret `id` from the secret store
-
-**Example request**:
-
-    DELETE /v1.25/secrets/ktnbjxoalbkvbvedmg1urrz8h HTTP/1.1
-
-**Example response**:
-
-    HTTP/1.1 204 No Content
-
-# 4. Going further
-
-## 4.1 Inside `docker run`
-
-As an example, the `docker run` command line makes the following API calls:
-
-- Create the container
-
-- If the status code is 404, it means the image doesn't exist:
-    - Try to pull it.
-    - Then, retry to create the container.
-
-- Start the container.
-
-- If you are not in detached mode:
-- Attach to the container, using `logs=1` (to have `stdout` and
-      `stderr` from the container's start) and `stream=1`
-
-- If in detached mode or only `stdin` is attached, display the container's id.
-
-## 4.2 Hijacking
-
-In this version of the API, `/attach`, uses hijacking to transport `stdin`,
-`stdout`, and `stderr` on the same socket.
-
-To hint potential proxies about connection hijacking, Docker client sends
-connection upgrade headers similarly to websocket.
-
-    Upgrade: tcp
-    Connection: Upgrade
-
-When Docker daemon detects the `Upgrade` header, it switches its status code
-from **200 OK** to **101 UPGRADED** and resends the same headers.
-
-
-## 4.3 CORS Requests
-
-To set cross origin requests to the remote api please give values to
-`--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all,
-default or blank means CORS disabled
-
-    $ dockerd -H="192.168.1.9:2375" --api-cors-header="http://foo.bar"

+ 0 - 23
docs/reference/api/hub_registry_spec.md

@@ -1,23 +0,0 @@
----
-published: false
-title: "The Docker Hub and the Registry v1"
-description: "Documentation for docker Registry and Registry API"
-keywords: "docker, registry, api, hub"
----
-
-<!-- This file is maintained within the docker/docker Github
-     repository at https://github.com/docker/docker/. Make all
-     pull requests against that repo. If you see this file in
-     another repository, consider it read-only there, as it will
-     periodically be overwritten by the definitive file. Pull
-     requests which include edits to this file in other repositories
-     will be rejected.
--->
-
-# The Docker Hub and the Registry v1
-
-This API is deprecated as of 1.7. To view the old version, see the [go
-here](https://docs.docker.com/v1.7/docker/reference/api/hub_registry_spec/) in
-the 1.7 documentation. If you want an overview of the current features in
-Docker Hub or other image management features see the [image management
-overview](https://docs.docker.com/engine/userguide/eng-image/image_management/) in the current documentation set.

File diff suppressed because it is too large
+ 0 - 0
docs/reference/api/images/event_state.gliffy


BIN
docs/reference/api/images/event_state.png


+ 0 - 20
docs/reference/api/index.md

@@ -1,20 +0,0 @@
----
-title: "API Reference"
-description: "Reference"
-keywords: "Engine"
-identifier: "engine_remoteapi"
----
-
-<!-- This file is maintained within the docker/docker Github
-     repository at https://github.com/docker/docker/. Make all
-     pull requests against that repo. If you see this file in
-     another repository, consider it read-only there, as it will
-     periodically be overwritten by the definitive file. Pull
-     requests which include edits to this file in other repositories
-     will be rejected.
--->
-
-# API Reference
-
-* [Docker Remote API](docker_remote_api.md)
-* [Docker Remote API client libraries](remote_api_client_libraries.md)

+ 0 - 138
docs/reference/api/remote_api_client_libraries.md

@@ -1,138 +0,0 @@
----
-title: "Remote API client libraries"
-description: "Various client libraries available to use with the Docker remote API"
-keywords: "API, Docker, index, registry, REST, documentation, clients, C#, Erlang, Go, Groovy, Java, JavaScript, Perl, PHP, Python, Ruby, Rust, Scala"
----
-
-<!-- This file is maintained within the docker/docker Github
-     repository at https://github.com/docker/docker/. Make all
-     pull requests against that repo. If you see this file in
-     another repository, consider it read-only there, as it will
-     periodically be overwritten by the definitive file. Pull
-     requests which include edits to this file in other repositories
-     will be rejected.
--->
-
-# Docker Remote API client libraries
-
-These libraries make it easier to build applications on top of the Docker
-Remote API with various programming languages. They have not been tested by the
-Docker maintainers for compatibility, so if you run into any issues, file them
-with the library maintainers.
-
-<table border="1" class="docutils">
-  <colgroup>
-    <col width="29%">
-    <col width="23%">
-    <col width="48%">
-  </colgroup>
-  <thead valign="bottom">
-    <tr>
-      <th class="head">Language/Framework</th>
-      <th class="head">Name</th>
-      <th class="head">Repository</th>
-    </tr>
-  </thead>
-  <tbody valign = "top">
-    <tr>
-      <td>C#</td>
-      <td>Docker.DotNet</td>
-      <td><a class="reference external" href="https://github.com/ahmetalpbalkan/Docker.DotNet">https://github.com/ahmetalpbalkan/Docker.DotNet</a></td>
-    </tr>
-    <tr>
-      <td>C++</td>
-      <td>lasote/docker_client</td>
-      <td><a class="reference external" href="https://github.com/lasote/docker_client">https://github.com/lasote/docker_client</a></td>
-    </tr>
-    <tr>
-      <td>Erlang</td>
-      <td>erldocker</td>
-      <td><a class="reference external" href="https://github.com/proger/erldocker">https://github.com/proger/erldocker</a></td>
-    </tr>
-    <tr>
-      <td>Dart</td>
-      <td>bwu_docker</td>
-      <td><a class="reference external" href="https://github.com/bwu-dart/bwu_docker">https://github.com/bwu-dart/bwu_docker</a></td>
-    </tr>
-    <tr>
-      <td>Go</td>
-      <td>Docker Go client</td>
-      <td><a class="reference external" href="https://godoc.org/github.com/docker/docker/client">https://godoc.org/github.com/docker/docker/client</a></td>
-    </tr>
-    <tr>
-      <td>Gradle</td>
-      <td>gradle-docker-plugin</td>
-      <td><a class="reference external" href="https://github.com/gesellix/gradle-docker-plugin">https://github.com/gesellix/gradle-docker-plugin</a></td>
-    </tr>
-    <tr>
-      <td>Groovy</td>
-      <td>docker-client</td>
-      <td><a class="reference external" href="https://github.com/gesellix/docker-client">https://github.com/gesellix/docker-client</a></td>
-    </tr>
-    <tr>
-      <td>Haskell</td>
-      <td>docker-hs</td>
-      <td><a class="reference external" href="https://github.com/denibertovic/docker-hs">https://github.com/denibertovic/docker-hs</a></td>
-    </tr>
-    <tr>
-      <td>HTML (Web Components)</td>
-      <td>docker-elements</td>
-      <td><a class="reference external" href="https://github.com/kapalhq/docker-elements">https://github.com/kapalhq/docker-elements</a></td>
-    </tr>
-    <tr>
-      <td>Java</td>
-      <td>docker-java</td>
-      <td><a class="reference external" href="https://github.com/docker-java/docker-java">https://github.com/docker-java/docker-java</a></td>
-    </tr>
-    <tr>
-      <td>Java</td>
-      <td>docker-client</td>
-      <td><a class="reference external" href="https://github.com/spotify/docker-client">https://github.com/spotify/docker-client</a></td>
-    </tr>
-    <tr>
-      <td>NodeJS</td>
-      <td>dockerode</td>
-      <td><a class="reference external" href="https://github.com/apocas/dockerode">https://github.com/apocas/dockerode</a></td>
-    </tr>
-    <tr>
-      <td>Perl</td>
-      <td>Eixo::Docker</td>
-      <td><a class="reference external" href="https://github.com/alambike/eixo-docker">https://github.com/alambike/eixo-docker</a></td>
-    </tr>
-    <tr>
-      <td>PHP</td>
-      <td>Docker-PHP</td>
-      <td><a class="reference external" href="https://github.com/docker-php/docker-php">https://github.com/docker-php/docker-php</a></td>
-    </tr>
-    <tr>
-      <td>Python</td>
-      <td>docker-py</td>
-      <td><a class="reference external" href="https://github.com/docker/docker-py">https://github.com/docker/docker-py</a></td>
-    </tr>
-    <tr>
-      <td>Ruby</td>
-      <td>docker-api</td>
-      <td><a class="reference external" href="https://github.com/swipely/docker-api">https://github.com/swipely/docker-api</a></td>
-    </tr>
-    <tr>
-      <td>Rust</td>
-      <td>docker-rust</td>
-      <td><a class="reference external" href="https://github.com/abh1nav/docker-rust">https://github.com/abh1nav/docker-rust</a></td>
-    </tr>
-    <tr>
-      <td>Rust</td>
-      <td>shiplift</td>
-      <td><a class="reference external" href="https://github.com/softprops/shiplift">https://github.com/softprops/shiplift</a></td>
-    </tr>
-    <tr>
-      <td>Scala</td>
-      <td>tugboat</td>
-      <td><a class="reference external" href="https://github.com/softprops/tugboat">https://github.com/softprops/tugboat</a></td>
-    </tr>
-    <tr>
-      <td>Scala</td>
-      <td>reactive-docker</td>
-      <td><a class="reference external" href="https://github.com/almoehi/reactive-docker">https://github.com/almoehi/reactive-docker</a></td>
-    </tr>
-  </tbody>
-</table>

Some files were not shown because too many files changed in this diff