Browse code

Bump API Version to v1.22

Signed-off-by: Tibor Vass <tibor@docker.com>

Tibor Vass authored on 2015/10/14 09:12:50
Showing 3 changed files
... ...
@@ -18,7 +18,7 @@ import (
18 18
 // Common constants for daemon and client.
19 19
 const (
20 20
 	// Version of Current REST API
21
-	Version version.Version = "1.21"
21
+	Version version.Version = "1.22"
22 22
 
23 23
 	// MinVersion represents Minimun REST API version supported
24 24
 	MinVersion version.Version = "1.12"
... ...
@@ -23,14 +23,15 @@ client must have `root` access to interact with the daemon. If a group named
23 23
 `docker` exists on your system, `docker` applies ownership of the socket to the
24 24
 group.
25 25
 
26
-The current version of the API is v1.21 which means calling `/info` is the same
27
-as calling `/v1.21/info`. To call an older version of the API use
28
-`/v1.20/info`.
26
+The current version of the API is v1.22 which means calling `/info` is the same
27
+as calling `/v1.22/info`. To call an older version of the API use
28
+`/v1.21/info`.
29 29
 
30 30
 Use the table below to find the API version for a Docker version:
31 31
 
32 32
 Docker version  | API version                                     | Changes
33 33
 ----------------|-------------------------------------------------|-----------------------------
34
+1.10.x          | [1.22](/reference/api/docker_remote_api_v1.22/) | [API changes](/reference/api/docker_remote_api/#v1-22-api-changes)
34 35
 1.9.x           | [1.21](/reference/api/docker_remote_api_v1.21/) | [API changes](/reference/api/docker_remote_api/#v1-21-api-changes)
35 36
 1.8.x           | [1.20](/reference/api/docker_remote_api_v1.20/) | [API changes](/reference/api/docker_remote_api/#v1-20-api-changes)
36 37
 1.7.x           | [1.19](/reference/api/docker_remote_api_v1.19/) | [API changes](/reference/api/docker_remote_api/#v1-19-api-changes)
... ...
@@ -89,6 +90,11 @@ Running `docker rmi` emits an **untag** event when removing an image name.  The
89 89
 
90 90
 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.
91 91
 
92
+### v1.22 API changes
93
+
94
+[Docker Remote API v1.22](docker_remote_api_v1.22.md) documentation
95
+
96
+
92 97
 ### v1.21 API changes
93 98
 
94 99
 [Docker Remote API v1.21](docker_remote_api_v1.21.md) documentation
95 100
new file mode 100644
... ...
@@ -0,0 +1,2771 @@
0
+<!--[metadata]>
1
+title = "Remote API v1.22"
2
+description = "API Documentation for Docker"
3
+keywords = ["API, Docker, rcli, REST,  documentation"]
4
+[menu.main]
5
+parent="smn_remoteapi"
6
+weight = 0
7
+<![end-metadata]-->
8
+
9
+# Docker Remote API v1.22
10
+
11
+## 1. Brief introduction
12
+
13
+ - The Remote API has replaced `rcli`.
14
+ - The daemon listens on `unix:///var/run/docker.sock` but you can
15
+   [Bind Docker to another host/port or a Unix socket](../../articles/basics.md#bind-docker-to-another-hostport-or-a-unix-socket).
16
+ - The API tends to be REST. However, for some complex commands, like `attach`
17
+   or `pull`, the HTTP connection is hijacked to transport `stdout`,
18
+   `stdin` and `stderr`.
19
+ - When the client API version is newer than the daemon's, these calls return an HTTP
20
+   `400 Bad Request` error message.
21
+
22
+# 2. Endpoints
23
+
24
+## 2.1 Containers
25
+
26
+### List containers
27
+
28
+`GET /containers/json`
29
+
30
+List containers
31
+
32
+**Example request**:
33
+
34
+    GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1
35
+
36
+**Example response**:
37
+
38
+    HTTP/1.1 200 OK
39
+    Content-Type: application/json
40
+
41
+    [
42
+         {
43
+                 "Id": "8dfafdbc3a40",
44
+                 "Names":["/boring_feynman"],
45
+                 "Image": "ubuntu:latest",
46
+		 "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82",
47
+                 "Command": "echo 1",
48
+                 "Created": 1367854155,
49
+                 "Status": "Exit 0",
50
+                 "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}],
51
+                 "Labels": {
52
+                         "com.example.vendor": "Acme",
53
+                         "com.example.license": "GPL",
54
+                         "com.example.version": "1.0"
55
+                 },
56
+                 "SizeRw": 12288,
57
+                 "SizeRootFs": 0
58
+         },
59
+         {
60
+                 "Id": "9cd87474be90",
61
+                 "Names":["/coolName"],
62
+                 "Image": "ubuntu:latest",
63
+		 "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82",
64
+                 "Command": "echo 222222",
65
+                 "Created": 1367854155,
66
+                 "Status": "Exit 0",
67
+                 "Ports": [],
68
+                 "Labels": {},
69
+                 "SizeRw": 12288,
70
+                 "SizeRootFs": 0
71
+         },
72
+         {
73
+                 "Id": "3176a2479c92",
74
+                 "Names":["/sleepy_dog"],
75
+                 "Image": "ubuntu:latest",
76
+		 "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82",
77
+                 "Command": "echo 3333333333333333",
78
+                 "Created": 1367854154,
79
+                 "Status": "Exit 0",
80
+                 "Ports":[],
81
+                 "Labels": {},
82
+                 "SizeRw":12288,
83
+                 "SizeRootFs":0
84
+         },
85
+         {
86
+                 "Id": "4cb07b47f9fb",
87
+                 "Names":["/running_cat"],
88
+                 "Image": "ubuntu:latest",
89
+		 "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82",
90
+                 "Command": "echo 444444444444444444444444444444444",
91
+                 "Created": 1367854152,
92
+                 "Status": "Exit 0",
93
+                 "Ports": [],
94
+                 "Labels": {},
95
+                 "SizeRw": 12288,
96
+                 "SizeRootFs": 0
97
+         }
98
+    ]
99
+
100
+Query Parameters:
101
+
102
+-   **all** – 1/True/true or 0/False/false, Show all containers.
103
+        Only running containers are shown by default (i.e., this defaults to false)
104
+-   **limit** – Show `limit` last created
105
+        containers, include non-running ones.
106
+-   **since** – Show only containers created since Id, include
107
+        non-running ones.
108
+-   **before** – Show only containers created before Id, include
109
+        non-running ones.
110
+-   **size** – 1/True/true or 0/False/false, Show the containers
111
+        sizes
112
+-   **filters** - a JSON encoded value of the filters (a `map[string][]string`) to process on the containers list. Available filters:
113
+  -   `exited=<int>`; -- containers with exit code of  `<int>` ;
114
+  -   `status=`(`created`|`restarting`|`running`|`paused`|`exited`)
115
+  -   `label=key` or `label="key=value"` of a container label
116
+
117
+Status Codes:
118
+
119
+-   **200** – no error
120
+-   **400** – bad parameter
121
+-   **500** – server error
122
+
123
+### Create a container
124
+
125
+`POST /containers/create`
126
+
127
+Create a container
128
+
129
+**Example request**:
130
+
131
+    POST /containers/create HTTP/1.1
132
+    Content-Type: application/json
133
+
134
+    {
135
+           "Hostname": "",
136
+           "Domainname": "",
137
+           "User": "",
138
+           "AttachStdin": false,
139
+           "AttachStdout": true,
140
+           "AttachStderr": true,
141
+           "Tty": false,
142
+           "OpenStdin": false,
143
+           "StdinOnce": false,
144
+           "Env": null,
145
+           "Cmd": [
146
+                   "date"
147
+           ],
148
+           "Entrypoint": "",
149
+           "Image": "ubuntu",
150
+           "Labels": {
151
+                   "com.example.vendor": "Acme",
152
+                   "com.example.license": "GPL",
153
+                   "com.example.version": "1.0"
154
+           },
155
+           "Mounts": [
156
+             {
157
+               "Source": "/data",
158
+               "Destination": "/data",
159
+               "Mode": "ro,Z",
160
+               "RW": false
161
+             }
162
+           ],
163
+           "WorkingDir": "",
164
+           "NetworkDisabled": false,
165
+           "MacAddress": "12:34:56:78:9a:bc",
166
+           "ExposedPorts": {
167
+                   "22/tcp": {}
168
+           },
169
+           "StopSignal": "SIGTERM",
170
+           "HostConfig": {
171
+             "Binds": ["/tmp:/tmp"],
172
+             "Links": ["redis3:redis"],
173
+             "LxcConf": {"lxc.utsname":"docker"},
174
+             "Memory": 0,
175
+             "MemorySwap": 0,
176
+             "MemoryReservation": 0,
177
+             "KernelMemory": 0,
178
+             "CpuShares": 512,
179
+             "CpuPeriod": 100000,
180
+             "CpuQuota": 50000,
181
+             "CpusetCpus": "0,1",
182
+             "CpusetMems": "0,1",
183
+             "BlkioWeight": 300,
184
+             "MemorySwappiness": 60,
185
+             "OomKillDisable": false,
186
+             "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
187
+             "PublishAllPorts": false,
188
+             "Privileged": false,
189
+             "ReadonlyRootfs": false,
190
+             "Dns": ["8.8.8.8"],
191
+             "DnsOptions": [""],
192
+             "DnsSearch": [""],
193
+             "ExtraHosts": null,
194
+             "VolumesFrom": ["parent", "other:ro"],
195
+             "CapAdd": ["NET_ADMIN"],
196
+             "CapDrop": ["MKNOD"],
197
+             "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 },
198
+             "NetworkMode": "bridge",
199
+             "Devices": [],
200
+             "Ulimits": [{}],
201
+             "LogConfig": { "Type": "json-file", "Config": {} },
202
+             "SecurityOpt": [""],
203
+             "CgroupParent": "",
204
+	      "VolumeDriver": ""
205
+          }
206
+      }
207
+
208
+**Example response**:
209
+
210
+      HTTP/1.1 201 Created
211
+      Content-Type: application/json
212
+
213
+      {
214
+           "Id":"e90e34656806",
215
+           "Warnings":[]
216
+      }
217
+
218
+Json Parameters:
219
+
220
+-   **Hostname** - A string value containing the hostname to use for the
221
+      container.
222
+-   **Domainname** - A string value containing the domain name to use
223
+      for the container.
224
+-   **User** - A string value specifying the user inside the container.
225
+-   **Memory** - Memory limit in bytes.
226
+-   **MemorySwap** - Total memory limit (memory + swap); set `-1` to disable swap
227
+      You must use this with `memory` and make the swap value larger than `memory`.
228
+-   **MemoryReservation** - Memory soft limit in bytes.
229
+-   **KernelMemory** - Kernel memory limit in bytes.
230
+-   **CpuShares** - An integer value containing the container's CPU Shares
231
+      (ie. the relative weight vs other containers).
232
+-   **CpuPeriod** - The length of a CPU period in microseconds.
233
+-   **CpuQuota** - Microseconds of CPU time that the container can get in a CPU period.
234
+-   **Cpuset** - Deprecated please don't use. Use `CpusetCpus` instead.
235
+-   **CpusetCpus** - String value containing the `cgroups CpusetCpus` to use.
236
+-   **CpusetMems** - Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.
237
+-   **BlkioWeight** - Block IO weight (relative weight) accepts a weight value between 10 and 1000.
238
+-   **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
239
+-   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
240
+-   **AttachStdin** - Boolean value, attaches to `stdin`.
241
+-   **AttachStdout** - Boolean value, attaches to `stdout`.
242
+-   **AttachStderr** - Boolean value, attaches to `stderr`.
243
+-   **Tty** - Boolean value, Attach standard streams to a `tty`, including `stdin` if it is not closed.
244
+-   **OpenStdin** - Boolean value, opens stdin,
245
+-   **StdinOnce** - Boolean value, close `stdin` after the 1 attached client disconnects.
246
+-   **Env** - A list of environment variables in the form of `VAR=value`
247
+-   **Labels** - Adds a map of labels to a container. To specify a map: `{"key":"value"[,"key2":"value2"]}`
248
+-   **Cmd** - Command to run specified as a string or an array of strings.
249
+-   **Entrypoint** - Set the entry point for the container as a string or an array
250
+      of strings.
251
+-   **Image** - A string specifying the image name to use for the container.
252
+-   **Mounts** - An array of mount points in the container.
253
+-   **WorkingDir** - A string specifying the working directory for commands to
254
+      run in.
255
+-   **NetworkDisabled** - Boolean value, when true disables networking for the
256
+      container
257
+-   **ExposedPorts** - An object mapping ports to an empty object in the form of:
258
+      `"ExposedPorts": { "<port>/<tcp|udp>: {}" }`
259
+-   **StopSignal** - Signal to stop a container as a string or unsigned integer. `SIGTERM` by default.
260
+-   **HostConfig**
261
+    -   **Binds** – A list of volume bindings for this container. Each volume binding is a string in one of these forms:
262
+           + `container_path` to create a new volume for the container
263
+           + `host_path:container_path` to bind-mount a host path into the container
264
+           + `host_path:container_path:ro` to make the bind-mount read-only inside the container.
265
+    -   **Links** - A list of links for the container. Each link entry should be
266
+          in the form of `container_name:alias`.
267
+    -   **LxcConf** - LXC specific configurations. These configurations only
268
+          work when using the `lxc` execution driver.
269
+    -   **PortBindings** - A map of exposed container ports and the host port they
270
+          should map to. A JSON object in the form
271
+          `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
272
+          Take note that `port` is specified as a string and not an integer value.
273
+    -   **PublishAllPorts** - Allocates a random host port for all of a container's
274
+          exposed ports. Specified as a boolean value.
275
+    -   **Privileged** - Gives the container full access to the host. Specified as
276
+          a boolean value.
277
+    -   **ReadonlyRootfs** - Mount the container's root filesystem as read only.
278
+          Specified as a boolean value.
279
+    -   **Dns** - A list of DNS servers for the container to use.
280
+    -   **DnsOptions** - A list of DNS options
281
+    -   **DnsSearch** - A list of DNS search domains
282
+    -   **ExtraHosts** - A list of hostnames/IP mappings to add to the
283
+        container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`.
284
+    -   **VolumesFrom** - A list of volumes to inherit from another container.
285
+          Specified in the form `<container name>[:<ro|rw>]`
286
+    -   **CapAdd** - A list of kernel capabilities to add to the container.
287
+    -   **Capdrop** - A list of kernel capabilities to drop from the container.
288
+    -   **RestartPolicy** – The behavior to apply when the container exits.  The
289
+            value is an object with a `Name` property of either `"always"` to
290
+            always restart, `"unless-stopped"` to restart always except when
291
+            user has manually stopped the container or `"on-failure"` to restart only when the container
292
+            exit code is non-zero.  If `on-failure` is used, `MaximumRetryCount`
293
+            controls the number of times to retry before giving up.
294
+            The default is not to restart. (optional)
295
+            An ever increasing delay (double the previous delay, starting at 100mS)
296
+            is added before each restart to prevent flooding the server.
297
+    -   **NetworkMode** - Sets the networking mode for the container. Supported
298
+          values are: `bridge`, `host`, and `container:<name|id>`
299
+    -   **Devices** - A list of devices to add to the container specified as a JSON object in the
300
+      form
301
+          `{ "PathOnHost": "/dev/deviceName", "PathInContainer": "/dev/deviceName", "CgroupPermissions": "mrw"}`
302
+    -   **Ulimits** - A list of ulimits to set in the container, specified as
303
+          `{ "Name": <name>, "Soft": <soft limit>, "Hard": <hard limit> }`, for example:
304
+          `Ulimits: { "Name": "nofile", "Soft": 1024, "Hard": 2048 }`
305
+    -   **SecurityOpt**: A list of string values to customize labels for MLS
306
+        systems, such as SELinux.
307
+    -   **LogConfig** - Log configuration for the container, specified as a JSON object in the form
308
+          `{ "Type": "<driver_name>", "Config": {"key1": "val1"}}`.
309
+          Available types: `json-file`, `syslog`, `journald`, `gelf`, `awslogs`, `none`.
310
+          `json-file` logging driver.
311
+    -   **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.
312
+    -   **VolumeDriver** - Driver that this container users to mount volumes.
313
+
314
+Query Parameters:
315
+
316
+-   **name** – Assign the specified name to the container. Must
317
+    match `/?[a-zA-Z0-9_-]+`.
318
+
319
+Status Codes:
320
+
321
+-   **201** – no error
322
+-   **404** – no such container
323
+-   **406** – impossible to attach (container not running)
324
+-   **500** – server error
325
+
326
+### Inspect a container
327
+
328
+`GET /containers/(id)/json`
329
+
330
+Return low-level information on the container `id`
331
+
332
+
333
+**Example request**:
334
+
335
+      GET /containers/4fa6e0f0c678/json HTTP/1.1
336
+
337
+**Example response**:
338
+
339
+    HTTP/1.1 200 OK
340
+    Content-Type: application/json
341
+
342
+    {
343
+		"AppArmorProfile": "",
344
+		"Args": [
345
+			"-c",
346
+			"exit 9"
347
+		],
348
+		"Config": {
349
+			"AttachStderr": true,
350
+			"AttachStdin": false,
351
+			"AttachStdout": true,
352
+			"Cmd": [
353
+				"/bin/sh",
354
+				"-c",
355
+				"exit 9"
356
+			],
357
+			"Domainname": "",
358
+			"Entrypoint": null,
359
+			"Env": [
360
+				"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
361
+			],
362
+			"ExposedPorts": null,
363
+			"Hostname": "ba033ac44011",
364
+			"Image": "ubuntu",
365
+			"Labels": {
366
+				"com.example.vendor": "Acme",
367
+				"com.example.license": "GPL",
368
+				"com.example.version": "1.0"
369
+			},
370
+			"MacAddress": "",
371
+			"NetworkDisabled": false,
372
+			"OnBuild": null,
373
+			"OpenStdin": false,
374
+			"StdinOnce": false,
375
+			"Tty": false,
376
+			"User": "",
377
+			"Volumes": null,
378
+			"WorkingDir": "",
379
+			"StopSignal": "SIGTERM"
380
+		},
381
+		"Created": "2015-01-06T15:47:31.485331387Z",
382
+		"Driver": "devicemapper",
383
+		"ExecDriver": "native-0.2",
384
+		"ExecIDs": null,
385
+		"HostConfig": {
386
+			"Binds": null,
387
+			"BlkioWeight": 0,
388
+			"CapAdd": null,
389
+			"CapDrop": null,
390
+			"ContainerIDFile": "",
391
+			"CpusetCpus": "",
392
+			"CpusetMems": "",
393
+			"CpuShares": 0,
394
+			"CpuPeriod": 100000,
395
+			"Devices": [],
396
+			"Dns": null,
397
+			"DnsOptions": null,
398
+			"DnsSearch": null,
399
+			"ExtraHosts": null,
400
+			"IpcMode": "",
401
+			"Links": null,
402
+			"LxcConf": [],
403
+			"Memory": 0,
404
+			"MemorySwap": 0,
405
+			"MemoryReservation": 0,
406
+			"KernelMemory": 0,
407
+			"OomKillDisable": false,
408
+			"NetworkMode": "bridge",
409
+			"PortBindings": {},
410
+			"Privileged": false,
411
+			"ReadonlyRootfs": false,
412
+			"PublishAllPorts": false,
413
+			"RestartPolicy": {
414
+				"MaximumRetryCount": 2,
415
+				"Name": "on-failure"
416
+			},
417
+			"LogConfig": {
418
+				"Config": null,
419
+				"Type": "json-file"
420
+			},
421
+			"SecurityOpt": null,
422
+			"VolumesFrom": null,
423
+			"Ulimits": [{}],
424
+			"VolumeDriver": ""
425
+		},
426
+		"HostnamePath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname",
427
+		"HostsPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts",
428
+		"LogPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log",
429
+		"Id": "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39",
430
+		"Image": "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2",
431
+		"MountLabel": "",
432
+		"Name": "/boring_euclid",
433
+		"NetworkSettings": {
434
+			"Bridge": "",
435
+			"Gateway": "",
436
+			"IPAddress": "",
437
+			"IPPrefixLen": 0,
438
+			"MacAddress": "",
439
+			"Ports": null
440
+		},
441
+		"Path": "/bin/sh",
442
+		"ProcessLabel": "",
443
+		"ResolvConfPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf",
444
+		"RestartCount": 1,
445
+		"State": {
446
+			"Error": "",
447
+			"ExitCode": 9,
448
+			"FinishedAt": "2015-01-06T15:47:32.080254511Z",
449
+			"OOMKilled": false,
450
+			"Paused": false,
451
+			"Pid": 0,
452
+			"Restarting": false,
453
+			"Running": true,
454
+			"StartedAt": "2015-01-06T15:47:32.072697474Z",
455
+			"Status": "running"
456
+		},
457
+		"Mounts": [
458
+			{
459
+				"Source": "/data",
460
+				"Destination": "/data",
461
+				"Mode": "ro,Z",
462
+				"RW": false
463
+			}
464
+		]
465
+	}
466
+
467
+**Example request, with size information**:
468
+
469
+    GET /containers/4fa6e0f0c678/json?size=1 HTTP/1.1
470
+
471
+**Example response, with size information**:
472
+
473
+    HTTP/1.1 200 OK
474
+    Content-Type: application/json
475
+
476
+    {
477
+    ....
478
+    "SizeRw": 0,
479
+    "SizeRootFs": 972,
480
+    ....
481
+    }
482
+
483
+Query Parameters:
484
+
485
+-   **size** – 1/True/true or 0/False/false, return container size information. Default is `false`.
486
+
487
+Status Codes:
488
+
489
+-   **200** – no error
490
+-   **404** – no such container
491
+-   **500** – server error
492
+
493
+### List processes running inside a container
494
+
495
+`GET /containers/(id)/top`
496
+
497
+List processes running inside the container `id`
498
+
499
+**Example request**:
500
+
501
+    GET /containers/4fa6e0f0c678/top HTTP/1.1
502
+
503
+**Example response**:
504
+
505
+    HTTP/1.1 200 OK
506
+    Content-Type: application/json
507
+
508
+    {
509
+         "Titles": [
510
+                 "USER",
511
+                 "PID",
512
+                 "%CPU",
513
+                 "%MEM",
514
+                 "VSZ",
515
+                 "RSS",
516
+                 "TTY",
517
+                 "STAT",
518
+                 "START",
519
+                 "TIME",
520
+                 "COMMAND"
521
+                 ],
522
+         "Processes": [
523
+                 ["root","20147","0.0","0.1","18060","1864","pts/4","S","10:06","0:00","bash"],
524
+                 ["root","20271","0.0","0.0","4312","352","pts/4","S+","10:07","0:00","sleep","10"]
525
+         ]
526
+    }
527
+
528
+Query Parameters:
529
+
530
+-   **ps_args** – ps arguments to use (e.g., aux)
531
+
532
+Status Codes:
533
+
534
+-   **200** – no error
535
+-   **404** – no such container
536
+-   **500** – server error
537
+
538
+### Get container logs
539
+
540
+`GET /containers/(id)/logs`
541
+
542
+Get `stdout` and `stderr` logs from the container ``id``
543
+
544
+> **Note**:
545
+> This endpoint works only for containers with `json-file` logging driver.
546
+
547
+**Example request**:
548
+
549
+     GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1&timestamps=1&follow=1&tail=10&since=1428990821 HTTP/1.1
550
+
551
+**Example response**:
552
+
553
+     HTTP/1.1 101 UPGRADED
554
+     Content-Type: application/vnd.docker.raw-stream
555
+     Connection: Upgrade
556
+     Upgrade: tcp
557
+
558
+     {{ STREAM }}
559
+
560
+Query Parameters:
561
+
562
+-   **follow** – 1/True/true or 0/False/false, return stream. Default `false`.
563
+-   **stdout** – 1/True/true or 0/False/false, show `stdout` log. Default `false`.
564
+-   **stderr** – 1/True/true or 0/False/false, show `stderr` log. Default `false`.
565
+-   **since** – UNIX timestamp (integer) to filter logs. Specifying a timestamp
566
+    will only output log-entries since that timestamp. Default: 0 (unfiltered)
567
+-   **timestamps** – 1/True/true or 0/False/false, print timestamps for
568
+        every log line. Default `false`.
569
+-   **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all.
570
+
571
+Status Codes:
572
+
573
+-   **101** – no error, hints proxy about hijacking
574
+-   **200** – no error, no upgrade header found
575
+-   **404** – no such container
576
+-   **500** – server error
577
+
578
+### Inspect changes on a container's filesystem
579
+
580
+`GET /containers/(id)/changes`
581
+
582
+Inspect changes on container `id`'s filesystem
583
+
584
+**Example request**:
585
+
586
+    GET /containers/4fa6e0f0c678/changes HTTP/1.1
587
+
588
+**Example response**:
589
+
590
+    HTTP/1.1 200 OK
591
+    Content-Type: application/json
592
+
593
+    [
594
+         {
595
+                 "Path": "/dev",
596
+                 "Kind": 0
597
+         },
598
+         {
599
+                 "Path": "/dev/kmsg",
600
+                 "Kind": 1
601
+         },
602
+         {
603
+                 "Path": "/test",
604
+                 "Kind": 1
605
+         }
606
+    ]
607
+
608
+Values for `Kind`:
609
+
610
+- `0`: Modify
611
+- `1`: Add
612
+- `2`: Delete
613
+
614
+Status Codes:
615
+
616
+-   **200** – no error
617
+-   **404** – no such container
618
+-   **500** – server error
619
+
620
+### Export a container
621
+
622
+`GET /containers/(id)/export`
623
+
624
+Export the contents of container `id`
625
+
626
+**Example request**:
627
+
628
+    GET /containers/4fa6e0f0c678/export HTTP/1.1
629
+
630
+**Example response**:
631
+
632
+    HTTP/1.1 200 OK
633
+    Content-Type: application/octet-stream
634
+
635
+    {{ TAR STREAM }}
636
+
637
+Status Codes:
638
+
639
+-   **200** – no error
640
+-   **404** – no such container
641
+-   **500** – server error
642
+
643
+### Get container stats based on resource usage
644
+
645
+`GET /containers/(id)/stats`
646
+
647
+This endpoint returns a live stream of a container's resource usage statistics.
648
+
649
+> **Note**: this functionality currently only works when using the *libcontainer* exec-driver.
650
+
651
+**Example request**:
652
+
653
+    GET /containers/redis1/stats HTTP/1.1
654
+
655
+**Example response**:
656
+
657
+      HTTP/1.1 200 OK
658
+      Content-Type: application/json
659
+
660
+      {
661
+         "read" : "2015-01-08T22:57:31.547920715Z",
662
+         "network": {
663
+                 "eth0": {
664
+                     "rx_bytes": 5338,
665
+                     "rx_dropped": 0,
666
+                     "rx_errors": 0,
667
+                     "rx_packets": 36,
668
+                     "tx_bytes": 648,
669
+                     "tx_dropped": 0,
670
+                     "tx_errors": 0,
671
+                     "tx_packets": 8
672
+                 },
673
+                 "eth5": {
674
+                     "rx_bytes": 4641,
675
+                     "rx_dropped": 0,
676
+                     "rx_errors": 0,
677
+                     "rx_packets": 26,
678
+                     "tx_bytes": 690,
679
+                     "tx_dropped": 0,
680
+                     "tx_errors": 0,
681
+                     "tx_packets": 9
682
+                 }
683
+         },
684
+         "memory_stats" : {
685
+            "stats" : {
686
+               "total_pgmajfault" : 0,
687
+               "cache" : 0,
688
+               "mapped_file" : 0,
689
+               "total_inactive_file" : 0,
690
+               "pgpgout" : 414,
691
+               "rss" : 6537216,
692
+               "total_mapped_file" : 0,
693
+               "writeback" : 0,
694
+               "unevictable" : 0,
695
+               "pgpgin" : 477,
696
+               "total_unevictable" : 0,
697
+               "pgmajfault" : 0,
698
+               "total_rss" : 6537216,
699
+               "total_rss_huge" : 6291456,
700
+               "total_writeback" : 0,
701
+               "total_inactive_anon" : 0,
702
+               "rss_huge" : 6291456,
703
+               "hierarchical_memory_limit" : 67108864,
704
+               "total_pgfault" : 964,
705
+               "total_active_file" : 0,
706
+               "active_anon" : 6537216,
707
+               "total_active_anon" : 6537216,
708
+               "total_pgpgout" : 414,
709
+               "total_cache" : 0,
710
+               "inactive_anon" : 0,
711
+               "active_file" : 0,
712
+               "pgfault" : 964,
713
+               "inactive_file" : 0,
714
+               "total_pgpgin" : 477
715
+            },
716
+            "max_usage" : 6651904,
717
+            "usage" : 6537216,
718
+            "failcnt" : 0,
719
+            "limit" : 67108864
720
+         },
721
+         "blkio_stats" : {},
722
+         "cpu_stats" : {
723
+            "cpu_usage" : {
724
+               "percpu_usage" : [
725
+                  16970827,
726
+                  1839451,
727
+                  7107380,
728
+                  10571290
729
+               ],
730
+               "usage_in_usermode" : 10000000,
731
+               "total_usage" : 36488948,
732
+               "usage_in_kernelmode" : 20000000
733
+            },
734
+            "system_cpu_usage" : 20091722000000000,
735
+            "throttling_data" : {}
736
+         }
737
+      }
738
+
739
+Query Parameters:
740
+
741
+-   **stream** – 1/True/true or 0/False/false, pull stats once then disconnect. Default `true`.
742
+
743
+Status Codes:
744
+
745
+-   **200** – no error
746
+-   **404** – no such container
747
+-   **500** – server error
748
+
749
+### Resize a container TTY
750
+
751
+`POST /containers/(id)/resize`
752
+
753
+Resize the TTY for container with  `id`. The unit is number of characters. You must restart the container for the resize to take effect.
754
+
755
+**Example request**:
756
+
757
+      POST /containers/4fa6e0f0c678/resize?h=40&w=80 HTTP/1.1
758
+
759
+**Example response**:
760
+
761
+      HTTP/1.1 200 OK
762
+      Content-Length: 0
763
+      Content-Type: text/plain; charset=utf-8
764
+
765
+Query Parameters:
766
+
767
+-   **h** – height of `tty` session
768
+-   **w** – width
769
+
770
+Status Codes:
771
+
772
+-   **200** – no error
773
+-   **404** – No such container
774
+-   **500** – Cannot resize container
775
+
776
+### Start a container
777
+
778
+`POST /containers/(id)/start`
779
+
780
+Start the container `id`
781
+
782
+> **Note**:
783
+> For backwards compatibility, this endpoint accepts a `HostConfig` as JSON-encoded request body.
784
+> See [create a container](#create-a-container) for details.
785
+
786
+**Example request**:
787
+
788
+    POST /containers/(id)/start HTTP/1.1
789
+
790
+**Example response**:
791
+
792
+    HTTP/1.1 204 No Content
793
+
794
+Status Codes:
795
+
796
+-   **204** – no error
797
+-   **304** – container already started
798
+-   **404** – no such container
799
+-   **500** – server error
800
+
801
+### Stop a container
802
+
803
+`POST /containers/(id)/stop`
804
+
805
+Stop the container `id`
806
+
807
+**Example request**:
808
+
809
+    POST /containers/e90e34656806/stop?t=5 HTTP/1.1
810
+
811
+**Example response**:
812
+
813
+    HTTP/1.1 204 No Content
814
+
815
+Query Parameters:
816
+
817
+-   **t** – number of seconds to wait before killing the container
818
+
819
+Status Codes:
820
+
821
+-   **204** – no error
822
+-   **304** – container already stopped
823
+-   **404** – no such container
824
+-   **500** – server error
825
+
826
+### Restart a container
827
+
828
+`POST /containers/(id)/restart`
829
+
830
+Restart the container `id`
831
+
832
+**Example request**:
833
+
834
+    POST /containers/e90e34656806/restart?t=5 HTTP/1.1
835
+
836
+**Example response**:
837
+
838
+    HTTP/1.1 204 No Content
839
+
840
+Query Parameters:
841
+
842
+-   **t** – number of seconds to wait before killing the container
843
+
844
+Status Codes:
845
+
846
+-   **204** – no error
847
+-   **404** – no such container
848
+-   **500** – server error
849
+
850
+### Kill a container
851
+
852
+`POST /containers/(id)/kill`
853
+
854
+Kill the container `id`
855
+
856
+**Example request**:
857
+
858
+    POST /containers/e90e34656806/kill HTTP/1.1
859
+
860
+**Example response**:
861
+
862
+    HTTP/1.1 204 No Content
863
+
864
+Query Parameters
865
+
866
+-   **signal** - Signal to send to the container: integer or string like `SIGINT`.
867
+        When not set, `SIGKILL` is assumed and the call waits for the container to exit.
868
+
869
+Status Codes:
870
+
871
+-   **204** – no error
872
+-   **404** – no such container
873
+-   **500** – server error
874
+
875
+### Rename a container
876
+
877
+`POST /containers/(id)/rename`
878
+
879
+Rename the container `id` to a `new_name`
880
+
881
+**Example request**:
882
+
883
+    POST /containers/e90e34656806/rename?name=new_name HTTP/1.1
884
+
885
+**Example response**:
886
+
887
+    HTTP/1.1 204 No Content
888
+
889
+Query Parameters:
890
+
891
+-   **name** – new name for the container
892
+
893
+Status Codes:
894
+
895
+-   **204** – no error
896
+-   **404** – no such container
897
+-   **409** - conflict name already assigned
898
+-   **500** – server error
899
+
900
+### Pause a container
901
+
902
+`POST /containers/(id)/pause`
903
+
904
+Pause the container `id`
905
+
906
+**Example request**:
907
+
908
+    POST /containers/e90e34656806/pause HTTP/1.1
909
+
910
+**Example response**:
911
+
912
+    HTTP/1.1 204 No Content
913
+
914
+Status Codes:
915
+
916
+-   **204** – no error
917
+-   **404** – no such container
918
+-   **500** – server error
919
+
920
+### Unpause a container
921
+
922
+`POST /containers/(id)/unpause`
923
+
924
+Unpause the container `id`
925
+
926
+**Example request**:
927
+
928
+    POST /containers/e90e34656806/unpause HTTP/1.1
929
+
930
+**Example response**:
931
+
932
+    HTTP/1.1 204 No Content
933
+
934
+Status Codes:
935
+
936
+-   **204** – no error
937
+-   **404** – no such container
938
+-   **500** – server error
939
+
940
+### Attach to a container
941
+
942
+`POST /containers/(id)/attach`
943
+
944
+Attach to the container `id`
945
+
946
+**Example request**:
947
+
948
+    POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1
949
+
950
+**Example response**:
951
+
952
+    HTTP/1.1 101 UPGRADED
953
+    Content-Type: application/vnd.docker.raw-stream
954
+    Connection: Upgrade
955
+    Upgrade: tcp
956
+
957
+    {{ STREAM }}
958
+
959
+Query Parameters:
960
+
961
+-   **logs** – 1/True/true or 0/False/false, return logs. Default `false`.
962
+-   **stream** – 1/True/true or 0/False/false, return stream.
963
+        Default `false`.
964
+-   **stdin** – 1/True/true or 0/False/false, if `stream=true`, attach
965
+        to `stdin`. Default `false`.
966
+-   **stdout** – 1/True/true or 0/False/false, if `logs=true`, return
967
+        `stdout` log, if `stream=true`, attach to `stdout`. Default `false`.
968
+-   **stderr** – 1/True/true or 0/False/false, if `logs=true`, return
969
+        `stderr` log, if `stream=true`, attach to `stderr`. Default `false`.
970
+
971
+Status Codes:
972
+
973
+-   **101** – no error, hints proxy about hijacking
974
+-   **200** – no error, no upgrade header found
975
+-   **400** – bad parameter
976
+-   **404** – no such container
977
+-   **500** – server error
978
+
979
+    **Stream details**:
980
+
981
+    When using the TTY setting is enabled in
982
+    [`POST /containers/create`
983
+    ](#create-a-container),
984
+    the stream is the raw data from the process PTY and client's `stdin`.
985
+    When the TTY is disabled, then the stream is multiplexed to separate
986
+    `stdout` and `stderr`.
987
+
988
+    The format is a **Header** and a **Payload** (frame).
989
+
990
+    **HEADER**
991
+
992
+    The header contains the information which the stream writes (`stdout` or
993
+    `stderr`). It also contains the size of the associated frame encoded in the
994
+    last four bytes (`uint32`).
995
+
996
+    It is encoded on the first eight bytes like this:
997
+
998
+        header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}
999
+
1000
+    `STREAM_TYPE` can be:
1001
+
1002
+-   0: `stdin` (is written on `stdout`)
1003
+-   1: `stdout`
1004
+-   2: `stderr`
1005
+
1006
+    `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of
1007
+    the `uint32` size encoded as big endian.
1008
+
1009
+    **PAYLOAD**
1010
+
1011
+    The payload is the raw stream.
1012
+
1013
+    **IMPLEMENTATION**
1014
+
1015
+    The simplest way to implement the Attach protocol is the following:
1016
+
1017
+    1.  Read eight bytes.
1018
+    2.  Choose `stdout` or `stderr` depending on the first byte.
1019
+    3.  Extract the frame size from the last four bytes.
1020
+    4.  Read the extracted size and output it on the correct output.
1021
+    5.  Goto 1.
1022
+
1023
+### Attach to a container (websocket)
1024
+
1025
+`GET /containers/(id)/attach/ws`
1026
+
1027
+Attach to the container `id` via websocket
1028
+
1029
+Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)
1030
+
1031
+**Example request**
1032
+
1033
+    GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1
1034
+
1035
+**Example response**
1036
+
1037
+    {{ STREAM }}
1038
+
1039
+Query Parameters:
1040
+
1041
+-   **logs** – 1/True/true or 0/False/false, return logs. Default `false`.
1042
+-   **stream** – 1/True/true or 0/False/false, return stream.
1043
+        Default `false`.
1044
+-   **stdin** – 1/True/true or 0/False/false, if `stream=true`, attach
1045
+        to `stdin`. Default `false`.
1046
+-   **stdout** – 1/True/true or 0/False/false, if `logs=true`, return
1047
+        `stdout` log, if `stream=true`, attach to `stdout`. Default `false`.
1048
+-   **stderr** – 1/True/true or 0/False/false, if `logs=true`, return
1049
+        `stderr` log, if `stream=true`, attach to `stderr`. Default `false`.
1050
+
1051
+Status Codes:
1052
+
1053
+-   **200** – no error
1054
+-   **400** – bad parameter
1055
+-   **404** – no such container
1056
+-   **500** – server error
1057
+
1058
+### Wait a container
1059
+
1060
+`POST /containers/(id)/wait`
1061
+
1062
+Block until container `id` stops, then returns the exit code
1063
+
1064
+**Example request**:
1065
+
1066
+    POST /containers/16253994b7c4/wait HTTP/1.1
1067
+
1068
+**Example response**:
1069
+
1070
+    HTTP/1.1 200 OK
1071
+    Content-Type: application/json
1072
+
1073
+    {"StatusCode": 0}
1074
+
1075
+Status Codes:
1076
+
1077
+-   **200** – no error
1078
+-   **404** – no such container
1079
+-   **500** – server error
1080
+
1081
+### Remove a container
1082
+
1083
+`DELETE /containers/(id)`
1084
+
1085
+Remove the container `id` from the filesystem
1086
+
1087
+**Example request**:
1088
+
1089
+    DELETE /containers/16253994b7c4?v=1 HTTP/1.1
1090
+
1091
+**Example response**:
1092
+
1093
+    HTTP/1.1 204 No Content
1094
+
1095
+Query Parameters:
1096
+
1097
+-   **v** – 1/True/true or 0/False/false, Remove the volumes
1098
+        associated to the container. Default `false`.
1099
+-   **force** - 1/True/true or 0/False/false, Kill then remove the container.
1100
+        Default `false`.
1101
+
1102
+Status Codes:
1103
+
1104
+-   **204** – no error
1105
+-   **400** – bad parameter
1106
+-   **404** – no such container
1107
+-   **500** – server error
1108
+
1109
+### Copy files or folders from a container
1110
+
1111
+`POST /containers/(id)/copy`
1112
+
1113
+Copy files or folders of container `id`
1114
+
1115
+**Deprecated** in favor of the `archive` endpoint below.
1116
+
1117
+**Example request**:
1118
+
1119
+    POST /containers/4fa6e0f0c678/copy HTTP/1.1
1120
+    Content-Type: application/json
1121
+
1122
+    {
1123
+         "Resource": "test.txt"
1124
+    }
1125
+
1126
+**Example response**:
1127
+
1128
+    HTTP/1.1 200 OK
1129
+    Content-Type: application/x-tar
1130
+
1131
+    {{ TAR STREAM }}
1132
+
1133
+Status Codes:
1134
+
1135
+-   **200** – no error
1136
+-   **404** – no such container
1137
+-   **500** – server error
1138
+
1139
+### Retrieving information about files and folders in a container
1140
+
1141
+`HEAD /containers/(id)/archive`
1142
+
1143
+See the description of the `X-Docker-Container-Path-Stat` header in the
1144
+following section.
1145
+
1146
+### Get an archive of a filesystem resource in a container
1147
+
1148
+`GET /containers/(id)/archive`
1149
+
1150
+Get an tar archive of a resource in the filesystem of container `id`.
1151
+
1152
+Query Parameters:
1153
+
1154
+- **path** - resource in the container's filesystem to archive. Required.
1155
+
1156
+    If not an absolute path, it is relative to the container's root directory.
1157
+    The resource specified by **path** must exist. To assert that the resource
1158
+    is expected to be a directory, **path** should end in `/` or  `/.`
1159
+    (assuming a path separator of `/`). If **path** ends in `/.` then this
1160
+    indicates that only the contents of the **path** directory should be
1161
+    copied. A symlink is always resolved to its target.
1162
+
1163
+    **Note**: It is not possible to copy certain system files such as resources
1164
+    under `/proc`, `/sys`, `/dev`, and mounts created by the user in the
1165
+    container.
1166
+
1167
+**Example request**:
1168
+
1169
+        GET /containers/8cce319429b2/archive?path=/root HTTP/1.1
1170
+
1171
+**Example response**:
1172
+
1173
+        HTTP/1.1 200 OK
1174
+        Content-Type: application/x-tar
1175
+        X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0=
1176
+
1177
+        {{ TAR STREAM }}
1178
+
1179
+On success, a response header `X-Docker-Container-Path-Stat` will be set to a
1180
+base64-encoded JSON object containing some filesystem header information about
1181
+the archived resource. The above example value would decode to the following
1182
+JSON object (whitespace added for readability):
1183
+
1184
+        {
1185
+            "name": "root",
1186
+            "size": 4096,
1187
+            "mode": 2147484096,
1188
+            "mtime": "2014-02-27T20:51:23Z",
1189
+            "linkTarget": ""
1190
+        }
1191
+
1192
+A `HEAD` request can also be made to this endpoint if only this information is
1193
+desired.
1194
+
1195
+Status Codes:
1196
+
1197
+- **200** - success, returns archive of copied resource
1198
+- **400** - client error, bad parameter, details in JSON response body, one of:
1199
+    - must specify path parameter (**path** cannot be empty)
1200
+    - not a directory (**path** was asserted to be a directory but exists as a
1201
+      file)
1202
+- **404** - client error, resource not found, one of:
1203
+    – no such container (container `id` does not exist)
1204
+    - no such file or directory (**path** does not exist)
1205
+- **500** - server error
1206
+
1207
+### Extract an archive of files or folders to a directory in a container
1208
+
1209
+`PUT /containers/(id)/archive`
1210
+
1211
+Upload a tar archive to be extracted to a path in the filesystem of container
1212
+`id`.
1213
+
1214
+Query Parameters:
1215
+
1216
+- **path** - path to a directory in the container
1217
+    to extract the archive's contents into. Required.
1218
+
1219
+    If not an absolute path, it is relative to the container's root directory.
1220
+    The **path** resource must exist.
1221
+- **noOverwriteDirNonDir** - If "1", "true", or "True" then it will be an error
1222
+    if unpacking the given content would cause an existing directory to be
1223
+    replaced with a non-directory and vice versa.
1224
+
1225
+**Example request**:
1226
+
1227
+        PUT /containers/8cce319429b2/archive?path=/vol1 HTTP/1.1
1228
+        Content-Type: application/x-tar
1229
+
1230
+        {{ TAR STREAM }}
1231
+
1232
+**Example response**:
1233
+
1234
+        HTTP/1.1 200 OK
1235
+
1236
+Status Codes:
1237
+
1238
+- **200** – the content was extracted successfully
1239
+- **400** - client error, bad parameter, details in JSON response body, one of:
1240
+    - must specify path parameter (**path** cannot be empty)
1241
+    - not a directory (**path** should be a directory but exists as a file)
1242
+    - unable to overwrite existing directory with non-directory
1243
+      (if **noOverwriteDirNonDir**)
1244
+    - unable to overwrite existing non-directory with directory
1245
+      (if **noOverwriteDirNonDir**)
1246
+- **403** - client error, permission denied, the volume
1247
+    or container rootfs is marked as read-only.
1248
+- **404** - client error, resource not found, one of:
1249
+    – no such container (container `id` does not exist)
1250
+    - no such file or directory (**path** resource does not exist)
1251
+- **500** – server error
1252
+
1253
+## 2.2 Images
1254
+
1255
+### List Images
1256
+
1257
+`GET /images/json`
1258
+
1259
+**Example request**:
1260
+
1261
+    GET /images/json?all=0 HTTP/1.1
1262
+
1263
+**Example response**:
1264
+
1265
+    HTTP/1.1 200 OK
1266
+    Content-Type: application/json
1267
+
1268
+    [
1269
+      {
1270
+         "RepoTags": [
1271
+           "ubuntu:12.04",
1272
+           "ubuntu:precise",
1273
+           "ubuntu:latest"
1274
+         ],
1275
+         "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c",
1276
+         "Created": 1365714795,
1277
+         "Size": 131506275,
1278
+         "VirtualSize": 131506275,
1279
+         "Labels": {}
1280
+      },
1281
+      {
1282
+         "RepoTags": [
1283
+           "ubuntu:12.10",
1284
+           "ubuntu:quantal"
1285
+         ],
1286
+         "ParentId": "27cf784147099545",
1287
+         "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc",
1288
+         "Created": 1364102658,
1289
+         "Size": 24653,
1290
+         "VirtualSize": 180116135,
1291
+         "Labels": {
1292
+            "com.example.version": "v1"
1293
+         }
1294
+      }
1295
+    ]
1296
+
1297
+**Example request, with digest information**:
1298
+
1299
+    GET /images/json?digests=1 HTTP/1.1
1300
+
1301
+**Example response, with digest information**:
1302
+
1303
+    HTTP/1.1 200 OK
1304
+    Content-Type: application/json
1305
+
1306
+    [
1307
+      {
1308
+        "Created": 1420064636,
1309
+        "Id": "4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125",
1310
+        "ParentId": "ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2",
1311
+        "RepoDigests": [
1312
+          "localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf"
1313
+        ],
1314
+        "RepoTags": [
1315
+          "localhost:5000/test/busybox:latest",
1316
+          "playdate:latest"
1317
+        ],
1318
+        "Size": 0,
1319
+        "VirtualSize": 2429728,
1320
+        "Labels": {}
1321
+      }
1322
+    ]
1323
+
1324
+The response shows a single image `Id` associated with two repositories
1325
+(`RepoTags`): `localhost:5000/test/busybox`: and `playdate`. A caller can use
1326
+either of the `RepoTags` values `localhost:5000/test/busybox:latest` or
1327
+`playdate:latest` to reference the image.
1328
+
1329
+You can also use `RepoDigests` values to reference an image. In this response,
1330
+the array has only one reference and that is to the
1331
+`localhost:5000/test/busybox` repository; the `playdate` repository has no
1332
+digest. You can reference this digest using the value:
1333
+`localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d...`
1334
+
1335
+See the `docker run` and `docker build` commands for examples of digest and tag
1336
+references on the command line.
1337
+
1338
+Query Parameters:
1339
+
1340
+-   **all** – 1/True/true or 0/False/false, default false
1341
+-   **filters** – a JSON encoded value of the filters (a map[string][]string) to process on the images list. Available filters:
1342
+  -   `dangling=true`
1343
+  -   `label=key` or `label="key=value"` of an image label
1344
+-   **filter** - only return images with the specified name
1345
+
1346
+### Build image from a Dockerfile
1347
+
1348
+`POST /build`
1349
+
1350
+Build an image from a Dockerfile
1351
+
1352
+**Example request**:
1353
+
1354
+    POST /build HTTP/1.1
1355
+
1356
+    {{ TAR STREAM }}
1357
+
1358
+**Example response**:
1359
+
1360
+    HTTP/1.1 200 OK
1361
+    Content-Type: application/json
1362
+
1363
+    {"stream": "Step 1..."}
1364
+    {"stream": "..."}
1365
+    {"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}}
1366
+
1367
+The input stream must be a `tar` archive compressed with one of the
1368
+following algorithms: `identity` (no compression), `gzip`, `bzip2`, `xz`.
1369
+
1370
+The archive must include a build instructions file, typically called
1371
+`Dockerfile` at the archive's root. The `dockerfile` parameter may be
1372
+used to specify a different build instructions file. To do this, its value must be
1373
+the path to the alternate build instructions file to use.
1374
+
1375
+The archive may include any number of other files,
1376
+which are accessible in the build context (See the [*ADD build
1377
+command*](../../reference/builder.md#dockerbuilder)).
1378
+
1379
+The build is canceled if the client drops the connection by quitting
1380
+or being killed.
1381
+
1382
+Query Parameters:
1383
+
1384
+-   **dockerfile** - Path within the build context to the Dockerfile. This is
1385
+        ignored if `remote` is specified and points to an individual filename.
1386
+-   **t** – A repository name (and optionally a tag) to apply to
1387
+        the resulting image in case of success.
1388
+-   **remote** – A Git repository URI or HTTP/HTTPS URI build source. If the 
1389
+        URI specifies a filename, the file's contents are placed into a file 
1390
+		called `Dockerfile`.
1391
+-   **q** – Suppress verbose build output.
1392
+-   **nocache** – Do not use the cache when building the image.
1393
+-   **pull** - Attempt to pull the image even if an older image exists locally.
1394
+-   **rm** - Remove intermediate containers after a successful build (default behavior).
1395
+-   **forcerm** - Always remove intermediate containers (includes `rm`).
1396
+-   **memory** - Set memory limit for build.
1397
+-   **memswap** - Total memory (memory + swap), `-1` to disable swap.
1398
+-   **cpushares** - CPU shares (relative weight).
1399
+-   **cpusetcpus** - CPUs in which to allow execution (e.g., `0-3`, `0,1`).
1400
+-   **cpuperiod** - The length of a CPU period in microseconds.
1401
+-   **cpuquota** - Microseconds of CPU time that the container can get in a CPU period.
1402
+-   **buildargs** – JSON map of string pairs for build-time variables. Users pass
1403
+        these values at build-time. Docker uses the `buildargs` as the environment
1404
+        context for command(s) run via the Dockerfile's `RUN` instruction or for
1405
+        variable expansion in other Dockerfile instructions. This is not meant for
1406
+        passing secret values. [Read more about the buildargs instruction](../../reference/builder.md#arg)
1407
+
1408
+    Request Headers:
1409
+
1410
+-   **Content-type** – Set to `"application/tar"`.
1411
+-   **X-Registry-Config** – A base64-url-safe-encoded Registry Auth Config JSON
1412
+        object with the following structure:
1413
+
1414
+            {
1415
+                "docker.example.com": {
1416
+                    "username": "janedoe",
1417
+                    "password": "hunter2"
1418
+                },
1419
+                "https://index.docker.io/v1/": {
1420
+                    "username": "mobydock",
1421
+                    "password": "conta1n3rize14"
1422
+                }
1423
+            }
1424
+
1425
+        This object maps the hostname of a registry to an object containing the
1426
+        "username" and "password" for that registry. Multiple registries may
1427
+        be specified as the build may be based on an image requiring
1428
+        authentication to pull from any arbitrary registry. Only the registry
1429
+        domain name (and port if not the default "443") are required. However
1430
+        (for legacy reasons) the "official" Docker, Inc. hosted registry must
1431
+        be specified with both a "https://" prefix and a "/v1/" suffix even
1432
+        though Docker will prefer to use the v2 registry API.
1433
+
1434
+Status Codes:
1435
+
1436
+-   **200** – no error
1437
+-   **500** – server error
1438
+
1439
+### Create an image
1440
+
1441
+`POST /images/create`
1442
+
1443
+Create an image either by pulling it from the registry or by importing it
1444
+
1445
+**Example request**:
1446
+
1447
+    POST /images/create?fromImage=ubuntu HTTP/1.1
1448
+
1449
+**Example response**:
1450
+
1451
+    HTTP/1.1 200 OK
1452
+    Content-Type: application/json
1453
+
1454
+    {"status": "Pulling..."}
1455
+    {"status": "Pulling", "progress": "1 B/ 100 B", "progressDetail": {"current": 1, "total": 100}}
1456
+    {"error": "Invalid..."}
1457
+    ...
1458
+
1459
+When using this endpoint to pull an image from the registry, the
1460
+`X-Registry-Auth` header can be used to include
1461
+a base64-encoded AuthConfig object.
1462
+
1463
+Query Parameters:
1464
+
1465
+-   **fromImage** – Name of the image to pull.
1466
+-   **fromSrc** – Source to import.  The value may be a URL from which the image
1467
+        can be retrieved or `-` to read the image from the request body.
1468
+-   **repo** – Repository name.
1469
+-   **tag** – Tag.
1470
+-   **registry** – The registry to pull from.
1471
+
1472
+    Request Headers:
1473
+
1474
+-   **X-Registry-Auth** – base64-encoded AuthConfig object
1475
+
1476
+Status Codes:
1477
+
1478
+-   **200** – no error
1479
+-   **500** – server error
1480
+
1481
+
1482
+
1483
+### Inspect an image
1484
+
1485
+`GET /images/(name)/json`
1486
+
1487
+Return low-level information on the image `name`
1488
+
1489
+**Example request**:
1490
+
1491
+    GET /images/example/json HTTP/1.1
1492
+
1493
+**Example response**:
1494
+
1495
+    HTTP/1.1 200 OK
1496
+    Content-Type: application/json
1497
+
1498
+    {
1499
+       "Id" : "85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c",
1500
+       "Container" : "cb91e48a60d01f1e27028b4fc6819f4f290b3cf12496c8176ec714d0d390984a",
1501
+       "Comment" : "",
1502
+       "Os" : "linux",
1503
+       "Architecture" : "amd64",
1504
+       "Parent" : "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c",
1505
+       "ContainerConfig" : {
1506
+          "Tty" : false,
1507
+          "Hostname" : "e611e15f9c9d",
1508
+          "Volumes" : null,
1509
+          "Domainname" : "",
1510
+          "AttachStdout" : false,
1511
+          "PublishService" : "",
1512
+          "AttachStdin" : false,
1513
+          "OpenStdin" : false,
1514
+          "StdinOnce" : false,
1515
+          "NetworkDisabled" : false,
1516
+          "OnBuild" : [],
1517
+          "Image" : "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c",
1518
+          "User" : "",
1519
+          "WorkingDir" : "",
1520
+          "Entrypoint" : null,
1521
+          "MacAddress" : "",
1522
+          "AttachStderr" : false,
1523
+          "Labels" : {
1524
+             "com.example.license" : "GPL",
1525
+             "com.example.version" : "1.0",
1526
+             "com.example.vendor" : "Acme"
1527
+          },
1528
+          "Env" : [
1529
+             "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
1530
+          ],
1531
+          "ExposedPorts" : null,
1532
+          "Cmd" : [
1533
+             "/bin/sh",
1534
+             "-c",
1535
+             "#(nop) LABEL com.example.vendor=Acme com.example.license=GPL com.example.version=1.0"
1536
+          ]
1537
+       },
1538
+       "DockerVersion" : "1.9.0-dev",
1539
+       "VirtualSize" : 188359297,
1540
+       "Size" : 0,
1541
+       "Author" : "",
1542
+       "Created" : "2015-09-10T08:30:53.26995814Z",
1543
+       "GraphDriver" : {
1544
+          "Name" : "aufs",
1545
+          "Data" : null
1546
+       },
1547
+       "Tags" : [
1548
+          "example:1.0",
1549
+          "example:latest",
1550
+          "example:stable"
1551
+       ],
1552
+       "Config" : {
1553
+          "Image" : "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c",
1554
+          "NetworkDisabled" : false,
1555
+          "OnBuild" : [],
1556
+          "StdinOnce" : false,
1557
+          "PublishService" : "",
1558
+          "AttachStdin" : false,
1559
+          "OpenStdin" : false,
1560
+          "Domainname" : "",
1561
+          "AttachStdout" : false,
1562
+          "Tty" : false,
1563
+          "Hostname" : "e611e15f9c9d",
1564
+          "Volumes" : null,
1565
+          "Cmd" : [
1566
+             "/bin/bash"
1567
+          ],
1568
+          "ExposedPorts" : null,
1569
+          "Env" : [
1570
+             "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
1571
+          ],
1572
+          "Labels" : {
1573
+             "com.example.vendor" : "Acme",
1574
+             "com.example.version" : "1.0",
1575
+             "com.example.license" : "GPL"
1576
+          },
1577
+          "Entrypoint" : null,
1578
+          "MacAddress" : "",
1579
+          "AttachStderr" : false,
1580
+          "WorkingDir" : "",
1581
+          "User" : ""
1582
+       }
1583
+    }
1584
+
1585
+Status Codes:
1586
+
1587
+-   **200** – no error
1588
+-   **404** – no such image
1589
+-   **500** – server error
1590
+
1591
+### Get the history of an image
1592
+
1593
+`GET /images/(name)/history`
1594
+
1595
+Return the history of the image `name`
1596
+
1597
+**Example request**:
1598
+
1599
+    GET /images/ubuntu/history HTTP/1.1
1600
+
1601
+**Example response**:
1602
+
1603
+    HTTP/1.1 200 OK
1604
+    Content-Type: application/json
1605
+
1606
+    [
1607
+        {
1608
+            "Id": "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710",
1609
+            "Created": 1398108230,
1610
+            "CreatedBy": "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /",
1611
+            "Tags": [
1612
+                "ubuntu:lucid",
1613
+                "ubuntu:10.04"
1614
+            ],
1615
+            "Size": 182964289,
1616
+            "Comment": ""
1617
+        },
1618
+        {
1619
+            "Id": "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8",
1620
+            "Created": 1398108222,
1621
+            "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/",
1622
+            "Tags": null,
1623
+            "Size": 0,
1624
+            "Comment": ""
1625
+        },
1626
+        {
1627
+            "Id": "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158",
1628
+            "Created": 1371157430,
1629
+            "CreatedBy": "",
1630
+            "Tags": [
1631
+                "scratch12:latest",
1632
+                "scratch:latest"
1633
+            ],
1634
+            "Size": 0,
1635
+            "Comment": "Imported from -"
1636
+        }
1637
+    ]
1638
+
1639
+Status Codes:
1640
+
1641
+-   **200** – no error
1642
+-   **404** – no such image
1643
+-   **500** – server error
1644
+
1645
+### Push an image on the registry
1646
+
1647
+`POST /images/(name)/push`
1648
+
1649
+Push the image `name` on the registry
1650
+
1651
+**Example request**:
1652
+
1653
+    POST /images/test/push HTTP/1.1
1654
+
1655
+**Example response**:
1656
+
1657
+    HTTP/1.1 200 OK
1658
+    Content-Type: application/json
1659
+
1660
+    {"status": "Pushing..."}
1661
+    {"status": "Pushing", "progress": "1/? (n/a)", "progressDetail": {"current": 1}}}
1662
+    {"error": "Invalid..."}
1663
+    ...
1664
+
1665
+If you wish to push an image on to a private registry, that image must already have a tag
1666
+into a repository which references that registry `hostname` and `port`.  This repository name should
1667
+then be used in the URL. This duplicates the command line's flow.
1668
+
1669
+**Example request**:
1670
+
1671
+    POST /images/registry.acme.com:5000/test/push HTTP/1.1
1672
+
1673
+
1674
+Query Parameters:
1675
+
1676
+-   **tag** – The tag to associate with the image on the registry. This is optional.
1677
+
1678
+Request Headers:
1679
+
1680
+-   **X-Registry-Auth** – Include a base64-encoded AuthConfig.
1681
+        object.
1682
+
1683
+Status Codes:
1684
+
1685
+-   **200** – no error
1686
+-   **404** – no such image
1687
+-   **500** – server error
1688
+
1689
+### Tag an image into a repository
1690
+
1691
+`POST /images/(name)/tag`
1692
+
1693
+Tag the image `name` into a repository
1694
+
1695
+**Example request**:
1696
+
1697
+    POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1
1698
+
1699
+**Example response**:
1700
+
1701
+    HTTP/1.1 201 OK
1702
+
1703
+Query Parameters:
1704
+
1705
+-   **repo** – The repository to tag in
1706
+-   **force** – 1/True/true or 0/False/false, default false
1707
+-   **tag** - The new tag name
1708
+
1709
+Status Codes:
1710
+
1711
+-   **201** – no error
1712
+-   **400** – bad parameter
1713
+-   **404** – no such image
1714
+-   **409** – conflict
1715
+-   **500** – server error
1716
+
1717
+### Remove an image
1718
+
1719
+`DELETE /images/(name)`
1720
+
1721
+Remove the image `name` from the filesystem
1722
+
1723
+**Example request**:
1724
+
1725
+    DELETE /images/test HTTP/1.1
1726
+
1727
+**Example response**:
1728
+
1729
+    HTTP/1.1 200 OK
1730
+    Content-type: application/json
1731
+
1732
+    [
1733
+     {"Untagged": "3e2f21a89f"},
1734
+     {"Deleted": "3e2f21a89f"},
1735
+     {"Deleted": "53b4f83ac9"}
1736
+    ]
1737
+
1738
+Query Parameters:
1739
+
1740
+-   **force** – 1/True/true or 0/False/false, default false
1741
+-   **noprune** – 1/True/true or 0/False/false, default false
1742
+
1743
+Status Codes:
1744
+
1745
+-   **200** – no error
1746
+-   **404** – no such image
1747
+-   **409** – conflict
1748
+-   **500** – server error
1749
+
1750
+### Search images
1751
+
1752
+`GET /images/search`
1753
+
1754
+Search for an image on [Docker Hub](https://hub.docker.com).
1755
+
1756
+> **Note**:
1757
+> The response keys have changed from API v1.6 to reflect the JSON
1758
+> sent by the registry server to the docker daemon's request.
1759
+
1760
+**Example request**:
1761
+
1762
+    GET /images/search?term=sshd HTTP/1.1
1763
+
1764
+**Example response**:
1765
+
1766
+    HTTP/1.1 200 OK
1767
+    Content-Type: application/json
1768
+
1769
+    [
1770
+            {
1771
+                "description": "",
1772
+                "is_official": false,
1773
+                "is_automated": false,
1774
+                "name": "wma55/u1210sshd",
1775
+                "star_count": 0
1776
+            },
1777
+            {
1778
+                "description": "",
1779
+                "is_official": false,
1780
+                "is_automated": false,
1781
+                "name": "jdswinbank/sshd",
1782
+                "star_count": 0
1783
+            },
1784
+            {
1785
+                "description": "",
1786
+                "is_official": false,
1787
+                "is_automated": false,
1788
+                "name": "vgauthier/sshd",
1789
+                "star_count": 0
1790
+            }
1791
+    ...
1792
+    ]
1793
+
1794
+Query Parameters:
1795
+
1796
+-   **term** – term to search
1797
+
1798
+Status Codes:
1799
+
1800
+-   **200** – no error
1801
+-   **500** – server error
1802
+
1803
+## 2.3 Misc
1804
+
1805
+### Check auth configuration
1806
+
1807
+`POST /auth`
1808
+
1809
+Get the default username and email
1810
+
1811
+**Example request**:
1812
+
1813
+    POST /auth HTTP/1.1
1814
+    Content-Type: application/json
1815
+
1816
+    {
1817
+         "username":" hannibal",
1818
+         "password: "xxxx",
1819
+         "email": "hannibal@a-team.com",
1820
+         "serveraddress": "https://index.docker.io/v1/"
1821
+    }
1822
+
1823
+**Example response**:
1824
+
1825
+    HTTP/1.1 200 OK
1826
+
1827
+Status Codes:
1828
+
1829
+-   **200** – no error
1830
+-   **204** – no error
1831
+-   **500** – server error
1832
+
1833
+### Display system-wide information
1834
+
1835
+`GET /info`
1836
+
1837
+Display system-wide information
1838
+
1839
+**Example request**:
1840
+
1841
+    GET /info HTTP/1.1
1842
+
1843
+**Example response**:
1844
+
1845
+    HTTP/1.1 200 OK
1846
+    Content-Type: application/json
1847
+
1848
+    {
1849
+        "Containers": 11,
1850
+        "CpuCfsPeriod": true,
1851
+        "CpuCfsQuota": true,
1852
+        "Debug": false,
1853
+        "DiscoveryBackend": "etcd://localhost:2379",
1854
+        "DockerRootDir": "/var/lib/docker",
1855
+        "Driver": "btrfs",
1856
+        "DriverStatus": [[""]],
1857
+        "ExecutionDriver": "native-0.1",
1858
+        "ExperimentalBuild": false,
1859
+        "HttpProxy": "http://test:test@localhost:8080",
1860
+        "HttpsProxy": "https://test:test@localhost:8080",
1861
+        "ID": "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS",
1862
+        "IPv4Forwarding": true,
1863
+        "Images": 16,
1864
+        "IndexServerAddress": "https://index.docker.io/v1/",
1865
+        "InitPath": "/usr/bin/docker",
1866
+        "InitSha1": "",
1867
+        "KernelVersion": "3.12.0-1-amd64",
1868
+        "Labels": [
1869
+            "storage=ssd"
1870
+        ],
1871
+        "MemTotal": 2099236864,
1872
+        "MemoryLimit": true,
1873
+        "NCPU": 1,
1874
+        "NEventsListener": 0,
1875
+        "NFd": 11,
1876
+        "NGoroutines": 21,
1877
+        "Name": "prod-server-42",
1878
+        "NoProxy": "9.81.1.160",
1879
+        "OomKillDisable": true,
1880
+        "OperatingSystem": "Boot2Docker",
1881
+        "RegistryConfig": {
1882
+            "IndexConfigs": {
1883
+                "docker.io": {
1884
+                    "Mirrors": null,
1885
+                    "Name": "docker.io",
1886
+                    "Official": true,
1887
+                    "Secure": true
1888
+                }
1889
+            },
1890
+            "InsecureRegistryCIDRs": [
1891
+                "127.0.0.0/8"
1892
+            ]
1893
+        },
1894
+        "SwapLimit": false,
1895
+        "SystemTime": "2015-03-10T11:11:23.730591467-07:00"
1896
+        "ServerVersion": "1.9.0"
1897
+    }
1898
+
1899
+Status Codes:
1900
+
1901
+-   **200** – no error
1902
+-   **500** – server error
1903
+
1904
+### Show the docker version information
1905
+
1906
+`GET /version`
1907
+
1908
+Show the docker version information
1909
+
1910
+**Example request**:
1911
+
1912
+    GET /version HTTP/1.1
1913
+
1914
+**Example response**:
1915
+
1916
+    HTTP/1.1 200 OK
1917
+    Content-Type: application/json
1918
+
1919
+    {
1920
+         "Version": "1.5.0",
1921
+         "Os": "linux",
1922
+         "KernelVersion": "3.18.5-tinycore64",
1923
+         "GoVersion": "go1.4.1",
1924
+         "GitCommit": "a8a31ef",
1925
+         "Arch": "amd64",
1926
+         "ApiVersion": "1.20",
1927
+         "Experimental": false
1928
+    }
1929
+
1930
+Status Codes:
1931
+
1932
+-   **200** – no error
1933
+-   **500** – server error
1934
+
1935
+### Ping the docker server
1936
+
1937
+`GET /_ping`
1938
+
1939
+Ping the docker server
1940
+
1941
+**Example request**:
1942
+
1943
+    GET /_ping HTTP/1.1
1944
+
1945
+**Example response**:
1946
+
1947
+    HTTP/1.1 200 OK
1948
+    Content-Type: text/plain
1949
+
1950
+    OK
1951
+
1952
+Status Codes:
1953
+
1954
+-   **200** - no error
1955
+-   **500** - server error
1956
+
1957
+### Create a new image from a container's changes
1958
+
1959
+`POST /commit`
1960
+
1961
+Create a new image from a container's changes
1962
+
1963
+**Example request**:
1964
+
1965
+    POST /commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1
1966
+    Content-Type: application/json
1967
+
1968
+    {
1969
+         "Hostname": "",
1970
+         "Domainname": "",
1971
+         "User": "",
1972
+         "AttachStdin": false,
1973
+         "AttachStdout": true,
1974
+         "AttachStderr": true,
1975
+         "Tty": false,
1976
+         "OpenStdin": false,
1977
+         "StdinOnce": false,
1978
+         "Env": null,
1979
+         "Cmd": [
1980
+                 "date"
1981
+         ],
1982
+         "Mounts": [
1983
+           {
1984
+             "Source": "/data",
1985
+             "Destination": "/data",
1986
+             "Mode": "ro,Z",
1987
+             "RW": false
1988
+           }
1989
+         ],
1990
+         "Labels": {
1991
+                 "key1": "value1",
1992
+                 "key2": "value2"
1993
+          },
1994
+         "WorkingDir": "",
1995
+         "NetworkDisabled": false,
1996
+         "ExposedPorts": {
1997
+                 "22/tcp": {}
1998
+         }
1999
+    }
2000
+
2001
+**Example response**:
2002
+
2003
+    HTTP/1.1 201 Created
2004
+    Content-Type: application/json
2005
+
2006
+    {"Id": "596069db4bf5"}
2007
+
2008
+Json Parameters:
2009
+
2010
+-  **config** - the container's configuration
2011
+
2012
+Query Parameters:
2013
+
2014
+-   **container** – source container
2015
+-   **repo** – repository
2016
+-   **tag** – tag
2017
+-   **comment** – commit message
2018
+-   **author** – author (e.g., "John Hannibal Smith
2019
+    <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>")
2020
+-   **pause** – 1/True/true or 0/False/false, whether to pause the container before committing
2021
+-   **changes** – Dockerfile instructions to apply while committing
2022
+
2023
+Status Codes:
2024
+
2025
+-   **201** – no error
2026
+-   **404** – no such container
2027
+-   **500** – server error
2028
+
2029
+### Monitor Docker's events
2030
+
2031
+`GET /events`
2032
+
2033
+Get container events from docker, either in real time via streaming, or via
2034
+polling (using since).
2035
+
2036
+Docker containers report the following events:
2037
+
2038
+    attach, commit, copy, create, destroy, die, exec_create, exec_start, export, kill, oom, pause, rename, resize, restart, start, stop, top, unpause
2039
+
2040
+and Docker images report:
2041
+
2042
+    delete, import, pull, push, tag, untag
2043
+
2044
+**Example request**:
2045
+
2046
+    GET /events?since=1374067924
2047
+
2048
+**Example response**:
2049
+
2050
+    HTTP/1.1 200 OK
2051
+    Content-Type: application/json
2052
+
2053
+    {"status":"pull","id":"busybox:latest","time":1442421700,"timeNano":1442421700598988358}
2054
+    {"status":"create","id":"5745704abe9caa5","from":"busybox","time":1442421716,"timeNano":1442421716853979870}
2055
+    {"status":"attach","id":"5745704abe9caa5","from":"busybox","time":1442421716,"timeNano":1442421716894759198}
2056
+    {"status":"start","id":"5745704abe9caa5","from":"busybox","time":1442421716,"timeNano":1442421716983607193}
2057
+
2058
+Query Parameters:
2059
+
2060
+-   **since** – Timestamp used for polling
2061
+-   **until** – Timestamp used for polling
2062
+-   **filters** – A json encoded value of the filters (a map[string][]string) to process on the event list. Available filters:
2063
+  -   `container=<string>`; -- container to filter
2064
+  -   `event=<string>`; -- event to filter
2065
+  -   `image=<string>`; -- image to filter
2066
+  -   `label=<string>`; -- image and container label to filter
2067
+
2068
+Status Codes:
2069
+
2070
+-   **200** – no error
2071
+-   **500** – server error
2072
+
2073
+### Get a tarball containing all images in a repository
2074
+
2075
+`GET /images/(name)/get`
2076
+
2077
+Get a tarball containing all images and metadata for the repository specified
2078
+by `name`.
2079
+
2080
+If `name` is a specific name and tag (e.g. ubuntu:latest), then only that image
2081
+(and its parents) are returned. If `name` is an image ID, similarly only that
2082
+image (and its parents) are returned, but with the exclusion of the
2083
+'repositories' file in the tarball, as there were no image names referenced.
2084
+
2085
+See the [image tarball format](#image-tarball-format) for more details.
2086
+
2087
+**Example request**
2088
+
2089
+    GET /images/ubuntu/get
2090
+
2091
+**Example response**:
2092
+
2093
+    HTTP/1.1 200 OK
2094
+    Content-Type: application/x-tar
2095
+
2096
+    Binary data stream
2097
+
2098
+Status Codes:
2099
+
2100
+-   **200** – no error
2101
+-   **500** – server error
2102
+
2103
+### Get a tarball containing all images.
2104
+
2105
+`GET /images/get`
2106
+
2107
+Get a tarball containing all images and metadata for one or more repositories.
2108
+
2109
+For each value of the `names` parameter: if it is a specific name and tag (e.g.
2110
+`ubuntu:latest`), then only that image (and its parents) are returned; if it is
2111
+an image ID, similarly only that image (and its parents) are returned and there
2112
+would be no names referenced in the 'repositories' file for this image ID.
2113
+
2114
+See the [image tarball format](#image-tarball-format) for more details.
2115
+
2116
+**Example request**
2117
+
2118
+    GET /images/get?names=myname%2Fmyapp%3Alatest&names=busybox
2119
+
2120
+**Example response**:
2121
+
2122
+    HTTP/1.1 200 OK
2123
+    Content-Type: application/x-tar
2124
+
2125
+    Binary data stream
2126
+
2127
+Status Codes:
2128
+
2129
+-   **200** – no error
2130
+-   **500** – server error
2131
+
2132
+### Load a tarball with a set of images and tags into docker
2133
+
2134
+`POST /images/load`
2135
+
2136
+Load a set of images and tags into a Docker repository.
2137
+See the [image tarball format](#image-tarball-format) for more details.
2138
+
2139
+**Example request**
2140
+
2141
+    POST /images/load
2142
+
2143
+    Tarball in body
2144
+
2145
+**Example response**:
2146
+
2147
+    HTTP/1.1 200 OK
2148
+
2149
+Status Codes:
2150
+
2151
+-   **200** – no error
2152
+-   **500** – server error
2153
+
2154
+### Image tarball format
2155
+
2156
+An image tarball contains one directory per image layer (named using its long ID),
2157
+each containing these files:
2158
+
2159
+- `VERSION`: currently `1.0` - the file format version
2160
+- `json`: detailed layer information, similar to `docker inspect layer_id`
2161
+- `layer.tar`: A tarfile containing the filesystem changes in this layer
2162
+
2163
+The `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories
2164
+for storing attribute changes and deletions.
2165
+
2166
+If the tarball defines a repository, the tarball should also include a `repositories` file at
2167
+the root that contains a list of repository and tag names mapped to layer IDs.
2168
+
2169
+```
2170
+{"hello-world":
2171
+    {"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"}
2172
+}
2173
+```
2174
+
2175
+### Exec Create
2176
+
2177
+`POST /containers/(id)/exec`
2178
+
2179
+Sets up an exec instance in a running container `id`
2180
+
2181
+**Example request**:
2182
+
2183
+    POST /containers/e90e34656806/exec HTTP/1.1
2184
+    Content-Type: application/json
2185
+
2186
+      {
2187
+       "AttachStdin": false,
2188
+       "AttachStdout": true,
2189
+       "AttachStderr": true,
2190
+       "Tty": false,
2191
+       "Cmd": [
2192
+                     "date"
2193
+             ]
2194
+      }
2195
+
2196
+**Example response**:
2197
+
2198
+    HTTP/1.1 201 OK
2199
+    Content-Type: application/json
2200
+
2201
+    {
2202
+         "Id": "f90e34656806",
2203
+         "Warnings":[]
2204
+    }
2205
+
2206
+Json Parameters:
2207
+
2208
+-   **AttachStdin** - Boolean value, attaches to `stdin` of the `exec` command.
2209
+-   **AttachStdout** - Boolean value, attaches to `stdout` of the `exec` command.
2210
+-   **AttachStderr** - Boolean value, attaches to `stderr` of the `exec` command.
2211
+-   **Tty** - Boolean value to allocate a pseudo-TTY.
2212
+-   **Cmd** - Command to run specified as a string or an array of strings.
2213
+
2214
+
2215
+Status Codes:
2216
+
2217
+-   **201** – no error
2218
+-   **404** – no such container
2219
+
2220
+### Exec Start
2221
+
2222
+`POST /exec/(id)/start`
2223
+
2224
+Starts a previously set up `exec` instance `id`. If `detach` is true, this API
2225
+returns after starting the `exec` command. Otherwise, this API sets up an
2226
+interactive session with the `exec` command.
2227
+
2228
+**Example request**:
2229
+
2230
+    POST /exec/e90e34656806/start HTTP/1.1
2231
+    Content-Type: application/json
2232
+
2233
+    {
2234
+     "Detach": false,
2235
+     "Tty": false
2236
+    }
2237
+
2238
+**Example response**:
2239
+
2240
+    HTTP/1.1 201 OK
2241
+    Content-Type: application/json
2242
+
2243
+    {{ STREAM }}
2244
+
2245
+Json Parameters:
2246
+
2247
+-   **Detach** - Detach from the `exec` command.
2248
+-   **Tty** - Boolean value to allocate a pseudo-TTY.
2249
+
2250
+Status Codes:
2251
+
2252
+-   **200** – no error
2253
+-   **404** – no such exec instance
2254
+-   **409** - container is stopped or paused
2255
+
2256
+    **Stream details**:
2257
+    Similar to the stream behavior of `POST /container/(id)/attach` API
2258
+
2259
+### Exec Resize
2260
+
2261
+`POST /exec/(id)/resize`
2262
+
2263
+Resizes the `tty` session used by the `exec` command `id`.  The unit is number of characters.
2264
+This API is valid only if `tty` was specified as part of creating and starting the `exec` command.
2265
+
2266
+**Example request**:
2267
+
2268
+    POST /exec/e90e34656806/resize?h=40&w=80 HTTP/1.1
2269
+    Content-Type: text/plain
2270
+
2271
+**Example response**:
2272
+
2273
+    HTTP/1.1 201 OK
2274
+    Content-Type: text/plain
2275
+
2276
+Query Parameters:
2277
+
2278
+-   **h** – height of `tty` session
2279
+-   **w** – width
2280
+
2281
+Status Codes:
2282
+
2283
+-   **201** – no error
2284
+-   **404** – no such exec instance
2285
+
2286
+### Exec Inspect
2287
+
2288
+`GET /exec/(id)/json`
2289
+
2290
+Return low-level information about the `exec` command `id`.
2291
+
2292
+**Example request**:
2293
+
2294
+    GET /exec/11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39/json HTTP/1.1
2295
+
2296
+**Example response**:
2297
+
2298
+    HTTP/1.1 200 OK
2299
+    Content-Type: plain/text
2300
+
2301
+    {
2302
+      "ID" : "11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39",
2303
+      "Running" : false,
2304
+      "ExitCode" : 2,
2305
+      "ProcessConfig" : {
2306
+        "privileged" : false,
2307
+        "user" : "",
2308
+        "tty" : false,
2309
+        "entrypoint" : "sh",
2310
+        "arguments" : [
2311
+          "-c",
2312
+          "exit 2"
2313
+        ]
2314
+      },
2315
+      "OpenStdin" : false,
2316
+      "OpenStderr" : false,
2317
+      "OpenStdout" : false,
2318
+      "Container" : {
2319
+        "State" : {
2320
+          "Status" : "running",
2321
+          "Running" : true,
2322
+          "Paused" : false,
2323
+          "Restarting" : false,
2324
+          "OOMKilled" : false,
2325
+          "Pid" : 3650,
2326
+          "ExitCode" : 0,
2327
+          "Error" : "",
2328
+          "StartedAt" : "2014-11-17T22:26:03.717657531Z",
2329
+          "FinishedAt" : "0001-01-01T00:00:00Z"
2330
+        },
2331
+        "ID" : "8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c",
2332
+        "Created" : "2014-11-17T22:26:03.626304998Z",
2333
+        "Path" : "date",
2334
+        "Args" : [],
2335
+        "Config" : {
2336
+          "Hostname" : "8f177a186b97",
2337
+          "Domainname" : "",
2338
+          "User" : "",
2339
+          "AttachStdin" : false,
2340
+          "AttachStdout" : false,
2341
+          "AttachStderr" : false,
2342
+          "ExposedPorts" : null,
2343
+          "Tty" : false,
2344
+          "OpenStdin" : false,
2345
+          "StdinOnce" : false,
2346
+          "Env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ],
2347
+          "Cmd" : [
2348
+            "date"
2349
+          ],
2350
+          "Image" : "ubuntu",
2351
+          "Volumes" : null,
2352
+          "WorkingDir" : "",
2353
+          "Entrypoint" : null,
2354
+          "NetworkDisabled" : false,
2355
+          "MacAddress" : "",
2356
+          "OnBuild" : null,
2357
+          "SecurityOpt" : null
2358
+        },
2359
+        "Image" : "5506de2b643be1e6febbf3b8a240760c6843244c41e12aa2f60ccbb7153d17f5",
2360
+        "NetworkSettings" : {
2361
+          "IPAddress" : "172.17.0.2",
2362
+          "IPPrefixLen" : 16,
2363
+          "MacAddress" : "02:42:ac:11:00:02",
2364
+          "Gateway" : "172.17.42.1",
2365
+          "Bridge" : "docker0",
2366
+          "Ports" : {}
2367
+        },
2368
+        "ResolvConfPath" : "/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/resolv.conf",
2369
+        "HostnamePath" : "/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hostname",
2370
+        "HostsPath" : "/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hosts",
2371
+        "LogPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log",
2372
+        "Name" : "/test",
2373
+        "Driver" : "aufs",
2374
+        "ExecDriver" : "native-0.2",
2375
+        "MountLabel" : "",
2376
+        "ProcessLabel" : "",
2377
+        "AppArmorProfile" : "",
2378
+        "RestartCount" : 0,
2379
+        "Mounts" : []
2380
+      }
2381
+    }
2382
+
2383
+Status Codes:
2384
+
2385
+-   **200** – no error
2386
+-   **404** – no such exec instance
2387
+-   **500** - server error
2388
+
2389
+## 2.4 Volumes
2390
+
2391
+### List volumes
2392
+
2393
+`GET /volumes`
2394
+
2395
+**Example request**:
2396
+
2397
+  GET /volumes HTTP/1.1
2398
+
2399
+**Example response**:
2400
+
2401
+  HTTP/1.1 200 OK
2402
+  Content-Type: application/json
2403
+
2404
+  {
2405
+    "Volumes": [
2406
+      {
2407
+        "Name": "tardis",
2408
+        "Driver": "local",
2409
+        "Mountpoint": "/var/lib/docker/volumes/tardis"
2410
+      }
2411
+    ]
2412
+  }
2413
+
2414
+Query Parameters:
2415
+
2416
+- **filter** - JSON encoded value of the filters (a `map[string][]string`) to process on the volumes list. There is one available filter: `dangling=true`
2417
+
2418
+Status Codes:
2419
+
2420
+-   **200** - no error
2421
+-   **500** - server error
2422
+
2423
+### Create a volume
2424
+
2425
+`POST /volumes`
2426
+
2427
+Create a volume
2428
+
2429
+**Example request**:
2430
+
2431
+  POST /volumes HTTP/1.1
2432
+  Content-Type: application/json
2433
+
2434
+  {
2435
+    "Name": "tardis"
2436
+  }
2437
+
2438
+**Example response**:
2439
+
2440
+  HTTP/1.1 201 Created
2441
+  Content-Type: application/json
2442
+
2443
+  {
2444
+    "Name": "tardis"
2445
+    "Driver": "local",
2446
+    "Mountpoint": "/var/lib/docker/volumes/tardis"
2447
+  }
2448
+
2449
+Status Codes:
2450
+
2451
+- **201** - no error
2452
+- **500**  - server error
2453
+
2454
+JSON Parameters:
2455
+
2456
+- **Name** - The new volume's name. If not specified, Docker generates a name.
2457
+- **Driver** - Name of the volume driver to use. Defaults to `local` for the name.
2458
+- **DriverOpts** - A mapping of driver options and values. These options are
2459
+    passed directly to the driver and are driver specific.
2460
+
2461
+### Inspect a volume
2462
+
2463
+`GET /volumes/(name)`
2464
+
2465
+Return low-level information on the volume `name`
2466
+
2467
+**Example request**:
2468
+
2469
+    GET /volumes/tardis
2470
+
2471
+**Example response**:
2472
+
2473
+  HTTP/1.1 200 OK
2474
+  Content-Type: application/json
2475
+
2476
+  {
2477
+    "Name": "tardis",
2478
+    "Driver": "local",
2479
+    "Mountpoint": "/var/lib/docker/volumes/tardis"
2480
+  }
2481
+
2482
+Status Codes:
2483
+
2484
+-   **200** - no error
2485
+-   **404** - no such volume
2486
+-   **500** - server error
2487
+
2488
+### Remove a volume
2489
+
2490
+`DELETE /volumes/(name)`
2491
+
2492
+Instruct the driver to remove the volume (`name`).
2493
+
2494
+**Example request**:
2495
+
2496
+  DELETE /volumes/local/tardis HTTP/1.1
2497
+
2498
+**Example response**:
2499
+
2500
+  HTTP/1.1 204 No Content
2501
+
2502
+Status Codes
2503
+
2504
+-   **204** - no error
2505
+-   **404** - no such volume or volume driver
2506
+-   **409** - volume is in use and cannot be removed
2507
+-   **500** - server error
2508
+
2509
+## 2.5 Networks
2510
+
2511
+### List networks
2512
+
2513
+`GET /networks`
2514
+
2515
+**Example request**:
2516
+
2517
+  GET /networks HTTP/1.1
2518
+
2519
+**Example response**:
2520
+
2521
+  HTTP/1.1 200 OK
2522
+  Content-Type: application/json
2523
+
2524
+```
2525
+  [
2526
+    {
2527
+      "name": "bridge",
2528
+      "id": "f995e41e471c833266786a64df584fbe4dc654ac99f63a4ee7495842aa093fc4",
2529
+      "driver": "bridge",
2530
+      "containers": {}
2531
+    },
2532
+    {
2533
+      "name": "none",
2534
+      "id": "21e34df9b29c74ae45ba312f8e9f83c02433c9a877cfebebcf57be78f69b77c8",
2535
+      "driver": "null",
2536
+      "containers": {}
2537
+    },
2538
+    {
2539
+      "name": "host",
2540
+      "id": "3f43a0873f00310a71cd6a71e2e60c113cf17d1812be2ec22fd519fbac68ec91",
2541
+      "driver": "host",
2542
+      "containers": {}
2543
+    }
2544
+  ]
2545
+```
2546
+
2547
+
2548
+
2549
+Query Parameters:
2550
+
2551
+- **filter** - JSON encoded value of the filters (a `map[string][]string`) to process on the volumes list. Available filters: `name=[network-names]` , `id=[network-ids]`
2552
+
2553
+Status Codes:
2554
+
2555
+-   **200** - no error
2556
+-   **500** - server error
2557
+
2558
+### Inspect network
2559
+
2560
+`GET /networks/<network-id>`
2561
+
2562
+**Example request**:
2563
+
2564
+  GET /networks/f995e41e471c833266786a64df584fbe4dc654ac99f63a4ee7495842aa093fc4 HTTP/1.1
2565
+
2566
+**Example response**:
2567
+
2568
+  HTTP/1.1 200 OK
2569
+  Content-Type: application/json
2570
+
2571
+```
2572
+  {
2573
+    "name": "bridge",
2574
+    "id": "f995e41e471c833266786a64df584fbe4dc654ac99f63a4ee7495842aa093fc4",
2575
+    "driver": "bridge",
2576
+    "containers": {
2577
+      "931d29e96e63022a3691f55ca18b28600239acf53878451975f77054b05ba559": {
2578
+        "endpoint": "aa79321e2899e6d72fcd46e6a4ad7f81ab9a19c3b06e384ef4ce51fea35827f9",
2579
+        "mac_address": "02:42:ac:11:00:04",
2580
+        "ipv4_address": "172.17.0.4/16",
2581
+        "ipv6_address": ""
2582
+      },
2583
+      "961249b4ae6c764b11eed923e8463c102689111fffd933627b2e7e359c7d0f7c": {
2584
+        "endpoint": "4f62c5aea6b9a70512210be7db976bd4ec2cdba47125e4fe514d18c81b1624b1",
2585
+        "mac_address": "02:42:ac:11:00:02",
2586
+        "ipv4_address": "172.17.0.2/16",
2587
+        "ipv6_address": ""
2588
+      },
2589
+      "9f6e0fec4449f42a173ed85be96dc2253b6719edd850d8169bc31bdc45db675c": {
2590
+        "endpoint": "352b512a5bccdfc77d16c2c04d04408e718f879a16f9ce3913a4733139e4f98d",
2591
+        "mac_address": "02:42:ac:11:00:03",
2592
+        "ipv4_address": "172.17.0.3/16",
2593
+        "ipv6_address": ""
2594
+      }
2595
+    }
2596
+  }
2597
+```
2598
+
2599
+Status Codes:
2600
+
2601
+-   **200** - no error
2602
+-   **404** - network not found
2603
+
2604
+### Create a network
2605
+
2606
+`POST /networks/create`
2607
+
2608
+Create a network
2609
+
2610
+**Example request**:
2611
+
2612
+  POST /networks/create HTTP/1.1
2613
+  Content-Type: application/json
2614
+
2615
+```
2616
+  {
2617
+    "name":"isolated_nw",
2618
+    "driver":"bridge"
2619
+  }
2620
+```
2621
+
2622
+**Example response**:
2623
+
2624
+  HTTP/1.1 201 Created
2625
+  Content-Type: application/json
2626
+
2627
+```
2628
+  {
2629
+    "id": "22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30",
2630
+    "warning": ""
2631
+  }
2632
+```
2633
+
2634
+Status Codes:
2635
+
2636
+- **201** - no error
2637
+- **404** - driver not found
2638
+- **500** - server error
2639
+
2640
+JSON Parameters:
2641
+
2642
+- **name** - The new network's name. this is a mandatory field
2643
+- **driver** - Name of the network driver to use. Defaults to `bridge` driver
2644
+- **options** - Network specific options to be used by the drivers
2645
+- **check_duplicate** - Requests daemon to check for networks with same name
2646
+
2647
+### Connect a container to a network
2648
+
2649
+`POST /networks/(id)/connect`
2650
+
2651
+Connects a container to a network
2652
+
2653
+**Example request**:
2654
+
2655
+  POST /networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30/connect HTTP/1.1
2656
+  Content-Type: application/json
2657
+
2658
+```
2659
+  {
2660
+    "container":"3613f73ba0e4"
2661
+  }
2662
+```
2663
+
2664
+**Example response**:
2665
+
2666
+  HTTP/1.1 200 OK
2667
+
2668
+Status Codes:
2669
+
2670
+- **201** - no error
2671
+- **404** - network or container is not found
2672
+
2673
+JSON Parameters:
2674
+
2675
+- **container** - container-id/name to be connected to the network
2676
+
2677
+### Disconnect a container from a network
2678
+
2679
+`POST /networks/(id)/disconnect`
2680
+
2681
+Disconnects a container from a network
2682
+
2683
+**Example request**:
2684
+
2685
+  POST /networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30/disconnect HTTP/1.1
2686
+  Content-Type: application/json
2687
+
2688
+```
2689
+  {
2690
+    "container":"3613f73ba0e4"
2691
+  }
2692
+```
2693
+
2694
+**Example response**:
2695
+
2696
+  HTTP/1.1 200 OK
2697
+
2698
+Status Codes:
2699
+
2700
+- **201** - no error
2701
+- **404** - network or container not found
2702
+
2703
+JSON Parameters:
2704
+
2705
+- **container** - container-id/name to be disconnected from a network
2706
+
2707
+### Remove a network
2708
+
2709
+`DELETE /networks/(id)`
2710
+
2711
+Instruct the driver to remove the network (`id`).
2712
+
2713
+**Example request**:
2714
+
2715
+  DELETE /networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30 HTTP/1.1
2716
+
2717
+**Example response**:
2718
+
2719
+  HTTP/1.1 204 No Content
2720
+
2721
+Status Codes
2722
+
2723
+-   **204** - no error
2724
+-   **404** - no such network
2725
+-   **500** - server error
2726
+
2727
+# 3. Going further
2728
+
2729
+## 3.1 Inside `docker run`
2730
+
2731
+As an example, the `docker run` command line makes the following API calls:
2732
+
2733
+- Create the container
2734
+
2735
+- If the status code is 404, it means the image doesn't exist:
2736
+    - Try to pull it.
2737
+    - Then, retry to create the container.
2738
+
2739
+- Start the container.
2740
+
2741
+- If you are not in detached mode:
2742
+- Attach to the container, using `logs=1` (to have `stdout` and
2743
+      `stderr` from the container's start) and `stream=1`
2744
+
2745
+- If in detached mode or only `stdin` is attached, display the container's id.
2746
+
2747
+## 3.2 Hijacking
2748
+
2749
+In this version of the API, `/attach`, uses hijacking to transport `stdin`,
2750
+`stdout`, and `stderr` on the same socket.
2751
+
2752
+To hint potential proxies about connection hijacking, Docker client sends
2753
+connection upgrade headers similarly to websocket.
2754
+
2755
+    Upgrade: tcp
2756
+    Connection: Upgrade
2757
+
2758
+When Docker daemon detects the `Upgrade` header, it switches its status code
2759
+from **200 OK** to **101 UPGRADED** and resends the same headers.
2760
+
2761
+
2762
+## 3.3 CORS Requests
2763
+
2764
+To set cross origin requests to the remote api please give values to 
2765
+`--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all,
2766
+default or blank means CORS disabled
2767
+
2768
+    $ docker daemon -H="192.168.1.9:2375" --api-cors-header="http://foo.bar"