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