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