github.com/sbward/docker@v1.4.2-0.20150114010528-c9dab702bed3/docs/sources/reference/api/docker_remote_api.md (about) 1 page_title: Remote API 2 page_description: API Documentation for Docker 3 page_keywords: API, Docker, rcli, REST, documentation 4 5 # Docker Remote API 6 7 - By default the Docker daemon listens on `unix:///var/run/docker.sock` 8 and the client must have `root` access to interact with the daemon. 9 - If the Docker daemon is set to use an encrypted TCP socket (`--tls`, 10 or `--tlsverify`) as with Boot2Docker 1.3.0, then you need to add extra 11 parameters to `curl` or `wget` when making test API requests: 12 `curl --insecure --cert ~/.docker/cert.pem --key ~/.docker/key.pem https://boot2docker:2376/images/json` 13 or 14 `wget --no-check-certificate --certificate=$DOCKER_CERT_PATH/cert.pem --private-key=$DOCKER_CERT_PATH/key.pem https://boot2docker:2376/images/json -O - -q` 15 - If a group named `docker` exists on your system, docker will apply 16 ownership of the socket to the group. 17 - The API tends to be REST, but for some complex commands, like attach 18 or pull, the HTTP connection is hijacked to transport STDOUT, STDIN, 19 and STDERR. 20 - Since API version 1.2, the auth configuration is now handled client 21 side, so the client has to send the `authConfig` as a `POST` in `/images/(name)/push`. 22 - authConfig, set as the `X-Registry-Auth` header, is currently a Base64 23 encoded (JSON) string with the following structure: 24 `{"username": "string", "password": "string", "email": "string", 25 "serveraddress" : "string", "auth": ""}`. Notice that `auth` is to be left 26 empty, `serveraddress` is a domain/ip without protocol, and that double 27 quotes (instead of single ones) are required. 28 - The Remote API uses an open schema model. In this model, unknown 29 properties in incoming messages will be ignored. 30 Client applications need to take this into account to ensure 31 they will not break when talking to newer Docker daemons. 32 33 The current version of the API is v1.17 34 35 Calling `/info` is the same as calling 36 `/v1.17/info`. 37 38 You can still call an old version of the API using 39 `/v1.16/info`. 40 41 ## v1.17 42 43 ### Full Documentation 44 45 [*Docker Remote API v1.17*](/reference/api/docker_remote_api_v1.17/) 46 47 ### What's new 48 49 `POST /containers/(id)/attach` and `POST /exec/(id)/start` 50 51 **New!** 52 Docker client now hints potential proxies about connection hijacking using HTTP Upgrade headers. 53 54 `GET /containers/(id)/json` 55 56 **New!** 57 This endpoint now returns the list current execs associated with the container (`ExecIDs`). 58 59 `POST /containers/(id)/rename` 60 61 **New!** 62 New endpoint to rename a container `id` to a new name. 63 64 ## v1.16 65 66 ### Full Documentation 67 68 [*Docker Remote API v1.16*](/reference/api/docker_remote_api_v1.16/) 69 70 ### What's new 71 72 `GET /info` 73 74 **New!** 75 `info` now returns the number of CPUs available on the machine (`NCPU`), 76 total memory available (`MemTotal`), a user-friendly name describing the running Docker daemon (`Name`), a unique ID identifying the daemon (`ID`), and 77 a list of daemon labels (`Labels`). 78 79 `POST /containers/create` 80 81 **New!** 82 You can set the new container's MAC address explicitly. 83 84 **New!** 85 Volumes are now initialized when the container is created. 86 87 `POST /containers/(id)/copy` 88 89 **New!** 90 You can now copy data which is contained in a volume. 91 92 ## v1.15 93 94 ### Full Documentation 95 96 [*Docker Remote API v1.15*](/reference/api/docker_remote_api_v1.15/) 97 98 ### What's new 99 100 `POST /containers/create` 101 102 **New!** 103 It is now possible to set a container's HostConfig when creating a container. 104 Previously this was only available when starting a container. 105 106 ## v1.14 107 108 ### Full Documentation 109 110 [*Docker Remote API v1.14*](/reference/api/docker_remote_api_v1.14/) 111 112 ### What's new 113 114 `DELETE /containers/(id)` 115 116 **New!** 117 When using `force`, the container will be immediately killed with SIGKILL. 118 119 `POST /containers/(id)/start` 120 121 **New!** 122 The `hostConfig` option now accepts the field `CapAdd`, which specifies a list of capabilities 123 to add, and the field `CapDrop`, which specifies a list of capabilities to drop. 124 125 `POST /images/create` 126 127 **New!** 128 The `fromImage` and `repo` parameters now supports the `repo:tag` format. 129 Consequently, the `tag` parameter is now obsolete. Using the new format and 130 the `tag` parameter at the same time will return an error. 131 132 ## v1.13 133 134 ### Full Documentation 135 136 [*Docker Remote API v1.13*](/reference/api/docker_remote_api_v1.13/) 137 138 ### What's new 139 140 `GET /containers/(name)/json` 141 142 **New!** 143 The `HostConfig.Links` field is now filled correctly 144 145 **New!** 146 `Sockets` parameter added to the `/info` endpoint listing all the sockets the 147 daemon is configured to listen on. 148 149 `POST /containers/(name)/start` 150 `POST /containers/(name)/stop` 151 152 **New!** 153 `start` and `stop` will now return 304 if the container's status is not modified 154 155 `POST /commit` 156 157 **New!** 158 Added a `pause` parameter (default `true`) to pause the container during commit 159 160 ## v1.12 161 162 ### Full Documentation 163 164 [*Docker Remote API v1.12*](/reference/api/docker_remote_api_v1.12/) 165 166 ### What's new 167 168 `POST /build` 169 170 **New!** 171 Build now has support for the `forcerm` parameter to always remove containers 172 173 `GET /containers/(name)/json` 174 `GET /images/(name)/json` 175 176 **New!** 177 All the JSON keys are now in CamelCase 178 179 **New!** 180 Trusted builds are now Automated Builds - `is_trusted` is now `is_automated`. 181 182 **Removed Insert Endpoint** 183 The `insert` endpoint has been removed. 184 185 ## v1.11 186 187 ### Full Documentation 188 189 [*Docker Remote API v1.11*](/reference/api/docker_remote_api_v1.11/) 190 191 ### What's new 192 193 `GET /_ping` 194 195 **New!** 196 You can now ping the server via the `_ping` endpoint. 197 198 `GET /events` 199 200 **New!** 201 You can now use the `-until` parameter to close connection 202 after timestamp. 203 204 `GET /containers/(id)/logs` 205 206 This url is preferred method for getting container logs now. 207 208 ## v1.10 209 210 ### Full Documentation 211 212 [*Docker Remote API v1.10*](/reference/api/docker_remote_api_v1.10/) 213 214 ### What's new 215 216 `DELETE /images/(name)` 217 218 **New!** 219 You can now use the force parameter to force delete of an 220 image, even if it's tagged in multiple repositories. **New!** 221 You 222 can now use the noprune parameter to prevent the deletion of parent 223 images 224 225 `DELETE /containers/(id)` 226 227 **New!** 228 You can now use the force parameter to force delete a 229 container, even if it is currently running 230 231 ## v1.9 232 233 ### Full Documentation 234 235 [*Docker Remote API v1.9*](/reference/api/docker_remote_api_v1.9/) 236 237 ### What's new 238 239 `POST /build` 240 241 **New!** 242 This endpoint now takes a serialized ConfigFile which it 243 uses to resolve the proper registry auth credentials for pulling the 244 base image. Clients which previously implemented the version 245 accepting an AuthConfig object must be updated. 246 247 ## v1.8 248 249 ### Full Documentation 250 251 [*Docker Remote API v1.8*](/reference/api/docker_remote_api_v1.8/) 252 253 ### What's new 254 255 `POST /build` 256 257 **New!** 258 This endpoint now returns build status as json stream. In 259 case of a build error, it returns the exit status of the failed 260 command. 261 262 `GET /containers/(id)/json` 263 264 **New!** 265 This endpoint now returns the host config for the 266 container. 267 268 `POST /images/create` 269 270 `POST /images/(name)/insert` 271 272 `POST /images/(name)/push` 273 274 **New!** 275 progressDetail object was added in the JSON. It's now 276 possible to get the current value and the total of the progress 277 without having to parse the string. 278 279 ## v1.7 280 281 ### Full Documentation 282 283 [*Docker Remote API v1.7*](/reference/api/docker_remote_api_v1.7/) 284 285 ### What's new 286 287 `GET /images/json` 288 289 The format of the json returned from this uri changed. Instead of an 290 entry for each repo/tag on an image, each image is only represented 291 once, with a nested attribute indicating the repo/tags that apply to 292 that image. 293 294 Instead of: 295 296 HTTP/1.1 200 OK 297 Content-Type: application/json 298 299 [ 300 { 301 "VirtualSize": 131506275, 302 "Size": 131506275, 303 "Created": 1365714795, 304 "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", 305 "Tag": "12.04", 306 "Repository": "ubuntu" 307 }, 308 { 309 "VirtualSize": 131506275, 310 "Size": 131506275, 311 "Created": 1365714795, 312 "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", 313 "Tag": "latest", 314 "Repository": "ubuntu" 315 }, 316 { 317 "VirtualSize": 131506275, 318 "Size": 131506275, 319 "Created": 1365714795, 320 "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", 321 "Tag": "precise", 322 "Repository": "ubuntu" 323 }, 324 { 325 "VirtualSize": 180116135, 326 "Size": 24653, 327 "Created": 1364102658, 328 "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", 329 "Tag": "12.10", 330 "Repository": "ubuntu" 331 }, 332 { 333 "VirtualSize": 180116135, 334 "Size": 24653, 335 "Created": 1364102658, 336 "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", 337 "Tag": "quantal", 338 "Repository": "ubuntu" 339 } 340 ] 341 342 The returned json looks like this: 343 344 HTTP/1.1 200 OK 345 Content-Type: application/json 346 347 [ 348 { 349 "RepoTags": [ 350 "ubuntu:12.04", 351 "ubuntu:precise", 352 "ubuntu:latest" 353 ], 354 "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", 355 "Created": 1365714795, 356 "Size": 131506275, 357 "VirtualSize": 131506275 358 }, 359 { 360 "RepoTags": [ 361 "ubuntu:12.10", 362 "ubuntu:quantal" 363 ], 364 "ParentId": "27cf784147099545", 365 "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", 366 "Created": 1364102658, 367 "Size": 24653, 368 "VirtualSize": 180116135 369 } 370 ] 371 372 `GET /images/viz` 373 374 This URI no longer exists. The `images --viz` 375 output is now generated in the client, using the 376 `/images/json` data. 377 378 ## v1.6 379 380 ### Full Documentation 381 382 [*Docker Remote API v1.6*](/reference/api/docker_remote_api_v1.6/) 383 384 ### What's new 385 386 `POST /containers/(id)/attach` 387 388 **New!** 389 You can now split stderr from stdout. This is done by 390 prefixing a header to each transmission. See 391 [`POST /containers/(id)/attach`]( 392 /reference/api/docker_remote_api_v1.9/#attach-to-a-container "POST /containers/(id)/attach"). 393 The WebSocket attach is unchanged. Note that attach calls on the 394 previous API version didn't change. Stdout and stderr are merged. 395 396 ## v1.5 397 398 ### Full Documentation 399 400 [*Docker Remote API v1.5*](/reference/api/docker_remote_api_v1.5/) 401 402 ### What's new 403 404 `POST /images/create` 405 406 **New!** 407 You can now pass registry credentials (via an AuthConfig 408 object) through the X-Registry-Auth header 409 410 `POST /images/(name)/push` 411 412 **New!** 413 The AuthConfig object now needs to be passed through the 414 X-Registry-Auth header 415 416 `GET /containers/json` 417 418 **New!** 419 The format of the Ports entry has been changed to a list of 420 dicts each containing PublicPort, PrivatePort and Type describing a 421 port mapping. 422 423 ## v1.4 424 425 ### Full Documentation 426 427 [*Docker Remote API v1.4*](/reference/api/docker_remote_api_v1.4/) 428 429 ### What's new 430 431 `POST /images/create` 432 433 **New!** 434 When pulling a repo, all images are now downloaded in parallel. 435 436 `GET /containers/(id)/top` 437 438 **New!** 439 You can now use ps args with docker top, like docker top 440 <container_id> aux 441 442 `GET /events` 443 444 **New!** 445 Image's name added in the events 446 447 ## v1.3 448 449 docker v0.5.0 450 [51f6c4a](https://github.com/docker/docker/commit/51f6c4a7372450d164c61e0054daf0223ddbd909) 451 452 ### Full Documentation 453 454 [*Docker Remote API v1.3*](/reference/api/docker_remote_api_v1.3/) 455 456 ### What's new 457 458 `GET /containers/(id)/top` 459 460 List the processes running inside a container. 461 462 `GET /events` 463 464 **New!** 465 Monitor docker's events via streaming or via polling 466 467 Builder (/build): 468 469 - Simplify the upload of the build context 470 - Simply stream a tarball instead of multipart upload with 4 471 intermediary buffers 472 - Simpler, less memory usage, less disk usage and faster 473 474 > **Warning**: 475 > The /build improvements are not reverse-compatible. Pre 1.3 clients will 476 > break on /build. 477 478 List containers (/containers/json): 479 480 - You can use size=1 to get the size of the containers 481 482 Start containers (/containers/<id>/start): 483 484 - You can now pass host-specific configuration (e.g., bind mounts) in 485 the POST body for start calls 486 487 ## v1.2 488 489 docker v0.4.2 490 [2e7649b](https://github.com/docker/docker/commit/2e7649beda7c820793bd46766cbc2cfeace7b168) 491 492 ### Full Documentation 493 494 [*Docker Remote API v1.2*](/reference/api/docker_remote_api_v1.2/) 495 496 ### What's new 497 498 The auth configuration is now handled by the client. 499 500 The client should send it's authConfig as POST on each call of 501 `/images/(name)/push` 502 503 `GET /auth` 504 505 **Deprecated.** 506 507 `POST /auth` 508 509 Only checks the configuration but doesn't store it on the server 510 511 Deleting an image is now improved, will only untag the image if it 512 has children and remove all the untagged parents if has any. 513 514 `POST /images/<name>/delete` 515 516 Now returns a JSON structure with the list of images 517 deleted/untagged. 518 519 ## v1.1 520 521 docker v0.4.0 522 [a8ae398](https://github.com/docker/docker/commit/a8ae398bf52e97148ee7bd0d5868de2e15bd297f) 523 524 ### Full Documentation 525 526 [*Docker Remote API v1.1*](/reference/api/docker_remote_api_v1.1/) 527 528 ### What's new 529 530 `POST /images/create` 531 532 `POST /images/(name)/insert` 533 534 `POST /images/(name)/push` 535 536 Uses json stream instead of HTML hijack, it looks like this: 537 538 HTTP/1.1 200 OK 539 Content-Type: application/json 540 541 {"status":"Pushing..."} 542 {"status":"Pushing", "progress":"1/? (n/a)"} 543 {"error":"Invalid..."} 544 ... 545 546 ## v1.0 547 548 docker v0.3.4 549 [8d73740](https://github.com/docker/docker/commit/8d73740343778651c09160cde9661f5f387b36f4) 550 551 ### Full Documentation 552 553 [*Docker Remote API v1.0*](/reference/api/docker_remote_api_v1.0/) 554 555 ### What's new 556 557 Initial version