diff --git a/docs/sources/reference/api/docker-io_api.md b/docs/sources/reference/api/docker-io_api.md index e34e43f3bf..c49c6e2fa4 100644 --- a/docs/sources/reference/api/docker-io_api.md +++ b/docs/sources/reference/api/docker-io_api.md @@ -4,23 +4,21 @@ page_keywords: API, Docker, index, REST, documentation, Docker Hub, registry # Docker Hub API -## Introduction - - This is the REST API for [Docker Hub](https://hub.docker.com). - Authorization is done with basic auth over SSL - Not all commands require authentication, only those noted as such. -## Repository +# Repositories -### Repositories +## User Repository -#### User Repo +### Create a user repository `PUT /v1/repositories/(namespace)/(repo_name)/` Create a user repository with the given `namespace` and `repo_name`. - **Example Request**: +**Example Request**: PUT /v1/repositories/foo/bar/ HTTP/1.1 Host: index.docker.io @@ -31,12 +29,12 @@ Create a user repository with the given `namespace` and `repo_name`. [{"id": "9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f"}] - Parameters: +Parameters: - - **namespace** – the namespace for the repo - - **repo_name** – the name for the repo +- **namespace** – the namespace for the repo +- **repo_name** – the name for the repo - **Example Response**: +**Example Response**: HTTP/1.1 200 Vary: Accept @@ -47,18 +45,20 @@ Create a user repository with the given `namespace` and `repo_name`. "" - Status Codes: +Status Codes: - - **200** – Created - - **400** – Errors (invalid json, missing or invalid fields, etc) - - **401** – Unauthorized - - **403** – Account is not Active +- **200** – Created +- **400** – Errors (invalid json, missing or invalid fields, etc) +- **401** – Unauthorized +- **403** – Account is not Active + +### Delete a user repository `DELETE /v1/repositories/(namespace)/(repo_name)/` Delete a user repository with the given `namespace` and `repo_name`. - **Example Request**: +**Example Request**: DELETE /v1/repositories/foo/bar/ HTTP/1.1 Host: index.docker.io @@ -69,12 +69,12 @@ Delete a user repository with the given `namespace` and `repo_name`. "" - Parameters: +Parameters: - - **namespace** – the namespace for the repo - - **repo_name** – the name for the repo +- **namespace** – the namespace for the repo +- **repo_name** – the name for the repo - **Example Response**: +**Example Response**: HTTP/1.1 202 Vary: Accept @@ -85,25 +85,27 @@ Delete a user repository with the given `namespace` and `repo_name`. "" - Status Codes: +Status Codes: - - **200** – Deleted - - **202** – Accepted - - **400** – Errors (invalid json, missing or invalid fields, etc) - - **401** – Unauthorized - - **403** – Account is not Active +- **200** – Deleted +- **202** – Accepted +- **400** – Errors (invalid json, missing or invalid fields, etc) +- **401** – Unauthorized +- **403** – Account is not Active -#### Library Repo +## Library Repository + +### Create a library repository `PUT /v1/repositories/(repo_name)/` Create a library repository with the given `repo_name`. This is a restricted feature only available to docker admins. - When namespace is missing, it is assumed to be `library` +> When namespace is missing, it is assumed to be `library` - **Example Request**: +**Example Request**: PUT /v1/repositories/foobar/ HTTP/1.1 Host: index.docker.io @@ -114,11 +116,11 @@ This is a restricted feature only available to docker admins. [{"id": "9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f"}] - Parameters: +Parameters: - - **repo_name** – the library name for the repo +- **repo_name** – the library name for the repo - **Example Response**: +**Example Response**: HTTP/1.1 200 Vary: Accept @@ -129,22 +131,24 @@ This is a restricted feature only available to docker admins. "" - Status Codes: +Status Codes: - - **200** – Created - - **400** – Errors (invalid json, missing or invalid fields, etc) - - **401** – Unauthorized - - **403** – Account is not Active +- **200** – Created +- **400** – Errors (invalid json, missing or invalid fields, etc) +- **401** – Unauthorized +- **403** – Account is not Active + +### Delete a library repository `DELETE /v1/repositories/(repo_name)/` Delete a library repository with the given `repo_name`. This is a restricted feature only available to docker admins. - When namespace is missing, it is assumed to be `library` +> When namespace is missing, it is assumed to be `library` - **Example Request**: +**Example Request**: DELETE /v1/repositories/foobar/ HTTP/1.1 Host: index.docker.io @@ -155,11 +159,11 @@ This is a restricted feature only available to docker admins. "" - Parameters: +Parameters: - - **repo_name** – the library name for the repo +- **repo_name** – the library name for the repo - **Example Response**: +**Example Response**: HTTP/1.1 202 Vary: Accept @@ -170,23 +174,25 @@ This is a restricted feature only available to docker admins. "" - Status Codes: +Status Codes: - - **200** – Deleted - - **202** – Accepted - - **400** – Errors (invalid json, missing or invalid fields, etc) - - **401** – Unauthorized - - **403** – Account is not Active +- **200** – Deleted +- **202** – Accepted +- **400** – Errors (invalid json, missing or invalid fields, etc) +- **401** – Unauthorized +- **403** – Account is not Active -### Repository Images +# Repository Images -#### User Repo Images +## User Repository Images + +### Update user repository images `PUT /v1/repositories/(namespace)/(repo_name)/images` Update the images for a user repo. - **Example Request**: +**Example Request**: PUT /v1/repositories/foo/bar/images HTTP/1.1 Host: index.docker.io @@ -197,12 +203,12 @@ Update the images for a user repo. [{"id": "9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f", "checksum": "b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087"}] - Parameters: +Parameters: - - **namespace** – the namespace for the repo - - **repo_name** – the name for the repo +- **namespace** – the namespace for the repo +- **repo_name** – the name for the repo - **Example Response**: +**Example Response**: HTTP/1.1 204 Vary: Accept @@ -210,29 +216,31 @@ Update the images for a user repo. "" - Status Codes: +Status Codes: - - **204** – Created - - **400** – Errors (invalid json, missing or invalid fields, etc) - - **401** – Unauthorized - - **403** – Account is not Active or permission denied +- **204** – Created +- **400** – Errors (invalid json, missing or invalid fields, etc) +- **401** – Unauthorized +- **403** – Account is not Active or permission denied + +### List user repository images `GET /v1/repositories/(namespace)/(repo_name)/images` Get the images for a user repo. - **Example Request**: +**Example Request**: GET /v1/repositories/foo/bar/images HTTP/1.1 Host: index.docker.io Accept: application/json - Parameters: +Parameters: - - **namespace** – the namespace for the repo - - **repo_name** – the name for the repo +- **namespace** – the namespace for the repo +- **repo_name** – the name for the repo - **Example Response**: +**Example Response**: HTTP/1.1 200 Vary: Accept @@ -243,18 +251,20 @@ Get the images for a user repo. {"id": "ertwetewtwe38722009fe6857087b486531f9a779a0c1dfddgfgsdgdsgds", "checksum": "34t23f23fc17e3ed29dae8f12c4f9e89cc6f0bsdfgfsdgdsgdsgerwgew"}] - Status Codes: +Status Codes: - - **200** – OK - - **404** – Not found +- **200** – OK +- **404** – Not found -#### Library Repo Images +## Library Repository Images + +### Update library repository images `PUT /v1/repositories/(repo_name)/images` Update the images for a library repo. - **Example Request**: +**Example Request**: PUT /v1/repositories/foobar/images HTTP/1.1 Host: index.docker.io @@ -265,11 +275,11 @@ Update the images for a library repo. [{"id": "9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f", "checksum": "b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087"}] - Parameters: +Parameters: - - **repo_name** – the library name for the repo +- **repo_name** – the library name for the repo - **Example Response**: +**Example Response**: HTTP/1.1 204 Vary: Accept @@ -277,28 +287,30 @@ Update the images for a library repo. "" - Status Codes: +Status Codes: - - **204** – Created - - **400** – Errors (invalid json, missing or invalid fields, etc) - - **401** – Unauthorized - - **403** – Account is not Active or permission denied +- **204** – Created +- **400** – Errors (invalid json, missing or invalid fields, etc) +- **401** – Unauthorized +- **403** – Account is not Active or permission denied + +### List library repository images `GET /v1/repositories/(repo_name)/images` Get the images for a library repo. - **Example Request**: +**Example Request**: GET /v1/repositories/foobar/images HTTP/1.1 Host: index.docker.io Accept: application/json - Parameters: +Parameters: - - **repo_name** – the library name for the repo +- **repo_name** – the library name for the repo - **Example Response**: +**Example Response**: HTTP/1.1 200 Vary: Accept @@ -309,31 +321,33 @@ Get the images for a library repo. {"id": "ertwetewtwe38722009fe6857087b486531f9a779a0c1dfddgfgsdgdsgds", "checksum": "34t23f23fc17e3ed29dae8f12c4f9e89cc6f0bsdfgfsdgdsgdsgerwgew"}] - Status Codes: +Status Codes: - - **200** – OK - - **404** – Not found +- **200** – OK +- **404** – Not found -### Repository Authorization +# Repository Authorization -#### Library Repo +## Library Repository + +### Authorize a toke for a library `PUT /v1/repositories/(repo_name)/auth` Authorize a token for a library repo - **Example Request**: +**Example Request**: PUT /v1/repositories/foobar/auth HTTP/1.1 Host: index.docker.io Accept: application/json Authorization: Token signature=123abc,repository="library/foobar",access=write - Parameters: +Parameters: - - **repo_name** – the library name for the repo +- **repo_name** – the library name for the repo - **Example Response**: +**Example Response**: HTTP/1.1 200 Vary: Accept @@ -341,31 +355,33 @@ Authorize a token for a library repo "OK" - Status Codes: +Status Codes: - - **200** – OK - - **403** – Permission denied - - **404** – Not found +- **200** – OK +- **403** – Permission denied +- **404** – Not found -#### User Repo +## User Repository + +### Authorize a toke for a user repository `PUT /v1/repositories/(namespace)/(repo_name)/auth` Authorize a token for a user repo - **Example Request**: +**Example Request**: PUT /v1/repositories/foo/bar/auth HTTP/1.1 Host: index.docker.io Accept: application/json Authorization: Token signature=123abc,repository="foo/bar",access=write - Parameters: +Parameters: - - **namespace** – the namespace for the repo - - **repo_name** – the name for the repo +- **namespace** – the namespace for the repo +- **repo_name** – the name for the repo - **Example Response**: +**Example Response**: HTTP/1.1 200 Vary: Accept @@ -373,28 +389,28 @@ Authorize a token for a user repo "OK" - Status Codes: +Status Codes: - - **200** – OK - - **403** – Permission denied - - **404** – Not found +- **200** – OK +- **403** – Permission denied +- **404** – Not found -### Users +## Users -#### User Login +### User Login `GET /v1/users` If you want to check your login, you can try this endpoint - **Example Request**: +**Example Request**: GET /v1/users HTTP/1.1 Host: index.docker.io Accept: application/json Authorization: Basic akmklmasadalkm== - **Example Response**: +**Example Response**: HTTP/1.1 200 OK Vary: Accept @@ -402,19 +418,19 @@ If you want to check your login, you can try this endpoint OK - Status Codes: +Status Codes: - - **200** – no error - - **401** – Unauthorized - - **403** – Account is not Active +- **200** – no error +- **401** – Unauthorized +- **403** – Account is not Active -#### User Register +### User Register `POST /v1/users` Registering a new account. - **Example request**: +**Example request**: POST /v1/users HTTP/1.1 Host: index.docker.io @@ -425,16 +441,14 @@ Registering a new account. "password": "toto42", "username": "foobar"} - Json Parameters: +Json Parameters: -   - - - **email** – valid email address, that needs to be confirmed - - **username** – min 4 character, max 30 characters, must match +- **email** – valid email address, that needs to be confirmed +- **username** – min 4 character, max 30 characters, must match the regular expression [a-z0-9_]. - - **password** – min 5 characters +- **password** – min 5 characters - **Example Response**: +**Example Response**: HTTP/1.1 201 OK Vary: Accept @@ -442,25 +456,24 @@ Registering a new account. "User Created" - Status Codes: +Status Codes: - - **201** – User Created - - **400** – Errors (invalid json, missing or invalid fields, etc) +- **201** – User Created +- **400** – Errors (invalid json, missing or invalid fields, etc) -#### Update User +### Update User `PUT /v1/users/(username)/` Change a password or email address for given user. If you pass in an +email, it will add it to your account, it will not remove the old +one. Passwords will be updated. - email, it will add it to your account, it will not remove the old - one. Passwords will be updated. +It is up to the client to verify that that password that is sent is +the one that they want. Common approach is to have them type it +twice. - It is up to the client to verify that that password that is sent is - the one that they want. Common approach is to have them type it - twice. - - **Example Request**: +**Example Request**: PUT /v1/users/fakeuser/ HTTP/1.1 Host: index.docker.io @@ -471,11 +484,11 @@ Change a password or email address for given user. If you pass in an {"email": "sam@docker.com", "password": "toto42"} - Parameters: +Parameters: - - **username** – username for the person you want to update +- **username** – username for the person you want to update - **Example Response**: +**Example Response**: HTTP/1.1 204 Vary: Accept @@ -483,20 +496,18 @@ Change a password or email address for given user. If you pass in an "" - Status Codes: +Status Codes: - - **204** – User Updated - - **400** – Errors (invalid json, missing or invalid fields, etc) - - **401** – Unauthorized - - **403** – Account is not Active - - **404** – User not found +- **204** – User Updated +- **400** – Errors (invalid json, missing or invalid fields, etc) +- **401** – Unauthorized +- **403** – Account is not Active +- **404** – User not found ## Search If you need to search the index, this is the endpoint you would use. -### Search - `GET /v1/search` Search the Index given a search term. It accepts @@ -504,13 +515,13 @@ Search the Index given a search term. It accepts [GET](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.3) only. - **Example request**: +**Example request**: GET /v1/search?q=search_term HTTP/1.1 Host: example.com Accept: application/json - **Example response**: +**Example response**: HTTP/1.1 200 OK Vary: Accept @@ -525,11 +536,11 @@ Search the Index given a search term. It accepts ] } - Query Parameters: +Query Parameters: - - **q** – what you want to search for +- **q** – what you want to search for - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error diff --git a/docs/sources/reference/api/docker_io_accounts_api.md b/docs/sources/reference/api/docker_io_accounts_api.md index b9f76ba92c..efb86eb33a 100644 --- a/docs/sources/reference/api/docker_io_accounts_api.md +++ b/docs/sources/reference/api/docker_io_accounts_api.md @@ -4,43 +4,39 @@ page_keywords: API, Docker, accounts, REST, documentation # docker.io Accounts API -## 1. Endpoints - -### 1.1 Get a single user +## Get a single user `GET /api/v1.1/users/:username/` Get profile info for the specified user. - Parameters: +Parameters: - - **username** – username of the user whose profile info is being +- **username** – username of the user whose profile info is being requested. - Request Headers: +Request Headers: -   - - - **Authorization** – required authentication credentials of +- **Authorization** – required authentication credentials of either type HTTP Basic or OAuth Bearer Token. - Status Codes: +Status Codes: - - **200** – success, user data returned. - - **401** – authentication error. - - **403** – permission error, authenticated user must be the user +- **200** – success, user data returned. +- **401** – authentication error. +- **403** – permission error, authenticated user must be the user whose data is being requested, OAuth access tokens must have `profile_read` scope. - - **404** – the specified username does not exist. +- **404** – the specified username does not exist. - **Example request**: +**Example request**: GET /api/v1.1/users/janedoe/ HTTP/1.1 Host: www.docker.io Accept: application/json Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ= - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -60,48 +56,44 @@ Get profile info for the specified user. "is_active": true } -### 1.2 Update a single user +## Update a single user `PATCH /api/v1.1/users/:username/` Update profile info for the specified user. - Parameters: +Parameters: - - **username** – username of the user whose profile info is being +- **username** – username of the user whose profile info is being updated. - Json Parameters: +Json Parameters: -   - - - **full_name** (*string*) – (optional) the new name of the user. - - **location** (*string*) – (optional) the new location. - - **company** (*string*) – (optional) the new company of the user. - - **profile_url** (*string*) – (optional) the new profile url. - - **gravatar_email** (*string*) – (optional) the new Gravatar +- **full_name** (*string*) – (optional) the new name of the user. +- **location** (*string*) – (optional) the new location. +- **company** (*string*) – (optional) the new company of the user. +- **profile_url** (*string*) – (optional) the new profile url. +- **gravatar_email** (*string*) – (optional) the new Gravatar email address. - Request Headers: +Request Headers: -   - - - **Authorization** – required authentication credentials of +- **Authorization** – required authentication credentials of either type HTTP Basic or OAuth Bearer Token. - - **Content-Type** – MIME Type of post data. JSON, url-encoded +- **Content-Type** – MIME Type of post data. JSON, url-encoded form data, etc. - Status Codes: +Status Codes: - - **200** – success, user data updated. - - **400** – post data validation error. - - **401** – authentication error. - - **403** – permission error, authenticated user must be the user +- **200** – success, user data updated. +- **400** – post data validation error. +- **401** – authentication error. +- **403** – permission error, authenticated user must be the user whose data is being updated, OAuth access tokens must have `profile_write` scope. - - **404** – the specified username does not exist. +- **404** – the specified username does not exist. - **Example request**: +**Example request**: PATCH /api/v1.1/users/janedoe/ HTTP/1.1 Host: www.docker.io @@ -114,7 +106,7 @@ Update profile info for the specified user. "company": "Retired", } - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -134,41 +126,39 @@ Update profile info for the specified user. "is_active": true } -### 1.3 List email addresses for a user +## List email addresses for a user `GET /api/v1.1/users/:username/emails/` List email info for the specified user. - Parameters: +Parameters: - - **username** – username of the user whose profile info is being +- **username** – username of the user whose profile info is being updated. - Request Headers: +Request Headers: -   - - - **Authorization** – required authentication credentials of +- **Authorization** – required authentication credentials of either type HTTP Basic or OAuth Bearer Token - Status Codes: +Status Codes: - - **200** – success, user data updated. - - **401** – authentication error. - - **403** – permission error, authenticated user must be the user +- **200** – success, user data updated. +- **401** – authentication error. +- **403** – permission error, authenticated user must be the user whose data is being requested, OAuth access tokens must have `email_read` scope. - - **404** – the specified username does not exist. +- **404** – the specified username does not exist. - **Example request**: +**Example request**: GET /api/v1.1/users/janedoe/emails/ HTTP/1.1 Host: www.docker.io Accept: application/json Authorization: Bearer zAy0BxC1wDv2EuF3tGs4HrI6qJp6KoL7nM - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -181,7 +171,7 @@ List email info for the specified user. } ] -### 1.4 Add email address for a user +## Add email address for a user `POST /api/v1.1/users/:username/emails/` @@ -189,32 +179,28 @@ Add a new email address to the specified user's account. The email address must be verified separately, a confirmation email is not automatically sent. - Json Parameters: +Json Parameters: -   +- **email** (*string*) – email address to be added. - - **email** (*string*) – email address to be added. +Request Headers: - Request Headers: - -   - - - **Authorization** – required authentication credentials of +- **Authorization** – required authentication credentials of either type HTTP Basic or OAuth Bearer Token. - - **Content-Type** – MIME Type of post data. JSON, url-encoded +- **Content-Type** – MIME Type of post data. JSON, url-encoded form data, etc. - Status Codes: +Status Codes: - - **201** – success, new email added. - - **400** – data validation error. - - **401** – authentication error. - - **403** – permission error, authenticated user must be the user +- **201** – success, new email added. +- **400** – data validation error. +- **401** – authentication error. +- **403** – permission error, authenticated user must be the user whose data is being requested, OAuth access tokens must have `email_write` scope. - - **404** – the specified username does not exist. +- **404** – the specified username does not exist. - **Example request**: +**Example request**: POST /api/v1.1/users/janedoe/emails/ HTTP/1.1 Host: www.docker.io @@ -226,7 +212,7 @@ automatically sent. "email": "jane.doe+other@example.com" } - **Example response**: +**Example response**: HTTP/1.1 201 Created Content-Type: application/json @@ -237,40 +223,36 @@ automatically sent. "primary": false } -### 1.5 Delete email address for a user +## Delete email address for a user `DELETE /api/v1.1/users/:username/emails/` Delete an email address from the specified user's account. You cannot delete a user's primary email address. - Json Parameters: +Json Parameters: -   +- **email** (*string*) – email address to be deleted. - - **email** (*string*) – email address to be deleted. +Request Headers: - Request Headers: - -   - - - **Authorization** – required authentication credentials of +- **Authorization** – required authentication credentials of either type HTTP Basic or OAuth Bearer Token. - - **Content-Type** – MIME Type of post data. JSON, url-encoded +- **Content-Type** – MIME Type of post data. JSON, url-encoded form data, etc. - Status Codes: +Status Codes: - - **204** – success, email address removed. - - **400** – validation error. - - **401** – authentication error. - - **403** – permission error, authenticated user must be the user +- **204** – success, email address removed. +- **400** – validation error. +- **401** – authentication error. +- **403** – permission error, authenticated user must be the user whose data is being requested, OAuth access tokens must have `email_write` scope. - - **404** – the specified username or email address does not +- **404** – the specified username or email address does not exist. - **Example request**: +**Example request**: DELETE /api/v1.1/users/janedoe/emails/ HTTP/1.1 Host: www.docker.io @@ -282,7 +264,7 @@ cannot delete a user's primary email address. "email": "jane.doe+other@example.com" } - **Example response**: +**Example response**: HTTP/1.1 204 NO CONTENT Content-Length: 0 diff --git a/docs/sources/reference/api/docker_remote_api_v1.0.md b/docs/sources/reference/api/docker_remote_api_v1.0.md index 70d2510e35..65158ec8ee 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.0.md +++ b/docs/sources/reference/api/docker_remote_api_v1.0.md @@ -22,11 +22,11 @@ page_keywords: API, Docker, rcli, REST, documentation List containers - **Example request**: +**Example request**: GET /containers/json?all=1&before=8dfafdbc3a40 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -62,24 +62,24 @@ List containers } ] - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default - - **limit** – Show `limit` last created +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul +- **limit** – Show `limit` last created containers, include non-running ones. - - **since** – Show only containers created since Id, include +- **since** – Show only containers created since Id, include non-running ones. - - **before** – Show only containers created before Id, include +- **before** – Show only containers created before Id, include non-running ones. - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create a container @@ -87,7 +87,7 @@ List containers Create a container - **Example request**: +**Example request**: POST /containers/create HTTP/1.1 Content-Type: application/json @@ -114,7 +114,7 @@ Create a container "VolumesFrom":"" } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/json @@ -124,18 +124,18 @@ Create a container "Warnings":[] } - Json Parameters: +Json Parameters:   - - **config** – the container's configuration +- **config** – the container's configuration - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **406** – impossible to attach (container not running) - - **500** – server error +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error ### Inspect a container @@ -144,11 +144,11 @@ Create a container Return low-level information on the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -199,11 +199,11 @@ Return low-level information on the container `id` "Volumes": {} } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Inspect changes on a container's filesystem @@ -211,11 +211,11 @@ Return low-level information on the container `id` Inspect changes on container `id`'s filesystem - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/changes HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -235,11 +235,11 @@ Inspect changes on container `id`'s filesystem } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Export a container @@ -247,22 +247,22 @@ Inspect changes on container `id`'s filesystem Export the contents of container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/export HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Start a container @@ -270,19 +270,19 @@ Export the contents of container `id` Start the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/start HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Stop a container @@ -290,25 +290,25 @@ Start the container `id` Stop the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/stop?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Restart a container @@ -316,25 +316,25 @@ Stop the container `id` Restart the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/restart?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Kill a container @@ -342,19 +342,19 @@ Restart the container `id` Kill the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/kill HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Attach to a container @@ -362,38 +362,38 @@ Kill the container `id` Attach to the container `id` - **Example request**: +**Example request**: POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **logs** – 1/True/true or 0/False/false, return logs. Default +- **logs** – 1/True/true or 0/False/false, return logs. Defaul false - - **stream** – 1/True/true or 0/False/false, return stream. +- **stream** – 1/True/true or 0/False/false, return stream. Default false - - **stdin** – 1/True/true or 0/False/false, if stream=true, attach +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false - - **stdout** – 1/True/true or 0/False/false, if logs=true, return +- **stdout** – 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false - - **stderr** – 1/True/true or 0/False/false, if logs=true, return +- **stderr** – 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ### Wait a container @@ -401,22 +401,22 @@ Attach to the container `id` Block until container `id` stops, then returns the exit code - **Example request**: +**Example request**: POST /containers/16253994b7c4/wait HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json {"StatusCode":0} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Remove a container @@ -424,27 +424,27 @@ Block until container `id` stops, then returns the exit code Remove the container `id` from the filesystem - **Example request**: +**Example request**: DELETE /containers/16253994b7c4?v=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **v** – 1/True/true or 0/False/false, Remove the volumes +- **v** – 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false - Status Codes: +Status Codes: - - **204** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ## 2.2 Images @@ -454,11 +454,11 @@ Remove the container `id` from the filesystem List images `format` could be json or viz (json default) - **Example request**: +**Example request**: GET /images/json?all=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -478,11 +478,11 @@ List images `format` could be json or viz (json default) } ] - **Example request**: +**Example request**: GET /images/viz HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: text/plain @@ -505,50 +505,50 @@ List images `format` could be json or viz (json default) base [style=invisible] } - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create an image `POST /images/create` -Create an image, either by pull it from the registry or by importing it +Create an image, either by pull it from the registry or by importing i - **Example request**: +**Example request**: POST /images/create?fromImage=ubuntu HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **fromImage** – name of the image to pull - - **fromSrc** – source to import, - means stdin - - **repo** – repository - - **tag** – tag - - **registry** – the registry to pull from +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Insert a file in an image @@ -556,27 +556,25 @@ Create an image, either by pull it from the registry or by importing it Insert a file from `url` in the image `name` at `path` - **Example request**: +**Example request**: POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK {{ TAR STREAM }} - Query Parameters: +Query Parameters: +- **url** – The url from where the file is taken +- **path** – The path where the file is stored +Status Codes: - - **url** – The url from where the file is taken - - **path** – The path where the file is stored - - Status Codes: - - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Inspect an image @@ -584,11 +582,11 @@ Insert a file from `url` in the image `name` at `path` Return low-level information on the image `name` - **Example request**: +**Example request**: GET /images/centos/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -620,11 +618,11 @@ Return low-level information on the image `name` } } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Get the history of an image @@ -632,11 +630,11 @@ Return low-level information on the image `name` Return the history of the image `name` - **Example request**: +**Example request**: GET /images/fedora/history HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -654,11 +652,11 @@ Return the history of the image `name` } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Push an image on the registry @@ -677,11 +675,11 @@ Push the image `name` on the registry {{ STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Tag an image into a repository @@ -689,27 +687,27 @@ Push the image `name` on the registry Tag the image `name` into a repository - **Example request**: +**Example request**: POST /images/test/tag?repo=myrepo&force=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 201 OK - Query Parameters: +Query Parameters:   - - **repo** – The repository to tag in - - **force** – 1/True/true or 0/False/false, default false +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **201** – no error - - **400** – bad parameter - - **404** – no such image - - **500** – server error +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **500** – server error ### Remove an image @@ -717,19 +715,19 @@ Tag the image `name` into a repository Remove the image `name` from the filesystem - **Example request**: +**Example request**: DELETE /images/test HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such image - - **500** – server error +- **204** – no error +- **404** – no such image +- **500** – server error ### Search images @@ -737,11 +735,11 @@ Remove the image `name` from the filesystem Search for an image on [Docker Hub](https://hub.docker.com) - **Example request**: +**Example request**: GET /images/search?term=sshd HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -773,29 +771,29 @@ Search for an image on [Docker Hub](https://hub.docker.com) Build an image from Dockerfile via stdin - **Example request**: +**Example request**: POST /build HTTP/1.1 {{ TAR STREAM }} - **Example response**: +**Example response**: HTTP/1.1 200 OK {{ STREAM }} - Query Parameters: +Query Parameters:   - - **t** – repository name to be applied to the resulting image in +- **t** – repository name to be applied to the resulting image in case of success - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Get default username and email @@ -803,11 +801,11 @@ Build an image from Dockerfile via stdin Get the default username and email - **Example request**: +**Example request**: GET /auth HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -817,18 +815,18 @@ Get the default username and email "email":"hannibal@a-team.com" } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error -### Check auth configuration and store it +### Check auth configuration and store i `POST /auth` Get the default username and email - **Example request**: +**Example request**: POST /auth HTTP/1.1 Content-Type: application/json @@ -839,15 +837,15 @@ Get the default username and email "email":"hannibal@a-team.com" } - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **204** – no error - - **500** – server error +- **200** – no error +- **204** – no error +- **500** – server error ### Display system-wide information @@ -855,11 +853,11 @@ Get the default username and email Display system-wide information - **Example request**: +**Example request**: GET /info HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -874,10 +872,10 @@ Display system-wide information "SwapLimit":false } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Show the docker version information @@ -885,11 +883,11 @@ Display system-wide information Show the docker version information - **Example request**: +**Example request**: GET /version HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -900,10 +898,10 @@ Show the docker version information "GoVersion":"go1.0.3" } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Create a new image from a container's changes @@ -921,29 +919,29 @@ Create a new image from a container's changes "PortSpecs":["22"] } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/vnd.docker.raw-stream {"Id":"596069db4bf5"} - Query Parameters: +Query Parameters:   - - **container** – source container - - **repo** – repository - - **tag** – tag - - **m** – commit message - - **author** – author (e.g., "John Hannibal Smith +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **500** – server error +- **201** – no error +- **404** – no such container +- **500** – server error # 3. Going further @@ -954,7 +952,7 @@ Here are the steps of `docker run` : - Create the container - If the status code is 404, it means the image doesn't exists: - - Try to pull it + - Try to pull i - Then retry to create the container - Start the container @@ -964,10 +962,10 @@ Here are the steps of `docker run` : stderr from the container's start) and stream=1 - If in detached mode or only stdin is attached: - - Display the container's + - Display the container's ## 3.2 Hijacking In this first version of the API, some of the endpoints, like /attach, /pull or /push uses hijacking to transport stdin, stdout and stderr on -the same socket. This might change in the future. +he same socket. This might change in the future. diff --git a/docs/sources/reference/api/docker_remote_api_v1.1.md b/docs/sources/reference/api/docker_remote_api_v1.1.md index 928e3210f2..a0390d1740 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.1.md +++ b/docs/sources/reference/api/docker_remote_api_v1.1.md @@ -22,11 +22,11 @@ page_keywords: API, Docker, rcli, REST, documentation List containers - **Example request**: +**Example request**: GET /containers/json?all=1&before=8dfafdbc3a40 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -62,24 +62,24 @@ List containers } ] - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default - - **limit** – Show `limit` last created +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul +- **limit** – Show `limit` last created containers, include non-running ones. - - **since** – Show only containers created since Id, include +- **since** – Show only containers created since Id, include non-running ones. - - **before** – Show only containers created before Id, include +- **before** – Show only containers created before Id, include non-running ones. - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create a container @@ -87,7 +87,7 @@ List containers Create a container - **Example request**: +**Example request**: POST /containers/create HTTP/1.1 Content-Type: application/json @@ -114,7 +114,7 @@ Create a container "VolumesFrom":"" } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/json @@ -124,18 +124,18 @@ Create a container "Warnings":[] } - Json Parameters: +Json Parameters:   - - **config** – the container's configuration +- **config** – the container's configuration - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **406** – impossible to attach (container not running) - - **500** – server error +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error ### Inspect a container @@ -144,11 +144,11 @@ Create a container Return low-level information on the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -199,11 +199,11 @@ Return low-level information on the container `id` "Volumes": {} } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Inspect changes on a container's filesystem @@ -211,11 +211,11 @@ Return low-level information on the container `id` Inspect changes on container `id`'s filesystem - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/changes HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -235,11 +235,11 @@ Inspect changes on container `id`'s filesystem } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Export a container @@ -247,22 +247,22 @@ Inspect changes on container `id`'s filesystem Export the contents of container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/export HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Start a container @@ -270,19 +270,19 @@ Export the contents of container `id` Start the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/start HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Stop a container @@ -290,25 +290,25 @@ Start the container `id` Stop the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/stop?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Restart a container @@ -316,25 +316,25 @@ Stop the container `id` Restart the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/restart?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Kill a container @@ -342,19 +342,19 @@ Restart the container `id` Kill the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/kill HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Attach to a container @@ -362,38 +362,38 @@ Kill the container `id` Attach to the container `id` - **Example request**: +**Example request**: POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **logs** – 1/True/true or 0/False/false, return logs. Default +- **logs** – 1/True/true or 0/False/false, return logs. Defaul false - - **stream** – 1/True/true or 0/False/false, return stream. +- **stream** – 1/True/true or 0/False/false, return stream. Default false - - **stdin** – 1/True/true or 0/False/false, if stream=true, attach +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false - - **stdout** – 1/True/true or 0/False/false, if logs=true, return +- **stdout** – 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false - - **stderr** – 1/True/true or 0/False/false, if logs=true, return +- **stderr** – 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ### Wait a container @@ -401,22 +401,22 @@ Attach to the container `id` Block until container `id` stops, then returns the exit code - **Example request**: +**Example request**: POST /containers/16253994b7c4/wait HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json {"StatusCode":0} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Remove a container @@ -424,27 +424,27 @@ Block until container `id` stops, then returns the exit code Remove the container `id` from the filesystem - **Example request**: +**Example request**: DELETE /containers/16253994b7c4?v=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **v** – 1/True/true or 0/False/false, Remove the volumes +- **v** – 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false - Status Codes: +Status Codes: - - **204** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ## 2.2 Images @@ -454,11 +454,11 @@ Remove the container `id` from the filesystem List images `format` could be json or viz (json default) - **Example request**: +**Example request**: GET /images/json?all=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -478,11 +478,11 @@ List images `format` could be json or viz (json default) } ] - **Example request**: +**Example request**: GET /images/viz HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: text/plain @@ -505,30 +505,30 @@ List images `format` could be json or viz (json default) base [style=invisible] } - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create an image `POST /images/create` -Create an image, either by pull it from the registry or by importing it +Create an image, either by pull it from the registry or by importing i - **Example request**: +**Example request**: POST /images/create?fromImage=ubuntu HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -538,20 +538,20 @@ Create an image, either by pull it from the registry or by importing it {"error":"Invalid..."} ... - Query Parameters: +Query Parameters:   - - **fromImage** – name of the image to pull - - **fromSrc** – source to import, - means stdin - - **repo** – repository - - **tag** – tag - - **registry** – the registry to pull from +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Insert a file in an image @@ -559,11 +559,11 @@ Create an image, either by pull it from the registry or by importing it Insert a file from `url` in the image `name` at `path` - **Example request**: +**Example request**: POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -573,17 +573,15 @@ Insert a file from `url` in the image `name` at `path` {"error":"Invalid..."} ... - Query Parameters: +Query Parameters: +- **url** – The url from where the file is taken +- **path** – The path where the file is stored +Status Codes: - - **url** – The url from where the file is taken - - **path** – The path where the file is stored - - Status Codes: - - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Inspect an image @@ -591,11 +589,11 @@ Insert a file from `url` in the image `name` at `path` Return low-level information on the image `name` - **Example request**: +**Example request**: GET /images/centos/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -627,11 +625,11 @@ Return low-level information on the image `name` } } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Get the history of an image @@ -639,11 +637,11 @@ Return low-level information on the image `name` Return the history of the image `name` - **Example request**: +**Example request**: GET /images/fedora/history HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -661,11 +659,11 @@ Return the history of the image `name` } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Push an image on the registry @@ -687,11 +685,11 @@ Push the image `name` on the registry {"error":"Invalid..."} ... - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Tag an image into a repository @@ -699,28 +697,28 @@ Push the image `name` on the registry Tag the image `name` into a repository - **Example request**: +**Example request**: POST /images/test/tag?repo=myrepo&force=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 201 OK - Query Parameters: +Query Parameters:   - - **repo** – The repository to tag in - - **force** – 1/True/true or 0/False/false, default false +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **201** – no error - - **400** – bad parameter - - **404** – no such image - - **409** – conflict - - **500** – server error +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflic +- **500** – server error ### Remove an image @@ -728,19 +726,19 @@ Tag the image `name` into a repository Remove the image `name` from the filesystem - **Example request**: +**Example request**: DELETE /images/test HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such image - - **500** – server error +- **204** – no error +- **404** – no such image +- **500** – server error ### Search images @@ -748,11 +746,11 @@ Remove the image `name` from the filesystem Search for an image on [Docker Hub](https://hub.docker.com) - **Example request**: +**Example request**: GET /images/search?term=sshd HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -784,29 +782,29 @@ Search for an image on [Docker Hub](https://hub.docker.com) Build an image from Dockerfile via stdin - **Example request**: +**Example request**: POST /build HTTP/1.1 {{ STREAM }} - **Example response**: +**Example response**: HTTP/1.1 200 OK {{ STREAM }} - Query Parameters: +Query Parameters:   - - **t** – tag to be applied to the resulting image in case of +- **t** – tag to be applied to the resulting image in case of success - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Get default username and email @@ -814,11 +812,11 @@ Build an image from Dockerfile via stdin Get the default username and email - **Example request**: +**Example request**: GET /auth HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -828,18 +826,18 @@ Get the default username and email "email":"hannibal@a-team.com" } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error -### Check auth configuration and store it +### Check auth configuration and store i `POST /auth` Get the default username and email - **Example request**: +**Example request**: POST /auth HTTP/1.1 Content-Type: application/json @@ -850,15 +848,15 @@ Get the default username and email "email":"hannibal@a-team.com" } - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **204** – no error - - **500** – server error +- **200** – no error +- **204** – no error +- **500** – server error ### Display system-wide information @@ -866,11 +864,11 @@ Get the default username and email Display system-wide information - **Example request**: +**Example request**: GET /info HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -885,10 +883,10 @@ Display system-wide information "SwapLimit":false } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Show the docker version information @@ -896,11 +894,11 @@ Display system-wide information Show the docker version information - **Example request**: +**Example request**: GET /version HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -911,10 +909,10 @@ Show the docker version information "GoVersion":"go1.0.3" } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Create a new image from a container's changes @@ -922,7 +920,7 @@ Show the docker version information Create a new image from a container's changes - **Example request**: +**Example request**: POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 Content-Type: application/json @@ -932,29 +930,29 @@ Create a new image from a container's changes "PortSpecs":["22"] } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/vnd.docker.raw-stream {"Id":"596069db4bf5"} - Query Parameters: +Query Parameters:   - - **container** – source container - - **repo** – repository - - **tag** – tag - - **m** – commit message - - **author** – author (e.g., "John Hannibal Smith +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **500** – server error +- **201** – no error +- **404** – no such container +- **500** – server error # 3. Going further @@ -965,7 +963,7 @@ Here are the steps of `docker run` : - Create the container - If the status code is 404, it means the image doesn't exists: - - Try to pull it + - Try to pull i - Then retry to create the container - Start the container @@ -975,7 +973,7 @@ Here are the steps of `docker run` : stderr from the container's start) and stream=1 - If in detached mode or only stdin is attached: - - Display the container's + - Display the container's ## 3.2 Hijacking diff --git a/docs/sources/reference/api/docker_remote_api_v1.10.md b/docs/sources/reference/api/docker_remote_api_v1.10.md index 3a3e4122bf..c33b850f65 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.10.md +++ b/docs/sources/reference/api/docker_remote_api_v1.10.md @@ -23,11 +23,11 @@ page_keywords: API, Docker, rcli, REST, documentation List containers - **Example request**: +**Example request**: GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -75,26 +75,26 @@ List containers } ] - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default - - **limit** – Show `limit` last created +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul +- **limit** – Show `limit` last created containers, include non-running ones. - - **since** – Show only containers created since Id, include +- **since** – Show only containers created since Id, include non-running ones. - - **before** – Show only containers created before Id, include +- **before** – Show only containers created before Id, include non-running ones. - - **size** – 1/True/true or 0/False/false, Show the containers +- **size** – 1/True/true or 0/False/false, Show the containers sizes - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create a container @@ -102,7 +102,7 @@ List containers Create a container - **Example request**: +**Example request**: POST /containers/create HTTP/1.1 Content-Type: application/json @@ -134,7 +134,7 @@ Create a container } } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/json @@ -144,25 +144,25 @@ Create a container "Warnings":[] } - Json Parameters: +Json Parameters:   - - **config** – the container's configuration +- **config** – the container's configuration - Query Parameters: +Query Parameters:   - - **name** – Assign the specified name to the container. Must +- **name** – Assign the specified name to the container. Mus match `/?[a-zA-Z0-9_-]+`. - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **406** – impossible to attach (container not running) - - **500** – server error +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error ### Inspect a container @@ -170,11 +170,11 @@ Create a container Return low-level information on the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -241,11 +241,11 @@ Return low-level information on the container `id` } } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### List processes running inside a container @@ -253,11 +253,11 @@ Return low-level information on the container `id` List processes running inside the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/top HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -282,17 +282,17 @@ List processes running inside the container `id` ] } - Query Parameters: +Query Parameters:   - - **ps\_args** – ps arguments to use (e.g., aux) +- **ps\_args** – ps arguments to use (e.g., aux) - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Inspect changes on a container's filesystem @@ -300,11 +300,11 @@ List processes running inside the container `id` Inspect changes on container `id` 's filesystem - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/changes HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -324,11 +324,11 @@ Inspect changes on container `id` 's filesystem } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Export a container @@ -336,22 +336,22 @@ Inspect changes on container `id` 's filesystem Export the contents of container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/export HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Start a container @@ -359,7 +359,7 @@ Export the contents of container `id` Start the container `id` - **Example request**: +**Example request**: POST /containers/(id)/start HTTP/1.1 Content-Type: application/json @@ -374,22 +374,22 @@ Start the container `id` "VolumesFrom": ["parent", "other:ro"] } - **Example response**: +**Example response**: - HTTP/1.1 204 No Content + HTTP/1.1 204 No Conten Content-Type: text/plain - Json Parameters: +Json Parameters:   - - **hostConfig** – the container's host configuration (optional) +- **hostConfig** – the container's host configuration (optional) - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Stop a container @@ -397,25 +397,25 @@ Start the container `id` Stop the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/stop?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Restart a container @@ -423,25 +423,25 @@ Stop the container `id` Restart the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/restart?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Kill a container @@ -449,24 +449,24 @@ Restart the container `id` Kill the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/kill HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters +Query Parameters - - **signal** - Signal to send to the container: integer or string like "SIGINT". +- **signal** - Signal to send to the container: integer or string like "SIGINT". When not set, SIGKILL is assumed and the call will waits for the container to exit. - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Attach to a container @@ -474,38 +474,38 @@ Kill the container `id` Attach to the container `id` - **Example request**: +**Example request**: POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **logs** – 1/True/true or 0/False/false, return logs. Default +- **logs** – 1/True/true or 0/False/false, return logs. Defaul false - - **stream** – 1/True/true or 0/False/false, return stream. +- **stream** – 1/True/true or 0/False/false, return stream. Default false - - **stdin** – 1/True/true or 0/False/false, if stream=true, attach +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false - - **stdout** – 1/True/true or 0/False/false, if logs=true, return +- **stdout** – 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false - - **stderr** – 1/True/true or 0/False/false, if logs=true, return +- **stderr** – 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error **Stream details**: @@ -530,9 +530,9 @@ Attach to the container `id` `STREAM_TYPE` can be: - - 0: stdin (will be written on stdout) - - 1: stdout - - 2: stderr +- 0: stdin (will be written on stdout) +- 1: stdou +- 2: stderr `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of the uint32 size encoded as big endian. @@ -548,7 +548,7 @@ Attach to the container `id` 1. Read 8 bytes 2. chose stdout or stderr depending on the first byte 3. Extract the frame size from the last 4 byets - 4. Read the extracted size and output it on the correct output + 4. Read the extracted size and output it on the correct outpu 5. Goto 1) ### Wait a container @@ -558,51 +558,51 @@ Attach to the container `id` Block until container `id` stops, then returns the exit code - **Example request**: +**Example request**: POST /containers/16253994b7c4/wait HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json {"StatusCode":0} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Remove a container `DELETE /containers/(id*) : Remove the container `id` from the filesystem - **Example request**: +**Example request**: DELETE /containers/16253994b7c4?v=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **v** – 1/True/true or 0/False/false, Remove the volumes +- **v** – 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false - - **force** – 1/True/true or 0/False/false, Removes the container +- **force** – 1/True/true or 0/False/false, Removes the container even if it was running. Default false - Status Codes: +Status Codes: - - **204** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ### Copy files or folders from a container @@ -610,7 +610,7 @@ Block until container `id` stops, then returns Copy files or folders of container `id` - **Example request**: +**Example request**: POST /containers/4fa6e0f0c678/copy HTTP/1.1 Content-Type: application/json @@ -619,18 +619,18 @@ Copy files or folders of container `id` "Resource":"test.txt" } - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### 2.2 Images @@ -642,7 +642,7 @@ Copy files or folders of container `id` GET /images/json?all=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -677,13 +677,13 @@ Copy files or folders of container `id` `POST /images/create` Create an image, either by pull it from the registry or by importing - it + i - **Example request**: +**Example request**: POST /images/create?fromImage=base HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -697,26 +697,26 @@ Create an image, either by pull it from the registry or by importing `X-Registry-Auth` header can be used to include a base64-encoded AuthConfig object. - Query Parameters: +Query Parameters:   - - **fromImage** – name of the image to pull - - **fromSrc** – source to import, - means stdin - - **repo** – repository - - **tag** – tag - - **registry** – the registry to pull from +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from Request Headers:   - - **X-Registry-Auth** – base64-encoded AuthConfig object +- **X-Registry-Auth** – base64-encoded AuthConfig objec - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Insert a file in an image @@ -725,11 +725,11 @@ Create an image, either by pull it from the registry or by importing Insert a file from `url` in the image `name` at `path` - **Example request**: +**Example request**: POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -739,17 +739,15 @@ Insert a file from `url` in the image {"error":"Invalid..."} ... - Query Parameters: +Query Parameters: +- **url** – The url from where the file is taken +- **path** – The path where the file is stored +Status Codes: - - **url** – The url from where the file is taken - - **path** – The path where the file is stored - - Status Codes: - - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Inspect an image @@ -757,11 +755,11 @@ Insert a file from `url` in the image Return low-level information on the image `name` - **Example request**: +**Example request**: GET /images/base/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -793,11 +791,11 @@ Return low-level information on the image `name` "Size": 6824592 } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Get the history of an image @@ -805,11 +803,11 @@ Return low-level information on the image `name` Return the history of the image `name` - **Example request**: +**Example request**: GET /images/base/history HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -827,11 +825,11 @@ Return the history of the image `name` } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Push an image on the registry @@ -839,11 +837,11 @@ Return the history of the image `name` Push the image `name` on the registry - **Example request**: +**Example request**: POST /images/test/push HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -854,32 +852,32 @@ Push the image `name` on the registry ... If you wish to push an image on to a private registry, that image must already have been tagged - into a repository which references that registry host name and port. This repository name should + into a repository which references that registry host name and port. This repository name should then be used in the URL. This mirrors the flow of the CLI. - **Example request**: +**Example request**: - POST /images/registry.acme.com:5000/test/push HTTP/1.1 - + POST /images/registry.acme.com:5000/test/push HTTP/1.1 - Query Parameters: + +Query Parameters:   - - **tag** – the tag to associate with the image on the registry, optional +- **tag** – the tag to associate with the image on the registry, optional Request Headers:   - - **X-Registry-Auth** – include a base64-encoded AuthConfig +- **X-Registry-Auth** – include a base64-encoded AuthConfig object. - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Tag an image into a repository @@ -887,39 +885,39 @@ Push the image `name` on the registry Tag the image `name` into a repository - **Example request**: +**Example request**: POST /images/test/tag?repo=myrepo&force=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 201 OK - Query Parameters: +Query Parameters:   - - **repo** – The repository to tag in - - **force** – 1/True/true or 0/False/false, default false +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **201** – no error - - **400** – bad parameter - - **404** – no such image - - **409** – conflict - - **500** – server error +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflic +- **500** – server error ### Remove an image `DELETE /images/(name*) : Remove the image `name` from the filesystem - **Example request**: +**Example request**: DELETE /images/test HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-type: application/json @@ -930,19 +928,19 @@ Tag the image `name` into a repository {"Deleted":"53b4f83ac9"} ] - Query Parameters: +Query Parameters:   - - **force** – 1/True/true or 0/False/false, default false - - **noprune** – 1/True/true or 0/False/false, default false +- **force** – 1/True/true or 0/False/false, default false +- **noprune** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **409** – conflict - - **500** – server error +- **200** – no error +- **404** – no such image +- **409** – conflic +- **500** – server error ### Search images @@ -954,11 +952,11 @@ Search for an image on [Docker Hub](https://hub.docker.com). > The response keys have changed from API v1.6 to reflect the JSON > sent by the registry server to the docker daemon's request. - **Example request**: +**Example request**: GET /images/search?term=sshd HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -988,16 +986,16 @@ Search for an image on [Docker Hub](https://hub.docker.com). ... ] - Query Parameters: +Query Parameters:   - - **term** – term to search +- **term** – term to search - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### 2.3 Misc @@ -1007,13 +1005,13 @@ Search for an image on [Docker Hub](https://hub.docker.com). Build an image from Dockerfile via stdin - **Example request**: +**Example request**: POST /build HTTP/1.1 {{ TAR STREAM }} - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1030,28 +1028,28 @@ Build an image from Dockerfile via stdin which will be accessible in the build context (See the [*ADD build command*](/reference/builder/#dockerbuilder)). - Query Parameters: +Query Parameters:   - - **t** – repository name (and optionally a tag) to be applied to +- **t** – repository name (and optionally a tag) to be applied to the resulting image in case of success - - **q** – suppress verbose build output - - **nocache** – do not use the cache when building the image - - **rm** - remove intermediate containers after a successful build +- **q** – suppress verbose build outpu +- **nocache** – do not use the cache when building the image +- **rm** - remove intermediate containers after a successful build Request Headers:   - - **Content-type** – should be set to +- **Content-type** – should be set to `"application/tar"`. - - **X-Registry-Config** – base64-encoded ConfigFile object +- **X-Registry-Config** – base64-encoded ConfigFile objec - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Check auth configuration @@ -1059,7 +1057,7 @@ Build an image from Dockerfile via stdin Get the default username and email - **Example request**: +**Example request**: POST /auth HTTP/1.1 Content-Type: application/json @@ -1071,15 +1069,15 @@ Get the default username and email "serveraddress":"https://index.docker.io/v1/" } - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **204** – no error - - **500** – server error +- **200** – no error +- **204** – no error +- **500** – server error ### Display system-wide information @@ -1087,11 +1085,11 @@ Get the default username and email Display system-wide information - **Example request**: +**Example request**: GET /info HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1107,10 +1105,10 @@ Display system-wide information "IPv4Forwarding":true } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Show the docker version information @@ -1118,11 +1116,11 @@ Display system-wide information Show the docker version information - **Example request**: +**Example request**: GET /version HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1133,10 +1131,10 @@ Show the docker version information "GoVersion":"go1.0.3" } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Create a new image from a container's changes @@ -1144,7 +1142,7 @@ Show the docker version information Create a new image from a container's changes - **Example request**: +**Example request**: POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 Content-Type: application/json @@ -1175,7 +1173,7 @@ Create a new image from a container's changes } } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/vnd.docker.raw-stream @@ -1183,28 +1181,28 @@ Create a new image from a container's changes {"Id":"596069db4bf5"} - Json Parameters: +Json Parameters: - - **config** - the container's configuration +- **config** - the container's configuration - Query Parameters: +Query Parameters:   - - **container** – source container - - **repo** – repository - - **tag** – tag - - **m** – commit message - - **author** – author (e.g., "John Hannibal Smith +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **500** – server error +- **201** – no error +- **404** – no such container +- **500** – server error ### Monitor Docker's events @@ -1213,11 +1211,11 @@ Create a new image from a container's changes Get events from docker, either in real time via streaming, or via polling (using since) - **Example request**: +**Example request**: GET /events?since=1374067924 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1227,16 +1225,16 @@ Get events from docker, either in real time via streaming, or via {"status":"stop","id":"dfdf82bd3881","from":"base:latest","time":1374067966} {"status":"destroy","id":"dfdf82bd3881","from":"base:latest","time":1374067970} - Query Parameters: +Query Parameters:   - - **since** – timestamp used for polling +- **since** – timestamp used for polling - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Get a tarball containing all images and tags in a repository @@ -1245,21 +1243,21 @@ Get events from docker, either in real time via streaming, or via Get a tarball containing all images and metadata for the repository specified by `name`. - **Example request** +**Example request** - GET /images/ubuntu/get + GET /images/ubuntu/ge - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/x-tar Binary data stream - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Load a tarball with a set of images and tags into docker @@ -1267,20 +1265,20 @@ Get a tarball containing all images and metadata for the repository Load a set of images and tags into the docker repository. - **Example request** +**Example request** POST /images/load Tarball in body - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error # 3. Going further @@ -1291,7 +1289,7 @@ Here are the steps of `docker run` : - Create the container - If the status code is 404, it means the image doesn't exists: - - Try to pull it + - Try to pull i - Then retry to create the container - Start the container diff --git a/docs/sources/reference/api/docker_remote_api_v1.11.md b/docs/sources/reference/api/docker_remote_api_v1.11.md index 86702adf8f..fb5d716887 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.11.md +++ b/docs/sources/reference/api/docker_remote_api_v1.11.md @@ -23,11 +23,11 @@ page_keywords: API, Docker, rcli, REST, documentation List containers - **Example request**: +**Example request**: GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -75,26 +75,26 @@ List containers } ] - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default - - **limit** – Show `limit` last created +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul +- **limit** – Show `limit` last created containers, include non-running ones. - - **since** – Show only containers created since Id, include +- **since** – Show only containers created since Id, include non-running ones. - - **before** – Show only containers created before Id, include +- **before** – Show only containers created before Id, include non-running ones. - - **size** – 1/True/true or 0/False/false, Show the containers +- **size** – 1/True/true or 0/False/false, Show the containers sizes - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create a container @@ -102,7 +102,7 @@ List containers Create a container - **Example request**: +**Example request**: POST /containers/create HTTP/1.1 Content-Type: application/json @@ -135,7 +135,7 @@ Create a container } } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/json @@ -145,25 +145,21 @@ Create a container "Warnings":[] } - Json Parameters: +Json Parameters: -   +- **config** – the container's configuration - - **config** – the container's configuration +Query Parameters: - Query Parameters: - -   - - - **name** – Assign the specified name to the container. Must +- **name** – Assign the specified name to the container. Mus match `/?[a-zA-Z0-9_-]+`. - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **406** – impossible to attach (container not running) - - **500** – server error +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error ### Inspect a container @@ -172,11 +168,11 @@ Create a container Return low-level information on the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -245,11 +241,11 @@ Return low-level information on the container `id` } } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### List processes running inside a container @@ -257,11 +253,11 @@ Return low-level information on the container `id` List processes running inside the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/top HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -286,17 +282,17 @@ List processes running inside the container `id` ] } - Query Parameters: +Query Parameters:   - - **ps_args** – ps arguments to use (e.g., aux) +- **ps_args** – ps arguments to use (e.g., aux) - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Get container logs @@ -304,35 +300,35 @@ List processes running inside the container `id` Get stdout and stderr logs from the container ``id`` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1×tamps=1&follow=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **follow** – 1/True/true or 0/False/false, return stream. +- **follow** – 1/True/true or 0/False/false, return stream. Default false - - **stdout** – 1/True/true or 0/False/false, if logs=true, return +- **stdout** – 1/True/true or 0/False/false, if logs=true, return stdout log. Default false - - **stderr** – 1/True/true or 0/False/false, if logs=true, return +- **stderr** – 1/True/true or 0/False/false, if logs=true, return stderr log. Default false - - **timestamps** – 1/True/true or 0/False/false, if logs=true, print +- **timestamps** – 1/True/true or 0/False/false, if logs=true, prin timestamps for every log line. Default false - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Inspect changes on a container's filesystem @@ -340,11 +336,11 @@ Get stdout and stderr logs from the container ``id`` Inspect changes on container `id`'s filesystem - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/changes HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -364,11 +360,11 @@ Inspect changes on container `id`'s filesystem } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Export a container @@ -376,22 +372,22 @@ Inspect changes on container `id`'s filesystem Export the contents of container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/export HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Start a container @@ -399,7 +395,7 @@ Export the contents of container `id` Start the container `id` - **Example request**: +**Example request**: POST /containers/(id)/start HTTP/1.1 Content-Type: application/json @@ -414,22 +410,22 @@ Start the container `id` "VolumesFrom": ["parent", "other:ro"] } - **Example response**: +**Example response**: - HTTP/1.1 204 No Content + HTTP/1.1 204 No Conten Content-Type: text/plain - Json Parameters: +Json Parameters:   - - **hostConfig** – the container's host configuration (optional) +- **hostConfig** – the container's host configuration (optional) - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Stop a container @@ -437,25 +433,25 @@ Start the container `id` Stop the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/stop?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Restart a container @@ -463,25 +459,25 @@ Stop the container `id` Restart the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/restart?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Kill a container @@ -489,24 +485,24 @@ Restart the container `id` Kill the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/kill HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters +Query Parameters - - **signal** - Signal to send to the container: integer or string like "SIGINT". +- **signal** - Signal to send to the container: integer or string like "SIGINT". When not set, SIGKILL is assumed and the call will waits for the container to exit. - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Attach to a container @@ -514,38 +510,38 @@ Kill the container `id` Attach to the container `id` - **Example request**: +**Example request**: POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **logs** – 1/True/true or 0/False/false, return logs. Default +- **logs** – 1/True/true or 0/False/false, return logs. Defaul false - - **stream** – 1/True/true or 0/False/false, return stream. +- **stream** – 1/True/true or 0/False/false, return stream. Default false - - **stdin** – 1/True/true or 0/False/false, if stream=true, attach +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false - - **stdout** – 1/True/true or 0/False/false, if logs=true, return +- **stdout** – 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false - - **stderr** – 1/True/true or 0/False/false, if logs=true, return +- **stderr** – 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error **Stream details**: @@ -570,9 +566,9 @@ Attach to the container `id` `STREAM_TYPE` can be: - - 0: stdin (will be written on stdout) - - 1: stdout - - 2: stderr +- 0: stdin (will be written on stdout) +- 1: stdou +- 2: stderr `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of the uint32 size encoded as big endian. @@ -588,7 +584,7 @@ Attach to the container `id` 1. Read 8 bytes 2. chose stdout or stderr depending on the first byte 3. Extract the frame size from the last 4 byets - 4. Read the extracted size and output it on the correct output + 4. Read the extracted size and output it on the correct outpu 5. Goto 1) ### Wait a container @@ -597,22 +593,22 @@ Attach to the container `id` Block until container `id` stops, then returns the exit code - **Example request**: +**Example request**: POST /containers/16253994b7c4/wait HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json {"StatusCode":0} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Remove a container @@ -620,29 +616,29 @@ Block until container `id` stops, then returns the exit code Remove the container `id` from the filesystem - **Example request**: +**Example request**: DELETE /containers/16253994b7c4?v=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **v** – 1/True/true or 0/False/false, Remove the volumes +- **v** – 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false - - **force** – 1/True/true or 0/False/false, Removes the container +- **force** – 1/True/true or 0/False/false, Removes the container even if it was running. Default false - Status Codes: +Status Codes: - - **204** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ### Copy files or folders from a container @@ -650,7 +646,7 @@ Remove the container `id` from the filesystem Copy files or folders of container `id` - **Example request**: +**Example request**: POST /containers/4fa6e0f0c678/copy HTTP/1.1 Content-Type: application/json @@ -659,18 +655,18 @@ Copy files or folders of container `id` "Resource":"test.txt" } - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ## 2.2 Images @@ -682,7 +678,7 @@ Copy files or folders of container `id` GET /images/json?all=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -716,13 +712,13 @@ Copy files or folders of container `id` `POST /images/create` -Create an image, either by pull it from the registry or by importing it +Create an image, either by pull it from the registry or by importing i - **Example request**: +**Example request**: POST /images/create?fromImage=base HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -736,26 +732,26 @@ Create an image, either by pull it from the registry or by importing it `X-Registry-Auth` header can be used to include a base64-encoded AuthConfig object. - Query Parameters: +Query Parameters:   - - **fromImage** – name of the image to pull - - **fromSrc** – source to import, - means stdin - - **repo** – repository - - **tag** – tag - - **registry** – the registry to pull from +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from Request Headers:   - - **X-Registry-Auth** – base64-encoded AuthConfig object +- **X-Registry-Auth** – base64-encoded AuthConfig objec - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Inspect an image @@ -763,11 +759,11 @@ Create an image, either by pull it from the registry or by importing it Return low-level information on the image `name` - **Example request**: +**Example request**: GET /images/base/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -801,11 +797,11 @@ Return low-level information on the image `name` "Size": 6824592 } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Get the history of an image @@ -813,11 +809,11 @@ Return low-level information on the image `name` Return the history of the image `name` - **Example request**: +**Example request**: GET /images/base/history HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -835,11 +831,11 @@ Return the history of the image `name` } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Push an image on the registry @@ -847,11 +843,11 @@ Return the history of the image `name` Push the image `name` on the registry - **Example request**: +**Example request**: POST /images/test/push HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -862,32 +858,32 @@ Push the image `name` on the registry ... If you wish to push an image on to a private registry, that image must already have been tagged - into a repository which references that registry host name and port. This repository name should + into a repository which references that registry host name and port. This repository name should then be used in the URL. This mirrors the flow of the CLI. - **Example request**: +**Example request**: - POST /images/registry.acme.com:5000/test/push HTTP/1.1 - + POST /images/registry.acme.com:5000/test/push HTTP/1.1 - Query Parameters: + +Query Parameters:   - - **tag** – the tag to associate with the image on the registry, optional +- **tag** – the tag to associate with the image on the registry, optional Request Headers:   - - **X-Registry-Auth** – include a base64-encoded AuthConfig +- **X-Registry-Auth** – include a base64-encoded AuthConfig object. - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Tag an image into a repository @@ -895,28 +891,28 @@ Push the image `name` on the registry Tag the image `name` into a repository - **Example request**: +**Example request**: POST /images/test/tag?repo=myrepo&force=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 201 OK - Query Parameters: +Query Parameters:   - - **repo** – The repository to tag in - - **force** – 1/True/true or 0/False/false, default false +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **201** – no error - - **400** – bad parameter - - **404** – no such image - - **409** – conflict - - **500** – server error +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflic +- **500** – server error ### Remove an image @@ -924,11 +920,11 @@ Tag the image `name` into a repository Remove the image `name` from the filesystem - **Example request**: +**Example request**: DELETE /images/test HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-type: application/json @@ -939,19 +935,19 @@ Remove the image `name` from the filesystem {"Deleted":"53b4f83ac9"} ] - Query Parameters: +Query Parameters:   - - **force** – 1/True/true or 0/False/false, default false - - **noprune** – 1/True/true or 0/False/false, default false +- **force** – 1/True/true or 0/False/false, default false +- **noprune** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **409** – conflict - - **500** – server error +- **200** – no error +- **404** – no such image +- **409** – conflic +- **500** – server error ### Search images @@ -963,11 +959,11 @@ Search for an image on [Docker Hub](https://hub.docker.com). > The response keys have changed from API v1.6 to reflect the JSON > sent by the registry server to the docker daemon's request. - **Example request**: +**Example request**: GET /images/search?term=sshd HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -997,16 +993,16 @@ Search for an image on [Docker Hub](https://hub.docker.com). ... ] - Query Parameters: +Query Parameters:   - - **term** – term to search +- **term** – term to search - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ## 2.3 Misc @@ -1016,13 +1012,13 @@ Search for an image on [Docker Hub](https://hub.docker.com). Build an image from Dockerfile via stdin - **Example request**: +**Example request**: POST /build HTTP/1.1 {{ TAR STREAM }} - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1039,28 +1035,28 @@ Build an image from Dockerfile via stdin which will be accessible in the build context (See the [*ADD build command*](/reference/builder/#dockerbuilder)). - Query Parameters: +Query Parameters:   - - **t** – repository name (and optionally a tag) to be applied to +- **t** – repository name (and optionally a tag) to be applied to the resulting image in case of success - - **q** – suppress verbose build output - - **nocache** – do not use the cache when building the image - - **rm** - remove intermediate containers after a successful build +- **q** – suppress verbose build outpu +- **nocache** – do not use the cache when building the image +- **rm** - remove intermediate containers after a successful build Request Headers:   - - **Content-type** – should be set to +- **Content-type** – should be set to `"application/tar"`. - - **X-Registry-Config** – base64-encoded ConfigFile object +- **X-Registry-Config** – base64-encoded ConfigFile objec - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Check auth configuration @@ -1068,7 +1064,7 @@ Build an image from Dockerfile via stdin Get the default username and email - **Example request**: +**Example request**: POST /auth HTTP/1.1 Content-Type: application/json @@ -1080,15 +1076,15 @@ Get the default username and email "serveraddress":"https://index.docker.io/v1/" } - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **204** – no error - - **500** – server error +- **200** – no error +- **204** – no error +- **500** – server error ### Display system-wide information @@ -1096,11 +1092,11 @@ Get the default username and email Display system-wide information - **Example request**: +**Example request**: GET /info HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1122,10 +1118,10 @@ Display system-wide information "IPv4Forwarding":true } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Show the docker version information @@ -1133,11 +1129,11 @@ Display system-wide information Show the docker version information - **Example request**: +**Example request**: GET /version HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1148,10 +1144,10 @@ Show the docker version information "GoVersion":"go1.0.3" } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Ping the docker server @@ -1159,20 +1155,20 @@ Show the docker version information Ping the docker server - **Example request**: +**Example request**: GET /_ping HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK OK - Status Codes: +Status Codes: - - **200** - no error - - **500** - server error +- **200** - no error +- **500** - server error ### Create a new image from a container's changes @@ -1180,7 +1176,7 @@ Ping the docker server Create a new image from a container's changes - **Example request**: +**Example request**: POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 Content-Type: application/json @@ -1211,35 +1207,35 @@ Create a new image from a container's changes } } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/vnd.docker.raw-stream {"Id":"596069db4bf5"} - Json Parameters: +Json Parameters: - - **config** - the container's configuration +- **config** - the container's configuration - Query Parameters: +Query Parameters:   - - **container** – source container - - **repo** – repository - - **tag** – tag - - **m** – commit message - - **author** – author (e.g., "John Hannibal Smith +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **500** – server error +- **201** – no error +- **404** – no such container +- **500** – server error ### Monitor Docker's events @@ -1248,11 +1244,11 @@ Create a new image from a container's changes Get events from docker, either in real time via streaming, or via polling (using since) - **Example request**: +**Example request**: GET /events?since=1374067924 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1262,17 +1258,17 @@ via polling (using since) {"status":"stop","id":"dfdf82bd3881","from":"base:latest","time":1374067966} {"status":"destroy","id":"dfdf82bd3881","from":"base:latest","time":1374067970} - Query Parameters: +Query Parameters:   - - **since** – timestamp used for polling - - **until** – timestamp used for polling +- **since** – timestamp used for polling +- **until** – timestamp used for polling - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Get a tarball containing all images and tags in a repository @@ -1281,21 +1277,21 @@ via polling (using since) Get a tarball containing all images and metadata for the repository specified by `name`. - **Example request** +**Example request** - GET /images/ubuntu/get + GET /images/ubuntu/ge - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/x-tar Binary data stream - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Load a tarball with a set of images and tags into docker @@ -1303,20 +1299,20 @@ specified by `name`. Load a set of images and tags into the docker repository. - **Example request** +**Example request** POST /images/load Tarball in body - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error # 3. Going further @@ -1327,17 +1323,17 @@ Here are the steps of `docker run`: - Create the container - If the status code is 404, it means the image doesn't exists: - - Try to pull it - - Then retry to create the container +- Try to pull i +- Then retry to create the container - Start the container - If you are not in detached mode: - - Attach to the container, using logs=1 (to have stdout and +- Attach to the container, using logs=1 (to have stdout and stderr from the container's start) and stream=1 - If in detached mode or only stdin is attached: - - Display the container's id +- Display the container's id ## 3.2 Hijacking diff --git a/docs/sources/reference/api/docker_remote_api_v1.12.md b/docs/sources/reference/api/docker_remote_api_v1.12.md index 3e78c62319..4f3eea5f64 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.12.md +++ b/docs/sources/reference/api/docker_remote_api_v1.12.md @@ -24,11 +24,11 @@ page_keywords: API, Docker, rcli, REST, documentation List containers - **Example request**: +**Example request**: GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -76,28 +76,26 @@ List containers } ] - Query Parameters: +Query Parameters: -   - - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default - - **limit** – Show `limit` last created +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul +- **limit** – Show `limit` last created containers, include non-running ones. - - **since** – Show only containers created since Id, include +- **since** – Show only containers created since Id, include non-running ones. - - **before** – Show only containers created before Id, include +- **before** – Show only containers created before Id, include non-running ones. - - **size** – 1/True/true or 0/False/false, Show the containers +- **size** – 1/True/true or 0/False/false, Show the containers sizes - - **filters** – a JSON encoded value of the filters (a map[string][]string) +- **filters** – a JSON encoded value of the filters (a map[string][]string) to process on the images list. - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create a container @@ -105,7 +103,7 @@ List containers Create a container - **Example request**: +**Example request**: POST /containers/create HTTP/1.1 Content-Type: application/json @@ -140,7 +138,7 @@ Create a container } } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/json @@ -150,25 +148,25 @@ Create a container "Warnings":[] } - Json Parameters: +Json Parameters:   - - **config** – the container's configuration +- **config** – the container's configuration - Query Parameters: +Query Parameters:   - - **name** – Assign the specified name to the container. Must +- **name** – Assign the specified name to the container. Mus match `/?[a-zA-Z0-9_-]+`. - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **406** – impossible to attach (container not running) - - **500** – server error +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error ### Inspect a container @@ -177,11 +175,11 @@ Create a container Return low-level information on the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -250,11 +248,11 @@ Return low-level information on the container `id` } } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### List processes running inside a container @@ -262,11 +260,11 @@ Return low-level information on the container `id` List processes running inside the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/top HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -291,17 +289,17 @@ List processes running inside the container `id` ] } - Query Parameters: +Query Parameters:   - - **ps_args** – ps arguments to use (e.g., aux) +- **ps_args** – ps arguments to use (e.g., aux) - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Get container logs @@ -309,35 +307,35 @@ List processes running inside the container `id` Get stdout and stderr logs from the container ``id`` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1×tamps=1&follow=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **follow** – 1/True/true or 0/False/false, return stream. +- **follow** – 1/True/true or 0/False/false, return stream. Default false - - **stdout** – 1/True/true or 0/False/false, if logs=true, return +- **stdout** – 1/True/true or 0/False/false, if logs=true, return stdout log. Default false - - **stderr** – 1/True/true or 0/False/false, if logs=true, return +- **stderr** – 1/True/true or 0/False/false, if logs=true, return stderr log. Default false - - **timestamps** – 1/True/true or 0/False/false, if logs=true, print +- **timestamps** – 1/True/true or 0/False/false, if logs=true, prin timestamps for every log line. Default false - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Inspect changes on a container's filesystem @@ -345,11 +343,11 @@ Get stdout and stderr logs from the container ``id`` Inspect changes on container `id`'s filesystem - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/changes HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -369,11 +367,11 @@ Inspect changes on container `id`'s filesystem } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Export a container @@ -381,22 +379,22 @@ Inspect changes on container `id`'s filesystem Export the contents of container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/export HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Start a container @@ -404,7 +402,7 @@ Export the contents of container `id` Start the container `id` - **Example request**: +**Example request**: POST /containers/(id)/start HTTP/1.1 Content-Type: application/json @@ -420,22 +418,22 @@ Start the container `id` "VolumesFrom": ["parent", "other:ro"] } - **Example response**: +**Example response**: - HTTP/1.1 204 No Content + HTTP/1.1 204 No Conten Content-Type: text/plain - Json Parameters: +Json Parameters:   - - **hostConfig** – the container's host configuration (optional) +- **hostConfig** – the container's host configuration (optional) - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Stop a container @@ -443,25 +441,25 @@ Start the container `id` Stop the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/stop?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Restart a container @@ -469,25 +467,25 @@ Stop the container `id` Restart the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/restart?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Kill a container @@ -495,24 +493,24 @@ Restart the container `id` Kill the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/kill HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters +Query Parameters - - **signal** - Signal to send to the container: integer or string like "SIGINT". +- **signal** - Signal to send to the container: integer or string like "SIGINT". When not set, SIGKILL is assumed and the call will waits for the container to exit. - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Pause a container @@ -520,19 +518,19 @@ Kill the container `id` Pause the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/pause HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Unpause a container @@ -540,19 +538,19 @@ Pause the container `id` Unpause the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/unpause HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Attach to a container @@ -560,38 +558,38 @@ Unpause the container `id` Attach to the container `id` - **Example request**: +**Example request**: POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **logs** – 1/True/true or 0/False/false, return logs. Default +- **logs** – 1/True/true or 0/False/false, return logs. Defaul false - - **stream** – 1/True/true or 0/False/false, return stream. +- **stream** – 1/True/true or 0/False/false, return stream. Default false - - **stdin** – 1/True/true or 0/False/false, if stream=true, attach +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false - - **stdout** – 1/True/true or 0/False/false, if logs=true, return +- **stdout** – 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false - - **stderr** – 1/True/true or 0/False/false, if logs=true, return +- **stderr** – 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error **Stream details**: @@ -616,9 +614,9 @@ Attach to the container `id` `STREAM_TYPE` can be: - - 0: stdin (will be written on stdout) - - 1: stdout - - 2: stderr +- 0: stdin (will be written on stdout) +- 1: stdou +- 2: stderr `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of the uint32 size encoded as big endian. @@ -634,7 +632,7 @@ Attach to the container `id` 1. Read 8 bytes 2. chose stdout or stderr depending on the first byte 3. Extract the frame size from the last 4 byets - 4. Read the extracted size and output it on the correct output + 4. Read the extracted size and output it on the correct outpu 5. Goto 1) ### Wait a container @@ -643,22 +641,22 @@ Attach to the container `id` Block until container `id` stops, then returns the exit code - **Example request**: +**Example request**: POST /containers/16253994b7c4/wait HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json {"StatusCode":0} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Remove a container @@ -666,29 +664,29 @@ Block until container `id` stops, then returns the exit code Remove the container `id` from the filesystem - **Example request**: +**Example request**: DELETE /containers/16253994b7c4?v=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **v** – 1/True/true or 0/False/false, Remove the volumes +- **v** – 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false - - **force** – 1/True/true or 0/False/false, Removes the container +- **force** – 1/True/true or 0/False/false, Removes the container even if it was running. Default false - Status Codes: +Status Codes: - - **204** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ### Copy files or folders from a container @@ -696,7 +694,7 @@ Remove the container `id` from the filesystem Copy files or folders of container `id` - **Example request**: +**Example request**: POST /containers/4fa6e0f0c678/copy HTTP/1.1 Content-Type: application/json @@ -705,18 +703,18 @@ Copy files or folders of container `id` "Resource":"test.txt" } - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ## 2.2 Images @@ -728,7 +726,7 @@ Copy files or folders of container `id` GET /images/json?all=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -759,12 +757,12 @@ Copy files or folders of container `id` ] - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, default false - - **filters** – a JSON encoded value of the filters (a map[string][]string) to process on the images list. +- **all** – 1/True/true or 0/False/false, default false +- **filters** – a JSON encoded value of the filters (a map[string][]string) to process on the images list. @@ -772,13 +770,13 @@ Copy files or folders of container `id` `POST /images/create` -Create an image, either by pull it from the registry or by importing it +Create an image, either by pull it from the registry or by importing i - **Example request**: +**Example request**: POST /images/create?fromImage=base HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -792,26 +790,26 @@ Create an image, either by pull it from the registry or by importing it `X-Registry-Auth` header can be used to include a base64-encoded AuthConfig object. - Query Parameters: +Query Parameters:   - - **fromImage** – name of the image to pull - - **fromSrc** – source to import, - means stdin - - **repo** – repository - - **tag** – tag - - **registry** – the registry to pull from +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from Request Headers:   - - **X-Registry-Auth** – base64-encoded AuthConfig object +- **X-Registry-Auth** – base64-encoded AuthConfig objec - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error @@ -821,11 +819,11 @@ Create an image, either by pull it from the registry or by importing it Return low-level information on the image `name` - **Example request**: +**Example request**: GET /images/base/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -859,11 +857,11 @@ Return low-level information on the image `name` "Size": 6824592 } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Get the history of an image @@ -871,11 +869,11 @@ Return low-level information on the image `name` Return the history of the image `name` - **Example request**: +**Example request**: GET /images/base/history HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -893,11 +891,11 @@ Return the history of the image `name` } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Push an image on the registry @@ -905,11 +903,11 @@ Return the history of the image `name` Push the image `name` on the registry - **Example request**: +**Example request**: POST /images/test/push HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -920,32 +918,32 @@ Push the image `name` on the registry ... If you wish to push an image on to a private registry, that image must already have been tagged - into a repository which references that registry host name and port. This repository name should + into a repository which references that registry host name and port. This repository name should then be used in the URL. This mirrors the flow of the CLI. - **Example request**: +**Example request**: - POST /images/registry.acme.com:5000/test/push HTTP/1.1 - + POST /images/registry.acme.com:5000/test/push HTTP/1.1 - Query Parameters: + +Query Parameters:   - - **tag** – the tag to associate with the image on the registry, optional +- **tag** – the tag to associate with the image on the registry, optional Request Headers:   - - **X-Registry-Auth** – include a base64-encoded AuthConfig +- **X-Registry-Auth** – include a base64-encoded AuthConfig object. - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Tag an image into a repository @@ -953,28 +951,28 @@ Push the image `name` on the registry Tag the image `name` into a repository - **Example request**: +**Example request**: POST /images/test/tag?repo=myrepo&force=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 201 OK - Query Parameters: +Query Parameters:   - - **repo** – The repository to tag in - - **force** – 1/True/true or 0/False/false, default false +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **201** – no error - - **400** – bad parameter - - **404** – no such image - - **409** – conflict - - **500** – server error +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflic +- **500** – server error ### Remove an image @@ -982,11 +980,11 @@ Tag the image `name` into a repository Remove the image `name` from the filesystem - **Example request**: +**Example request**: DELETE /images/test HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-type: application/json @@ -997,19 +995,19 @@ Remove the image `name` from the filesystem {"Deleted":"53b4f83ac9"} ] - Query Parameters: +Query Parameters:   - - **force** – 1/True/true or 0/False/false, default false - - **noprune** – 1/True/true or 0/False/false, default false +- **force** – 1/True/true or 0/False/false, default false +- **noprune** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **409** – conflict - - **500** – server error +- **200** – no error +- **404** – no such image +- **409** – conflic +- **500** – server error ### Search images @@ -1021,11 +1019,11 @@ Search for an image on [Docker Hub](https://hub.docker.com). > The response keys have changed from API v1.6 to reflect the JSON > sent by the registry server to the docker daemon's request. - **Example request**: +**Example request**: GET /images/search?term=sshd HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1055,16 +1053,16 @@ Search for an image on [Docker Hub](https://hub.docker.com). ... ] - Query Parameters: +Query Parameters:   - - **term** – term to search +- **term** – term to search - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ## 2.3 Misc @@ -1074,13 +1072,13 @@ Search for an image on [Docker Hub](https://hub.docker.com). Build an image from Dockerfile via stdin - **Example request**: +**Example request**: POST /build HTTP/1.1 {{ TAR STREAM }} - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1097,29 +1095,29 @@ Build an image from Dockerfile via stdin which will be accessible in the build context (See the [*ADD build command*](/reference/builder/#dockerbuilder)). - Query Parameters: +Query Parameters:   - - **t** – repository name (and optionally a tag) to be applied to +- **t** – repository name (and optionally a tag) to be applied to the resulting image in case of success - - **q** – suppress verbose build output - - **nocache** – do not use the cache when building the image - - **rm** - remove intermediate containers after a successful build (default behavior) - - **forcerm - always remove intermediate containers (includes rm) +- **q** – suppress verbose build outpu +- **nocache** – do not use the cache when building the image +- **rm** - remove intermediate containers after a successful build (default behavior) +- **forcerm - always remove intermediate containers (includes rm) Request Headers:   - - **Content-type** – should be set to +- **Content-type** – should be set to `"application/tar"`. - - **X-Registry-Config** – base64-encoded ConfigFile object +- **X-Registry-Config** – base64-encoded ConfigFile objec - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Check auth configuration @@ -1127,7 +1125,7 @@ Build an image from Dockerfile via stdin Get the default username and email - **Example request**: +**Example request**: POST /auth HTTP/1.1 Content-Type: application/json @@ -1139,15 +1137,15 @@ Get the default username and email "serveraddress":"https://index.docker.io/v1/" } - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **204** – no error - - **500** – server error +- **200** – no error +- **204** – no error +- **500** – server error ### Display system-wide information @@ -1155,11 +1153,11 @@ Get the default username and email Display system-wide information - **Example request**: +**Example request**: GET /info HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1181,10 +1179,10 @@ Display system-wide information "IPv4Forwarding":true } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Show the docker version information @@ -1192,11 +1190,11 @@ Display system-wide information Show the docker version information - **Example request**: +**Example request**: GET /version HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1208,10 +1206,10 @@ Show the docker version information "GoVersion":"go1.0.3" } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Ping the docker server @@ -1219,20 +1217,20 @@ Show the docker version information Ping the docker server - **Example request**: +**Example request**: GET /_ping HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK OK - Status Codes: +Status Codes: - - **200** - no error - - **500** - server error +- **200** - no error +- **500** - server error ### Create a new image from a container's changes @@ -1240,7 +1238,7 @@ Ping the docker server Create a new image from a container's changes - **Example request**: +**Example request**: POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 Content-Type: application/json @@ -1274,35 +1272,35 @@ Create a new image from a container's changes } } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/vnd.docker.raw-stream {"Id":"596069db4bf5"} - Json Parameters: +Json Parameters: - - **config** - the container's configuration +- **config** - the container's configuration - Query Parameters: +Query Parameters:   - - **container** – source container - - **repo** – repository - - **tag** – tag - - **m** – commit message - - **author** – author (e.g., "John Hannibal Smith +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **500** – server error +- **201** – no error +- **404** – no such container +- **500** – server error ### Monitor Docker's events @@ -1311,11 +1309,11 @@ Create a new image from a container's changes Get events from docker, either in real time via streaming, or via polling (using since) - **Example request**: +**Example request**: GET /events?since=1374067924 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1325,17 +1323,17 @@ via polling (using since) {"status":"stop","id":"dfdf82bd3881","from":"base:latest","time":1374067966} {"status":"destroy","id":"dfdf82bd3881","from":"base:latest","time":1374067970} - Query Parameters: +Query Parameters:   - - **since** – timestamp used for polling - - **until** – timestamp used for polling +- **since** – timestamp used for polling +- **until** – timestamp used for polling - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Get a tarball containing all images and tags in a repository @@ -1344,21 +1342,21 @@ via polling (using since) Get a tarball containing all images and metadata for the repository specified by `name`. - **Example request** +**Example request** - GET /images/ubuntu/get + GET /images/ubuntu/ge - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/x-tar Binary data stream - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Load a tarball with a set of images and tags into docker @@ -1366,20 +1364,20 @@ specified by `name`. Load a set of images and tags into the docker repository. - **Example request** +**Example request** POST /images/load Tarball in body - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error # 3. Going further @@ -1390,17 +1388,17 @@ Here are the steps of `docker run`: - Create the container - If the status code is 404, it means the image doesn't exists: - - Try to pull it - - Then retry to create the container +- Try to pull i +- Then retry to create the container - Start the container - If you are not in detached mode: - - Attach to the container, using logs=1 (to have stdout and +- Attach to the container, using logs=1 (to have stdout and stderr from the container's start) and stream=1 - If in detached mode or only stdin is attached: - - Display the container's id +- Display the container's id ## 3.2 Hijacking diff --git a/docs/sources/reference/api/docker_remote_api_v1.13.md b/docs/sources/reference/api/docker_remote_api_v1.13.md index 143ef66310..8161161c5f 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.13.md +++ b/docs/sources/reference/api/docker_remote_api_v1.13.md @@ -24,11 +24,11 @@ page_keywords: API, Docker, rcli, REST, documentation List containers - **Example request**: +**Example request**: GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -76,26 +76,24 @@ List containers } ] - Query Parameters: +Query Parameters: -   - - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default - - **limit** – Show `limit` last created +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul +- **limit** – Show `limit` last created containers, include non-running ones. - - **since** – Show only containers created since Id, include +- **since** – Show only containers created since Id, include non-running ones. - - **before** – Show only containers created before Id, include +- **before** – Show only containers created before Id, include non-running ones. - - **size** – 1/True/true or 0/False/false, Show the containers +- **size** – 1/True/true or 0/False/false, Show the containers sizes - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create a container @@ -103,7 +101,7 @@ List containers Create a container - **Example request**: +**Example request**: POST /containers/create HTTP/1.1 Content-Type: application/json @@ -138,7 +136,7 @@ Create a container } } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/json @@ -148,25 +146,25 @@ Create a container "Warnings":[] } - Json Parameters: +Json Parameters:   - - **config** – the container's configuration +- **config** – the container's configuration - Query Parameters: +Query Parameters:   - - **name** – Assign the specified name to the container. Must +- **name** – Assign the specified name to the container. Mus match `/?[a-zA-Z0-9_-]+`. - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **406** – impossible to attach (container not running) - - **500** – server error +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error ### Inspect a container @@ -175,11 +173,11 @@ Create a container Return low-level information on the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -248,11 +246,11 @@ Return low-level information on the container `id` } } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### List processes running inside a container @@ -260,11 +258,11 @@ Return low-level information on the container `id` List processes running inside the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/top HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -289,17 +287,17 @@ List processes running inside the container `id` ] } - Query Parameters: +Query Parameters:   - - **ps_args** – ps arguments to use (e.g., aux) +- **ps_args** – ps arguments to use (e.g., aux) - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Get container logs @@ -307,33 +305,33 @@ List processes running inside the container `id` Get stdout and stderr logs from the container ``id`` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1×tamps=1&follow=1&tail=10 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **follow** – 1/True/true or 0/False/false, return stream. Default false - - **stdout** – 1/True/true or 0/False/false, show stdout log. Default false - - **stderr** – 1/True/true or 0/False/false, show stderr log. Default false - - **timestamps** – 1/True/true or 0/False/false, print timestamps for +- **follow** – 1/True/true or 0/False/false, return stream. Default false +- **stdout** – 1/True/true or 0/False/false, show stdout log. Default false +- **stderr** – 1/True/true or 0/False/false, show stderr log. Default false +- **timestamps** – 1/True/true or 0/False/false, print timestamps for every log line. Default false - - **tail** – Output specified number of lines at the end of logs: `all` or ``. Default all +- **tail** – Output specified number of lines at the end of logs: `all` or ``. Default all - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Inspect changes on a container's filesystem @@ -341,11 +339,11 @@ Get stdout and stderr logs from the container ``id`` Inspect changes on container `id`'s filesystem - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/changes HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -365,11 +363,11 @@ Inspect changes on container `id`'s filesystem } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Export a container @@ -377,22 +375,22 @@ Inspect changes on container `id`'s filesystem Export the contents of container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/export HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Start a container @@ -400,7 +398,7 @@ Export the contents of container `id` Start the container `id` - **Example request**: +**Example request**: POST /containers/(id)/start HTTP/1.1 Content-Type: application/json @@ -416,23 +414,23 @@ Start the container `id` "VolumesFrom": ["parent", "other:ro"] } - **Example response**: +**Example response**: - HTTP/1.1 204 No Content + HTTP/1.1 204 No Conten Content-Type: text/plain - Json Parameters: +Json Parameters:   - - **hostConfig** – the container's host configuration (optional) +- **hostConfig** – the container's host configuration (optional) - Status Codes: +Status Codes: - - **204** – no error - - **304** – container already started - - **404** – no such container - - **500** – server error +- **204** – no error +- **304** – container already started +- **404** – no such container +- **500** – server error ### Stop a container @@ -440,26 +438,26 @@ Start the container `id` Stop the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/stop?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **304** – container already stopped - - **404** – no such container - - **500** – server error +- **204** – no error +- **304** – container already stopped +- **404** – no such container +- **500** – server error ### Restart a container @@ -467,25 +465,25 @@ Stop the container `id` Restart the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/restart?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Kill a container @@ -493,24 +491,24 @@ Restart the container `id` Kill the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/kill HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters +Query Parameters - - **signal** - Signal to send to the container: integer or string like "SIGINT". +- **signal** - Signal to send to the container: integer or string like "SIGINT". When not set, SIGKILL is assumed and the call will waits for the container to exit. - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Pause a container @@ -518,19 +516,19 @@ Kill the container `id` Pause the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/pause HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Unpause a container @@ -538,19 +536,19 @@ Pause the container `id` Unpause the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/unpause HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Attach to a container @@ -558,38 +556,38 @@ Unpause the container `id` Attach to the container `id` - **Example request**: +**Example request**: POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **logs** – 1/True/true or 0/False/false, return logs. Default +- **logs** – 1/True/true or 0/False/false, return logs. Defaul false - - **stream** – 1/True/true or 0/False/false, return stream. +- **stream** – 1/True/true or 0/False/false, return stream. Default false - - **stdin** – 1/True/true or 0/False/false, if stream=true, attach +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false - - **stdout** – 1/True/true or 0/False/false, if logs=true, return +- **stdout** – 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false - - **stderr** – 1/True/true or 0/False/false, if logs=true, return +- **stderr** – 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error **Stream details**: @@ -614,9 +612,9 @@ Attach to the container `id` `STREAM_TYPE` can be: - - 0: stdin (will be written on stdout) - - 1: stdout - - 2: stderr +- 0: stdin (will be written on stdout) +- 1: stdou +- 2: stderr `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of the uint32 size encoded as big endian. @@ -632,7 +630,7 @@ Attach to the container `id` 1. Read 8 bytes 2. chose stdout or stderr depending on the first byte 3. Extract the frame size from the last 4 byets - 4. Read the extracted size and output it on the correct output + 4. Read the extracted size and output it on the correct outpu 5. Goto 1) ### Wait a container @@ -641,22 +639,22 @@ Attach to the container `id` Block until container `id` stops, then returns the exit code - **Example request**: +**Example request**: POST /containers/16253994b7c4/wait HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json {"StatusCode":0} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Remove a container @@ -664,29 +662,29 @@ Block until container `id` stops, then returns the exit code Remove the container `id` from the filesystem - **Example request**: +**Example request**: DELETE /containers/16253994b7c4?v=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **v** – 1/True/true or 0/False/false, Remove the volumes +- **v** – 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false - - **force** – 1/True/true or 0/False/false, Removes the container +- **force** – 1/True/true or 0/False/false, Removes the container even if it was running. Default false - Status Codes: +Status Codes: - - **204** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ### Copy files or folders from a container @@ -694,7 +692,7 @@ Remove the container `id` from the filesystem Copy files or folders of container `id` - **Example request**: +**Example request**: POST /containers/4fa6e0f0c678/copy HTTP/1.1 Content-Type: application/json @@ -703,18 +701,18 @@ Copy files or folders of container `id` "Resource":"test.txt" } - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ## 2.2 Images @@ -726,7 +724,7 @@ Copy files or folders of container `id` GET /images/json?all=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -757,12 +755,12 @@ Copy files or folders of container `id` ] - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, default false - - **filters** – a json encoded value of the filters (a map[string][]string) to process on the images list. +- **all** – 1/True/true or 0/False/false, default false +- **filters** – a json encoded value of the filters (a map[string][]string) to process on the images list. @@ -770,13 +768,13 @@ Copy files or folders of container `id` `POST /images/create` -Create an image, either by pull it from the registry or by importing it +Create an image, either by pull it from the registry or by importing i - **Example request**: +**Example request**: POST /images/create?fromImage=base HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -790,26 +788,26 @@ Create an image, either by pull it from the registry or by importing it `X-Registry-Auth` header can be used to include a base64-encoded AuthConfig object. - Query Parameters: +Query Parameters:   - - **fromImage** – name of the image to pull - - **fromSrc** – source to import, - means stdin - - **repo** – repository - - **tag** – tag - - **registry** – the registry to pull from +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from Request Headers:   - - **X-Registry-Auth** – base64-encoded AuthConfig object +- **X-Registry-Auth** – base64-encoded AuthConfig objec - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error @@ -819,11 +817,11 @@ Create an image, either by pull it from the registry or by importing it Return low-level information on the image `name` - **Example request**: +**Example request**: GET /images/base/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -857,11 +855,11 @@ Return low-level information on the image `name` "Size": 6824592 } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Get the history of an image @@ -869,11 +867,11 @@ Return low-level information on the image `name` Return the history of the image `name` - **Example request**: +**Example request**: GET /images/base/history HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -891,11 +889,11 @@ Return the history of the image `name` } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Push an image on the registry @@ -903,11 +901,11 @@ Return the history of the image `name` Push the image `name` on the registry - **Example request**: +**Example request**: POST /images/test/push HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -918,32 +916,32 @@ Push the image `name` on the registry ... If you wish to push an image on to a private registry, that image must already have been tagged - into a repository which references that registry host name and port. This repository name should + into a repository which references that registry host name and port. This repository name should then be used in the URL. This mirrors the flow of the CLI. - **Example request**: +**Example request**: - POST /images/registry.acme.com:5000/test/push HTTP/1.1 - + POST /images/registry.acme.com:5000/test/push HTTP/1.1 - Query Parameters: + +Query Parameters:   - - **tag** – the tag to associate with the image on the registry, optional +- **tag** – the tag to associate with the image on the registry, optional Request Headers:   - - **X-Registry-Auth** – include a base64-encoded AuthConfig +- **X-Registry-Auth** – include a base64-encoded AuthConfig object. - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Tag an image into a repository @@ -951,28 +949,28 @@ Push the image `name` on the registry Tag the image `name` into a repository - **Example request**: +**Example request**: POST /images/test/tag?repo=myrepo&force=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 201 OK - Query Parameters: +Query Parameters:   - - **repo** – The repository to tag in - - **force** – 1/True/true or 0/False/false, default false +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **201** – no error - - **400** – bad parameter - - **404** – no such image - - **409** – conflict - - **500** – server error +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflic +- **500** – server error ### Remove an image @@ -980,11 +978,11 @@ Tag the image `name` into a repository Remove the image `name` from the filesystem - **Example request**: +**Example request**: DELETE /images/test HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-type: application/json @@ -995,19 +993,19 @@ Remove the image `name` from the filesystem {"Deleted":"53b4f83ac9"} ] - Query Parameters: +Query Parameters:   - - **force** – 1/True/true or 0/False/false, default false - - **noprune** – 1/True/true or 0/False/false, default false +- **force** – 1/True/true or 0/False/false, default false +- **noprune** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **409** – conflict - - **500** – server error +- **200** – no error +- **404** – no such image +- **409** – conflic +- **500** – server error ### Search images @@ -1019,11 +1017,11 @@ Search for an image on [Docker Hub](https://hub.docker.com). > The response keys have changed from API v1.6 to reflect the JSON > sent by the registry server to the docker daemon's request. - **Example request**: +**Example request**: GET /images/search?term=sshd HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1053,16 +1051,16 @@ Search for an image on [Docker Hub](https://hub.docker.com). ... ] - Query Parameters: +Query Parameters:   - - **term** – term to search +- **term** – term to search - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ## 2.3 Misc @@ -1072,13 +1070,13 @@ Search for an image on [Docker Hub](https://hub.docker.com). Build an image from Dockerfile via stdin - **Example request**: +**Example request**: POST /build HTTP/1.1 {{ TAR STREAM }} - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1095,29 +1093,29 @@ Build an image from Dockerfile via stdin which will be accessible in the build context (See the [*ADD build command*](/reference/builder/#dockerbuilder)). - Query Parameters: +Query Parameters:   - - **t** – repository name (and optionally a tag) to be applied to +- **t** – repository name (and optionally a tag) to be applied to the resulting image in case of success - - **q** – suppress verbose build output - - **nocache** – do not use the cache when building the image - - **rm** - remove intermediate containers after a successful build (default behavior) - - **forcerm - always remove intermediate containers (includes rm) +- **q** – suppress verbose build outpu +- **nocache** – do not use the cache when building the image +- **rm** - remove intermediate containers after a successful build (default behavior) +- **forcerm - always remove intermediate containers (includes rm) Request Headers:   - - **Content-type** – should be set to +- **Content-type** – should be set to `"application/tar"`. - - **X-Registry-Config** – base64-encoded ConfigFile object +- **X-Registry-Config** – base64-encoded ConfigFile objec - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Check auth configuration @@ -1125,7 +1123,7 @@ Build an image from Dockerfile via stdin Get the default username and email - **Example request**: +**Example request**: POST /auth HTTP/1.1 Content-Type: application/json @@ -1137,15 +1135,15 @@ Get the default username and email "serveraddress":"https://index.docker.io/v1/" } - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **204** – no error - - **500** – server error +- **200** – no error +- **204** – no error +- **500** – server error ### Display system-wide information @@ -1153,11 +1151,11 @@ Get the default username and email Display system-wide information - **Example request**: +**Example request**: GET /info HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1179,10 +1177,10 @@ Display system-wide information "IPv4Forwarding":true } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Show the docker version information @@ -1190,11 +1188,11 @@ Display system-wide information Show the docker version information - **Example request**: +**Example request**: GET /version HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1206,10 +1204,10 @@ Show the docker version information "GoVersion":"go1.0.3" } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Ping the docker server @@ -1217,20 +1215,20 @@ Show the docker version information Ping the docker server - **Example request**: +**Example request**: GET /_ping HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK OK - Status Codes: +Status Codes: - - **200** - no error - - **500** - server error +- **200** - no error +- **500** - server error ### Create a new image from a container's changes @@ -1238,7 +1236,7 @@ Ping the docker server Create a new image from a container's changes - **Example request**: +**Example request**: POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 Content-Type: application/json @@ -1272,35 +1270,35 @@ Create a new image from a container's changes } } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/vnd.docker.raw-stream {"Id":"596069db4bf5"} - Json Parameters: +Json Parameters: - - **config** - the container's configuration +- **config** - the container's configuration - Query Parameters: +Query Parameters:   - - **container** – source container - - **repo** – repository - - **tag** – tag - - **m** – commit message - - **author** – author (e.g., "John Hannibal Smith +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **500** – server error +- **201** – no error +- **404** – no such container +- **500** – server error ### Monitor Docker's events @@ -1309,11 +1307,11 @@ Create a new image from a container's changes Get events from docker, either in real time via streaming, or via polling (using since) - **Example request**: +**Example request**: GET /events?since=1374067924 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1323,17 +1321,17 @@ via polling (using since) {"status":"stop","id":"dfdf82bd3881","from":"base:latest","time":1374067966} {"status":"destroy","id":"dfdf82bd3881","from":"base:latest","time":1374067970} - Query Parameters: +Query Parameters:   - - **since** – timestamp used for polling - - **until** – timestamp used for polling +- **since** – timestamp used for polling +- **until** – timestamp used for polling - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Get a tarball containing all images and tags in a repository @@ -1342,21 +1340,21 @@ via polling (using since) Get a tarball containing all images and metadata for the repository specified by `name`. - **Example request** +**Example request** - GET /images/ubuntu/get + GET /images/ubuntu/ge - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/x-tar Binary data stream - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Load a tarball with a set of images and tags into docker @@ -1364,20 +1362,20 @@ specified by `name`. Load a set of images and tags into the docker repository. - **Example request** +**Example request** POST /images/load Tarball in body - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error # 3. Going further @@ -1388,17 +1386,17 @@ Here are the steps of `docker run`: - Create the container - If the status code is 404, it means the image doesn't exists: - - Try to pull it - - Then retry to create the container +- Try to pull i +- Then retry to create the container - Start the container - If you are not in detached mode: - - Attach to the container, using logs=1 (to have stdout and +- Attach to the container, using logs=1 (to have stdout and stderr from the container's start) and stream=1 - If in detached mode or only stdin is attached: - - Display the container's id +- Display the container's id ## 3.2 Hijacking diff --git a/docs/sources/reference/api/docker_remote_api_v1.14.md b/docs/sources/reference/api/docker_remote_api_v1.14.md index 92ba9f799a..e0d8f85396 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.14.md +++ b/docs/sources/reference/api/docker_remote_api_v1.14.md @@ -24,11 +24,11 @@ page_keywords: API, Docker, rcli, REST, documentation List containers - **Example request**: +**Example request**: GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -76,26 +76,24 @@ List containers } ] - Query Parameters: +Query Parameters: -   - - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default - - **limit** – Show `limit` last created +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul +- **limit** – Show `limit` last created containers, include non-running ones. - - **since** – Show only containers created since Id, include +- **since** – Show only containers created since Id, include non-running ones. - - **before** – Show only containers created before Id, include +- **before** – Show only containers created before Id, include non-running ones. - - **size** – 1/True/true or 0/False/false, Show the containers +- **size** – 1/True/true or 0/False/false, Show the containers sizes - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create a container @@ -103,7 +101,7 @@ List containers Create a container - **Example request**: +**Example request**: POST /containers/create HTTP/1.1 Content-Type: application/json @@ -138,7 +136,7 @@ Create a container } } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/json @@ -148,25 +146,25 @@ Create a container "Warnings":[] } - Json Parameters: +Json Parameters:   - - **config** – the container's configuration +- **config** – the container's configuration - Query Parameters: +Query Parameters:   - - **name** – Assign the specified name to the container. Must +- **name** – Assign the specified name to the container. Mus match `/?[a-zA-Z0-9_-]+`. - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **406** – impossible to attach (container not running) - - **500** – server error +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error ### Inspect a container @@ -175,11 +173,11 @@ Create a container Return low-level information on the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -250,11 +248,11 @@ Return low-level information on the container `id` } } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### List processes running inside a container @@ -262,11 +260,11 @@ Return low-level information on the container `id` List processes running inside the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/top HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -291,17 +289,17 @@ List processes running inside the container `id` ] } - Query Parameters: +Query Parameters:   - - **ps_args** – ps arguments to use (e.g., aux) +- **ps_args** – ps arguments to use (e.g., aux) - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Get container logs @@ -309,33 +307,33 @@ List processes running inside the container `id` Get stdout and stderr logs from the container ``id`` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1×tamps=1&follow=1&tail=10 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **follow** – 1/True/true or 0/False/false, return stream. Default false - - **stdout** – 1/True/true or 0/False/false, show stdout log. Default false - - **stderr** – 1/True/true or 0/False/false, show stderr log. Default false - - **timestamps** – 1/True/true or 0/False/false, print timestamps for +- **follow** – 1/True/true or 0/False/false, return stream. Default false +- **stdout** – 1/True/true or 0/False/false, show stdout log. Default false +- **stderr** – 1/True/true or 0/False/false, show stderr log. Default false +- **timestamps** – 1/True/true or 0/False/false, print timestamps for every log line. Default false - - **tail** – Output specified number of lines at the end of logs: `all` or ``. Default all +- **tail** – Output specified number of lines at the end of logs: `all` or ``. Default all - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Inspect changes on a container's filesystem @@ -343,11 +341,11 @@ Get stdout and stderr logs from the container ``id`` Inspect changes on container `id`'s filesystem - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/changes HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -367,11 +365,11 @@ Inspect changes on container `id`'s filesystem } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Export a container @@ -379,22 +377,22 @@ Inspect changes on container `id`'s filesystem Export the contents of container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/export HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Start a container @@ -402,7 +400,7 @@ Export the contents of container `id` Start the container `id` - **Example request**: +**Example request**: POST /containers/(id)/start HTTP/1.1 Content-Type: application/json @@ -420,23 +418,23 @@ Start the container `id` "CapDrop: ["MKNOD"] } - **Example response**: +**Example response**: - HTTP/1.1 204 No Content + HTTP/1.1 204 No Conten Content-Type: text/plain - Json Parameters: +Json Parameters:   - - **hostConfig** – the container's host configuration (optional) +- **hostConfig** – the container's host configuration (optional) - Status Codes: +Status Codes: - - **204** – no error - - **304** – container already started - - **404** – no such container - - **500** – server error +- **204** – no error +- **304** – container already started +- **404** – no such container +- **500** – server error ### Stop a container @@ -444,26 +442,26 @@ Start the container `id` Stop the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/stop?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **304** – container already stopped - - **404** – no such container - - **500** – server error +- **204** – no error +- **304** – container already stopped +- **404** – no such container +- **500** – server error ### Restart a container @@ -471,25 +469,25 @@ Stop the container `id` Restart the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/restart?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Kill a container @@ -497,24 +495,24 @@ Restart the container `id` Kill the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/kill HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters +Query Parameters - - **signal** - Signal to send to the container: integer or string like "SIGINT". +- **signal** - Signal to send to the container: integer or string like "SIGINT". When not set, SIGKILL is assumed and the call will waits for the container to exit. - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Pause a container @@ -522,19 +520,19 @@ Kill the container `id` Pause the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/pause HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Unpause a container @@ -542,19 +540,19 @@ Pause the container `id` Unpause the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/unpause HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Attach to a container @@ -562,38 +560,38 @@ Unpause the container `id` Attach to the container `id` - **Example request**: +**Example request**: POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **logs** – 1/True/true or 0/False/false, return logs. Default +- **logs** – 1/True/true or 0/False/false, return logs. Defaul false - - **stream** – 1/True/true or 0/False/false, return stream. +- **stream** – 1/True/true or 0/False/false, return stream. Default false - - **stdin** – 1/True/true or 0/False/false, if stream=true, attach +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false - - **stdout** – 1/True/true or 0/False/false, if logs=true, return +- **stdout** – 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false - - **stderr** – 1/True/true or 0/False/false, if logs=true, return +- **stderr** – 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error **Stream details**: @@ -618,9 +616,9 @@ Attach to the container `id` `STREAM_TYPE` can be: - - 0: stdin (will be written on stdout) - - 1: stdout - - 2: stderr +- 0: stdin (will be written on stdout) +- 1: stdou +- 2: stderr `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of the uint32 size encoded as big endian. @@ -636,7 +634,7 @@ Attach to the container `id` 1. Read 8 bytes 2. chose stdout or stderr depending on the first byte 3. Extract the frame size from the last 4 byets - 4. Read the extracted size and output it on the correct output + 4. Read the extracted size and output it on the correct outpu 5. Goto 1) ### Wait a container @@ -645,22 +643,22 @@ Attach to the container `id` Block until container `id` stops, then returns the exit code - **Example request**: +**Example request**: POST /containers/16253994b7c4/wait HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json {"StatusCode":0} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Remove a container @@ -668,29 +666,29 @@ Block until container `id` stops, then returns the exit code Remove the container `id` from the filesystem - **Example request**: +**Example request**: DELETE /containers/16253994b7c4?v=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **v** – 1/True/true or 0/False/false, Remove the volumes +- **v** – 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false - - **force** - 1/True/true or 0/False/false, Kill then remove the container. +- **force** - 1/True/true or 0/False/false, Kill then remove the container. Default false - Status Codes: +Status Codes: - - **204** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ### Copy files or folders from a container @@ -698,7 +696,7 @@ Remove the container `id` from the filesystem Copy files or folders of container `id` - **Example request**: +**Example request**: POST /containers/4fa6e0f0c678/copy HTTP/1.1 Content-Type: application/json @@ -707,18 +705,18 @@ Copy files or folders of container `id` "Resource":"test.txt" } - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ## 2.2 Images @@ -730,7 +728,7 @@ Copy files or folders of container `id` GET /images/json?all=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -761,12 +759,12 @@ Copy files or folders of container `id` ] - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, default false - - **filters** – a json encoded value of the filters (a map[string][]string) to process on the images list. +- **all** – 1/True/true or 0/False/false, default false +- **filters** – a json encoded value of the filters (a map[string][]string) to process on the images list. @@ -774,13 +772,13 @@ Copy files or folders of container `id` `POST /images/create` -Create an image, either by pull it from the registry or by importing it +Create an image, either by pull it from the registry or by importing i - **Example request**: +**Example request**: POST /images/create?fromImage=base HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -794,26 +792,26 @@ Create an image, either by pull it from the registry or by importing it `X-Registry-Auth` header can be used to include a base64-encoded AuthConfig object. - Query Parameters: +Query Parameters:   - - **fromImage** – name of the image to pull - - **fromSrc** – source to import, - means stdin - - **repo** – repository - - **tag** – tag - - **registry** – the registry to pull from +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from Request Headers:   - - **X-Registry-Auth** – base64-encoded AuthConfig object +- **X-Registry-Auth** – base64-encoded AuthConfig objec - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error @@ -823,11 +821,11 @@ Create an image, either by pull it from the registry or by importing it Return low-level information on the image `name` - **Example request**: +**Example request**: GET /images/base/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -861,11 +859,11 @@ Return low-level information on the image `name` "Size": 6824592 } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Get the history of an image @@ -873,11 +871,11 @@ Return low-level information on the image `name` Return the history of the image `name` - **Example request**: +**Example request**: GET /images/base/history HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -895,11 +893,11 @@ Return the history of the image `name` } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Push an image on the registry @@ -907,11 +905,11 @@ Return the history of the image `name` Push the image `name` on the registry - **Example request**: +**Example request**: POST /images/test/push HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -922,32 +920,32 @@ Push the image `name` on the registry ... If you wish to push an image on to a private registry, that image must already have been tagged - into a repository which references that registry host name and port. This repository name should + into a repository which references that registry host name and port. This repository name should then be used in the URL. This mirrors the flow of the CLI. - **Example request**: +**Example request**: - POST /images/registry.acme.com:5000/test/push HTTP/1.1 - + POST /images/registry.acme.com:5000/test/push HTTP/1.1 - Query Parameters: + +Query Parameters:   - - **tag** – the tag to associate with the image on the registry, optional +- **tag** – the tag to associate with the image on the registry, optional Request Headers:   - - **X-Registry-Auth** – include a base64-encoded AuthConfig +- **X-Registry-Auth** – include a base64-encoded AuthConfig object. - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Tag an image into a repository @@ -955,28 +953,28 @@ Push the image `name` on the registry Tag the image `name` into a repository - **Example request**: +**Example request**: POST /images/test/tag?repo=myrepo&force=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 201 OK - Query Parameters: +Query Parameters:   - - **repo** – The repository to tag in - - **force** – 1/True/true or 0/False/false, default false +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **201** – no error - - **400** – bad parameter - - **404** – no such image - - **409** – conflict - - **500** – server error +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflic +- **500** – server error ### Remove an image @@ -984,11 +982,11 @@ Tag the image `name` into a repository Remove the image `name` from the filesystem - **Example request**: +**Example request**: DELETE /images/test HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-type: application/json @@ -999,19 +997,19 @@ Remove the image `name` from the filesystem {"Deleted":"53b4f83ac9"} ] - Query Parameters: +Query Parameters:   - - **force** – 1/True/true or 0/False/false, default false - - **noprune** – 1/True/true or 0/False/false, default false +- **force** – 1/True/true or 0/False/false, default false +- **noprune** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **409** – conflict - - **500** – server error +- **200** – no error +- **404** – no such image +- **409** – conflic +- **500** – server error ### Search images @@ -1023,11 +1021,11 @@ Search for an image on [Docker Hub](https://hub.docker.com). > The response keys have changed from API v1.6 to reflect the JSON > sent by the registry server to the docker daemon's request. - **Example request**: +**Example request**: GET /images/search?term=sshd HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1057,16 +1055,16 @@ Search for an image on [Docker Hub](https://hub.docker.com). ... ] - Query Parameters: +Query Parameters:   - - **term** – term to search +- **term** – term to search - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ## 2.3 Misc @@ -1076,13 +1074,13 @@ Search for an image on [Docker Hub](https://hub.docker.com). Build an image from Dockerfile via stdin - **Example request**: +**Example request**: POST /build HTTP/1.1 {{ TAR STREAM }} - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1099,29 +1097,29 @@ Build an image from Dockerfile via stdin which will be accessible in the build context (See the [*ADD build command*](/reference/builder/#dockerbuilder)). - Query Parameters: +Query Parameters:   - - **t** – repository name (and optionally a tag) to be applied to +- **t** – repository name (and optionally a tag) to be applied to the resulting image in case of success - - **q** – suppress verbose build output - - **nocache** – do not use the cache when building the image - - **rm** - remove intermediate containers after a successful build (default behavior) - - **forcerm - always remove intermediate containers (includes rm) +- **q** – suppress verbose build outpu +- **nocache** – do not use the cache when building the image +- **rm** - remove intermediate containers after a successful build (default behavior) +- **forcerm - always remove intermediate containers (includes rm) Request Headers:   - - **Content-type** – should be set to +- **Content-type** – should be set to `"application/tar"`. - - **X-Registry-Config** – base64-encoded ConfigFile object +- **X-Registry-Config** – base64-encoded ConfigFile objec - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Check auth configuration @@ -1129,7 +1127,7 @@ Build an image from Dockerfile via stdin Get the default username and email - **Example request**: +**Example request**: POST /auth HTTP/1.1 Content-Type: application/json @@ -1141,15 +1139,15 @@ Get the default username and email "serveraddress":"https://index.docker.io/v1/" } - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **204** – no error - - **500** – server error +- **200** – no error +- **204** – no error +- **500** – server error ### Display system-wide information @@ -1157,11 +1155,11 @@ Get the default username and email Display system-wide information - **Example request**: +**Example request**: GET /info HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1183,10 +1181,10 @@ Display system-wide information "IPv4Forwarding":true } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Show the docker version information @@ -1194,11 +1192,11 @@ Display system-wide information Show the docker version information - **Example request**: +**Example request**: GET /version HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1210,10 +1208,10 @@ Show the docker version information "GoVersion":"go1.0.3" } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Ping the docker server @@ -1221,20 +1219,20 @@ Show the docker version information Ping the docker server - **Example request**: +**Example request**: GET /_ping HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK OK - Status Codes: +Status Codes: - - **200** - no error - - **500** - server error +- **200** - no error +- **500** - server error ### Create a new image from a container's changes @@ -1242,7 +1240,7 @@ Ping the docker server Create a new image from a container's changes - **Example request**: +**Example request**: POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 Content-Type: application/json @@ -1276,35 +1274,35 @@ Create a new image from a container's changes } } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/vnd.docker.raw-stream {"Id":"596069db4bf5"} - Json Parameters: +Json Parameters: - - **config** - the container's configuration +- **config** - the container's configuration - Query Parameters: +Query Parameters:   - - **container** – source container - - **repo** – repository - - **tag** – tag - - **m** – commit message - - **author** – author (e.g., "John Hannibal Smith +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **500** – server error +- **201** – no error +- **404** – no such container +- **500** – server error ### Monitor Docker's events @@ -1313,11 +1311,11 @@ Create a new image from a container's changes Get events from docker, either in real time via streaming, or via polling (using since) - **Example request**: +**Example request**: GET /events?since=1374067924 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1327,17 +1325,17 @@ via polling (using since) {"status":"stop","id":"dfdf82bd3881","from":"base:latest","time":1374067966} {"status":"destroy","id":"dfdf82bd3881","from":"base:latest","time":1374067970} - Query Parameters: +Query Parameters:   - - **since** – timestamp used for polling - - **until** – timestamp used for polling +- **since** – timestamp used for polling +- **until** – timestamp used for polling - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Get a tarball containing all images and tags in a repository @@ -1346,21 +1344,21 @@ via polling (using since) Get a tarball containing all images and metadata for the repository specified by `name`. - **Example request** +**Example request** - GET /images/ubuntu/get + GET /images/ubuntu/ge - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/x-tar Binary data stream - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Load a tarball with a set of images and tags into docker @@ -1368,20 +1366,20 @@ specified by `name`. Load a set of images and tags into the docker repository. - **Example request** +**Example request** POST /images/load Tarball in body - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error # 3. Going further @@ -1392,17 +1390,17 @@ Here are the steps of `docker run`: - Create the container - If the status code is 404, it means the image doesn't exists: - - Try to pull it - - Then retry to create the container +- Try to pull i +- Then retry to create the container - Start the container - If you are not in detached mode: - - Attach to the container, using logs=1 (to have stdout and +- Attach to the container, using logs=1 (to have stdout and stderr from the container's start) and stream=1 - If in detached mode or only stdin is attached: - - Display the container's id +- Display the container's id ## 3.2 Hijacking diff --git a/docs/sources/reference/api/docker_remote_api_v1.15.md b/docs/sources/reference/api/docker_remote_api_v1.15.md index 77121f8a44..5e07c7f992 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.15.md +++ b/docs/sources/reference/api/docker_remote_api_v1.15.md @@ -24,11 +24,11 @@ page_keywords: API, Docker, rcli, REST, documentation List containers - **Example request**: +**Example request**: GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -76,26 +76,26 @@ List containers } ] - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default - - **limit** – Show `limit` last created +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul +- **limit** – Show `limit` last created containers, include non-running ones. - - **since** – Show only containers created since Id, include +- **since** – Show only containers created since Id, include non-running ones. - - **before** – Show only containers created before Id, include +- **before** – Show only containers created before Id, include non-running ones. - - **size** – 1/True/true or 0/False/false, Show the containers +- **size** – 1/True/true or 0/False/false, Show the containers sizes - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create a container @@ -103,7 +103,7 @@ List containers Create a container - **Example request**: +**Example request**: POST /containers/create HTTP/1.1 Content-Type: application/json @@ -138,7 +138,7 @@ Create a container } } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/json @@ -148,25 +148,25 @@ Create a container "Warnings":[] } - Json Parameters: +Json Parameters:   - - **config** – the container's configuration +- **config** – the container's configuration - Query Parameters: +Query Parameters:   - - **name** – Assign the specified name to the container. Must +- **name** – Assign the specified name to the container. Mus match `/?[a-zA-Z0-9_-]+`. - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **406** – impossible to attach (container not running) - - **500** – server error +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error ### Inspect a container @@ -175,11 +175,11 @@ Create a container Return low-level information on the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -250,11 +250,11 @@ Return low-level information on the container `id` } } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### List processes running inside a container @@ -262,11 +262,11 @@ Return low-level information on the container `id` List processes running inside the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/top HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -291,17 +291,17 @@ List processes running inside the container `id` ] } - Query Parameters: +Query Parameters:   - - **ps_args** – ps arguments to use (e.g., aux) +- **ps_args** – ps arguments to use (e.g., aux) - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Get container logs @@ -309,33 +309,33 @@ List processes running inside the container `id` Get stdout and stderr logs from the container ``id`` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1×tamps=1&follow=1&tail=10 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **follow** – 1/True/true or 0/False/false, return stream. Default false - - **stdout** – 1/True/true or 0/False/false, show stdout log. Default false - - **stderr** – 1/True/true or 0/False/false, show stderr log. Default false - - **timestamps** – 1/True/true or 0/False/false, print timestamps for +- **follow** – 1/True/true or 0/False/false, return stream. Default false +- **stdout** – 1/True/true or 0/False/false, show stdout log. Default false +- **stderr** – 1/True/true or 0/False/false, show stderr log. Default false +- **timestamps** – 1/True/true or 0/False/false, print timestamps for every log line. Default false - - **tail** – Output specified number of lines at the end of logs: `all` or ``. Default all +- **tail** – Output specified number of lines at the end of logs: `all` or ``. Default all - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Inspect changes on a container's filesystem @@ -343,11 +343,11 @@ Get stdout and stderr logs from the container ``id`` Inspect changes on container `id`'s filesystem - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/changes HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -367,11 +367,11 @@ Inspect changes on container `id`'s filesystem } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Export a container @@ -379,22 +379,22 @@ Inspect changes on container `id`'s filesystem Export the contents of container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/export HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Start a container @@ -402,7 +402,7 @@ Export the contents of container `id` Start the container `id` - **Example request**: +**Example request**: POST /containers/(id)/start HTTP/1.1 Content-Type: application/json @@ -420,23 +420,23 @@ Start the container `id` "CapDrop: ["MKNOD"] } - **Example response**: +**Example response**: - HTTP/1.1 204 No Content + HTTP/1.1 204 No Conten Content-Type: text/plain - Json Parameters: +Json Parameters:   - - **hostConfig** – the container's host configuration (optional) +- **hostConfig** – the container's host configuration (optional) - Status Codes: +Status Codes: - - **204** – no error - - **304** – container already started - - **404** – no such container - - **500** – server error +- **204** – no error +- **304** – container already started +- **404** – no such container +- **500** – server error ### Stop a container @@ -444,26 +444,26 @@ Start the container `id` Stop the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/stop?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **304** – container already stopped - - **404** – no such container - - **500** – server error +- **204** – no error +- **304** – container already stopped +- **404** – no such container +- **500** – server error ### Restart a container @@ -471,25 +471,25 @@ Stop the container `id` Restart the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/restart?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Kill a container @@ -497,24 +497,24 @@ Restart the container `id` Kill the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/kill HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters +Query Parameters - - **signal** - Signal to send to the container: integer or string like "SIGINT". +- **signal** - Signal to send to the container: integer or string like "SIGINT". When not set, SIGKILL is assumed and the call will waits for the container to exit. - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Pause a container @@ -522,19 +522,19 @@ Kill the container `id` Pause the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/pause HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Unpause a container @@ -542,19 +542,19 @@ Pause the container `id` Unpause the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/unpause HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Attach to a container @@ -562,38 +562,38 @@ Unpause the container `id` Attach to the container `id` - **Example request**: +**Example request**: POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **logs** – 1/True/true or 0/False/false, return logs. Default +- **logs** – 1/True/true or 0/False/false, return logs. Defaul false - - **stream** – 1/True/true or 0/False/false, return stream. +- **stream** – 1/True/true or 0/False/false, return stream. Default false - - **stdin** – 1/True/true or 0/False/false, if stream=true, attach +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false - - **stdout** – 1/True/true or 0/False/false, if logs=true, return +- **stdout** – 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false - - **stderr** – 1/True/true or 0/False/false, if logs=true, return +- **stderr** – 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error **Stream details**: @@ -618,9 +618,9 @@ Attach to the container `id` `STREAM_TYPE` can be: - - 0: stdin (will be written on stdout) - - 1: stdout - - 2: stderr +- 0: stdin (will be written on stdout) +- 1: stdou +- 2: stderr `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of the uint32 size encoded as big endian. @@ -636,7 +636,7 @@ Attach to the container `id` 1. Read 8 bytes 2. chose stdout or stderr depending on the first byte 3. Extract the frame size from the last 4 byets - 4. Read the extracted size and output it on the correct output + 4. Read the extracted size and output it on the correct outpu 5. Goto 1) ### Wait a container @@ -645,22 +645,22 @@ Attach to the container `id` Block until container `id` stops, then returns the exit code - **Example request**: +**Example request**: POST /containers/16253994b7c4/wait HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json {"StatusCode":0} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Remove a container @@ -668,29 +668,29 @@ Block until container `id` stops, then returns the exit code Remove the container `id` from the filesystem - **Example request**: +**Example request**: DELETE /containers/16253994b7c4?v=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **v** – 1/True/true or 0/False/false, Remove the volumes +- **v** – 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false - - **force** - 1/True/true or 0/False/false, Kill then remove the container. +- **force** - 1/True/true or 0/False/false, Kill then remove the container. Default false - Status Codes: +Status Codes: - - **204** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ### Copy files or folders from a container @@ -698,7 +698,7 @@ Remove the container `id` from the filesystem Copy files or folders of container `id` - **Example request**: +**Example request**: POST /containers/4fa6e0f0c678/copy HTTP/1.1 Content-Type: application/json @@ -707,18 +707,18 @@ Copy files or folders of container `id` "Resource":"test.txt" } - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ## 2.2 Images @@ -730,7 +730,7 @@ Copy files or folders of container `id` GET /images/json?all=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -761,12 +761,12 @@ Copy files or folders of container `id` ] - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, default false - - **filters** – a json encoded value of the filters (a map[string][]string) to process on the images list. +- **all** – 1/True/true or 0/False/false, default false +- **filters** – a json encoded value of the filters (a map[string][]string) to process on the images list. @@ -774,13 +774,13 @@ Copy files or folders of container `id` `POST /images/create` -Create an image, either by pull it from the registry or by importing it +Create an image, either by pull it from the registry or by importing i - **Example request**: +**Example request**: POST /images/create?fromImage=base HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -794,26 +794,26 @@ Create an image, either by pull it from the registry or by importing it `X-Registry-Auth` header can be used to include a base64-encoded AuthConfig object. - Query Parameters: +Query Parameters:   - - **fromImage** – name of the image to pull - - **fromSrc** – source to import, - means stdin - - **repo** – repository - - **tag** – tag - - **registry** – the registry to pull from +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from Request Headers:   - - **X-Registry-Auth** – base64-encoded AuthConfig object +- **X-Registry-Auth** – base64-encoded AuthConfig objec - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error @@ -823,11 +823,11 @@ Create an image, either by pull it from the registry or by importing it Return low-level information on the image `name` - **Example request**: +**Example request**: GET /images/base/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -861,11 +861,11 @@ Return low-level information on the image `name` "Size": 6824592 } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Get the history of an image @@ -873,11 +873,11 @@ Return low-level information on the image `name` Return the history of the image `name` - **Example request**: +**Example request**: GET /images/base/history HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -895,11 +895,11 @@ Return the history of the image `name` } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Push an image on the registry @@ -907,11 +907,11 @@ Return the history of the image `name` Push the image `name` on the registry - **Example request**: +**Example request**: POST /images/test/push HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -922,32 +922,32 @@ Push the image `name` on the registry ... If you wish to push an image on to a private registry, that image must already have been tagged - into a repository which references that registry host name and port. This repository name should + into a repository which references that registry host name and port. This repository name should then be used in the URL. This mirrors the flow of the CLI. - **Example request**: +**Example request**: - POST /images/registry.acme.com:5000/test/push HTTP/1.1 - + POST /images/registry.acme.com:5000/test/push HTTP/1.1 - Query Parameters: + +Query Parameters:   - - **tag** – the tag to associate with the image on the registry, optional +- **tag** – the tag to associate with the image on the registry, optional Request Headers:   - - **X-Registry-Auth** – include a base64-encoded AuthConfig +- **X-Registry-Auth** – include a base64-encoded AuthConfig object. - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Tag an image into a repository @@ -955,28 +955,28 @@ Push the image `name` on the registry Tag the image `name` into a repository - **Example request**: +**Example request**: POST /images/test/tag?repo=myrepo&force=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 201 OK - Query Parameters: +Query Parameters:   - - **repo** – The repository to tag in - - **force** – 1/True/true or 0/False/false, default false +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **201** – no error - - **400** – bad parameter - - **404** – no such image - - **409** – conflict - - **500** – server error +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflic +- **500** – server error ### Remove an image @@ -984,11 +984,11 @@ Tag the image `name` into a repository Remove the image `name` from the filesystem - **Example request**: +**Example request**: DELETE /images/test HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-type: application/json @@ -999,19 +999,19 @@ Remove the image `name` from the filesystem {"Deleted":"53b4f83ac9"} ] - Query Parameters: +Query Parameters:   - - **force** – 1/True/true or 0/False/false, default false - - **noprune** – 1/True/true or 0/False/false, default false +- **force** – 1/True/true or 0/False/false, default false +- **noprune** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **409** – conflict - - **500** – server error +- **200** – no error +- **404** – no such image +- **409** – conflic +- **500** – server error ### Search images @@ -1023,11 +1023,11 @@ Search for an image on [Docker Hub](https://hub.docker.com). > The response keys have changed from API v1.6 to reflect the JSON > sent by the registry server to the docker daemon's request. - **Example request**: +**Example request**: GET /images/search?term=sshd HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1057,16 +1057,16 @@ Search for an image on [Docker Hub](https://hub.docker.com). ... ] - Query Parameters: +Query Parameters:   - - **term** – term to search +- **term** – term to search - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ## 2.3 Misc @@ -1076,13 +1076,13 @@ Search for an image on [Docker Hub](https://hub.docker.com). Build an image from Dockerfile via stdin - **Example request**: +**Example request**: POST /build HTTP/1.1 {{ TAR STREAM }} - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1099,29 +1099,29 @@ Build an image from Dockerfile via stdin which will be accessible in the build context (See the [*ADD build command*](/reference/builder/#dockerbuilder)). - Query Parameters: +Query Parameters:   - - **t** – repository name (and optionally a tag) to be applied to +- **t** – repository name (and optionally a tag) to be applied to the resulting image in case of success - - **q** – suppress verbose build output - - **nocache** – do not use the cache when building the image - - **rm** - remove intermediate containers after a successful build (default behavior) - - **forcerm - always remove intermediate containers (includes rm) +- **q** – suppress verbose build outpu +- **nocache** – do not use the cache when building the image +- **rm** - remove intermediate containers after a successful build (default behavior) +- **forcerm - always remove intermediate containers (includes rm) Request Headers:   - - **Content-type** – should be set to +- **Content-type** – should be set to `"application/tar"`. - - **X-Registry-Config** – base64-encoded ConfigFile object +- **X-Registry-Config** – base64-encoded ConfigFile objec - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Check auth configuration @@ -1129,7 +1129,7 @@ Build an image from Dockerfile via stdin Get the default username and email - **Example request**: +**Example request**: POST /auth HTTP/1.1 Content-Type: application/json @@ -1141,15 +1141,15 @@ Get the default username and email "serveraddress":"https://index.docker.io/v1/" } - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **204** – no error - - **500** – server error +- **200** – no error +- **204** – no error +- **500** – server error ### Display system-wide information @@ -1157,11 +1157,11 @@ Get the default username and email Display system-wide information - **Example request**: +**Example request**: GET /info HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1183,10 +1183,10 @@ Display system-wide information "IPv4Forwarding":true } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Show the docker version information @@ -1194,11 +1194,11 @@ Display system-wide information Show the docker version information - **Example request**: +**Example request**: GET /version HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1210,10 +1210,10 @@ Show the docker version information "GoVersion":"go1.0.3" } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Ping the docker server @@ -1221,20 +1221,20 @@ Show the docker version information Ping the docker server - **Example request**: +**Example request**: GET /_ping HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK OK - Status Codes: +Status Codes: - - **200** - no error - - **500** - server error +- **200** - no error +- **500** - server error ### Create a new image from a container's changes @@ -1242,7 +1242,7 @@ Ping the docker server Create a new image from a container's changes - **Example request**: +**Example request**: POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 Content-Type: application/json @@ -1276,35 +1276,35 @@ Create a new image from a container's changes } } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/vnd.docker.raw-stream {"Id":"596069db4bf5"} - Json Parameters: +Json Parameters: - - **config** - the container's configuration +- **config** - the container's configuration - Query Parameters: +Query Parameters:   - - **container** – source container - - **repo** – repository - - **tag** – tag - - **m** – commit message - - **author** – author (e.g., "John Hannibal Smith +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **500** – server error +- **201** – no error +- **404** – no such container +- **500** – server error ### Monitor Docker's events @@ -1313,11 +1313,11 @@ Create a new image from a container's changes Get events from docker, either in real time via streaming, or via polling (using since) - **Example request**: +**Example request**: GET /events?since=1374067924 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1327,17 +1327,17 @@ via polling (using since) {"status":"stop","id":"dfdf82bd3881","from":"base:latest","time":1374067966} {"status":"destroy","id":"dfdf82bd3881","from":"base:latest","time":1374067970} - Query Parameters: +Query Parameters:   - - **since** – timestamp used for polling - - **until** – timestamp used for polling +- **since** – timestamp used for polling +- **until** – timestamp used for polling - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Get a tarball containing all images in a repository @@ -1347,25 +1347,25 @@ Get a tarball containing all images and metadata for the repository specified by `name`. If `name` is a specific name and tag (e.g. ubuntu:latest), then only that image -(and its parents) are returned. If `name` is an image ID, similarly only that +(and its parents) are returned. If `name` is an image ID, similarly only tha image (and its parents) are returned, but with the exclusion of the 'repositories' file in the tarball, as there were no image names referenced. - **Example request** +**Example request** - GET /images/ubuntu/get + GET /images/ubuntu/ge - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/x-tar Binary data stream - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Get a tarball containing of images. @@ -1379,21 +1379,21 @@ an image ID, similarly only that image (and its parents) are returned and there would be no names referenced in the 'repositories' file for this image ID. - **Example request** +**Example request** GET /images/get?names=myname%2Fmyapp%3Alatest&names=busybox - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/x-tar Binary data stream - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Load a tarball with a set of images and tags into docker @@ -1401,20 +1401,20 @@ would be no names referenced in the 'repositories' file for this image ID. Load a set of images and tags into the docker repository. - **Example request** +**Example request** POST /images/load Tarball in body - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error # 3. Going further @@ -1425,17 +1425,17 @@ Here are the steps of `docker run`: - Create the container - If the status code is 404, it means the image doesn't exists: - - Try to pull it - - Then retry to create the container +- Try to pull i +- Then retry to create the container - Start the container - If you are not in detached mode: - - Attach to the container, using logs=1 (to have stdout and +- Attach to the container, using logs=1 (to have stdout and stderr from the container's start) and stream=1 - If in detached mode or only stdin is attached: - - Display the container's id +- Display the container's id ## 3.2 Hijacking diff --git a/docs/sources/reference/api/docker_remote_api_v1.2.md b/docs/sources/reference/api/docker_remote_api_v1.2.md index f5cd8a40d1..31d2557b98 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.2.md +++ b/docs/sources/reference/api/docker_remote_api_v1.2.md @@ -22,11 +22,11 @@ page_keywords: API, Docker, rcli, REST, documentation List containers - **Example request**: +**Example request**: GET /containers/json?all=1&before=8dfafdbc3a40 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -74,24 +74,24 @@ List containers } ] - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default - - **limit** – Show `limit` last created +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul +- **limit** – Show `limit` last created containers, include non-running ones. - - **since** – Show only containers created since Id, include +- **since** – Show only containers created since Id, include non-running ones. - - **before** – Show only containers created before Id, include +- **before** – Show only containers created before Id, include non-running ones. - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create a container @@ -99,7 +99,7 @@ List containers Create a container - **Example request**: +**Example request**: POST /containers/create HTTP/1.1 Content-Type: application/json @@ -126,7 +126,7 @@ Create a container "VolumesFrom":"" } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/json @@ -136,18 +136,18 @@ Create a container "Warnings":[] } - Json Parameters: +Json Parameters:   - - **config** – the container's configuration +- **config** – the container's configuration - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **406** – impossible to attach (container not running) - - **500** – server error +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error ### Inspect a container @@ -156,11 +156,11 @@ Create a container Return low-level information on the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -211,11 +211,11 @@ Return low-level information on the container `id` "Volumes": {} } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Inspect changes on a container's filesystem @@ -223,11 +223,11 @@ Return low-level information on the container `id` Inspect changes on container `id`'s filesystem - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/changes HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -247,11 +247,11 @@ Inspect changes on container `id`'s filesystem } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Export a container @@ -259,22 +259,22 @@ Inspect changes on container `id`'s filesystem Export the contents of container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/export HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Start a container @@ -282,19 +282,19 @@ Export the contents of container `id` Start the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/start HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Stop a container @@ -302,25 +302,25 @@ Start the container `id` Stop the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/stop?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Restart a container @@ -328,25 +328,25 @@ Stop the container `id` Restart the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/restart?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Kill a container @@ -354,19 +354,19 @@ Restart the container `id` Kill the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/kill HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Attach to a container @@ -374,38 +374,38 @@ Kill the container `id` Attach to the container `id` - **Example request**: +**Example request**: POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **logs** – 1/True/true or 0/False/false, return logs. Default +- **logs** – 1/True/true or 0/False/false, return logs. Defaul false - - **stream** – 1/True/true or 0/False/false, return stream. +- **stream** – 1/True/true or 0/False/false, return stream. Default false - - **stdin** – 1/True/true or 0/False/false, if stream=true, attach +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false - - **stdout** – 1/True/true or 0/False/false, if logs=true, return +- **stdout** – 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false - - **stderr** – 1/True/true or 0/False/false, if logs=true, return +- **stderr** – 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ### Wait a container @@ -413,22 +413,22 @@ Attach to the container `id` Block until container `id` stops, then returns the exit code - **Example request**: +**Example request**: POST /containers/16253994b7c4/wait HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json {"StatusCode":0} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Remove a container @@ -436,27 +436,27 @@ Block until container `id` stops, then returns the exit code Remove the container `id` from the filesystem - **Example request**: +**Example request**: DELETE /containers/16253994b7c4?v=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **v** – 1/True/true or 0/False/false, Remove the volumes +- **v** – 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false - Status Codes: +Status Codes: - - **204** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ## 2.2 Images @@ -466,11 +466,11 @@ Remove the container `id` from the filesystem List images `format` could be json or viz (json default) - **Example request**: +**Example request**: GET /images/json?all=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -494,11 +494,11 @@ List images `format` could be json or viz (json default) } ] - **Example request**: +**Example request**: GET /images/viz HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: text/plain @@ -521,30 +521,30 @@ List images `format` could be json or viz (json default) base [style=invisible] } - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create an image `POST /images/create` -Create an image, either by pull it from the registry or by importing it +Create an image, either by pull it from the registry or by importing i - **Example request**: +**Example request**: POST /images/create?fromImage=ubuntu HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -554,20 +554,20 @@ Create an image, either by pull it from the registry or by importing it {"error":"Invalid..."} ... - Query Parameters: +Query Parameters:   - - **fromImage** – name of the image to pull - - **fromSrc** – source to import, - means stdin - - **repo** – repository - - **tag** – tag - - **registry** – the registry to pull from +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Insert a file in an image @@ -575,11 +575,11 @@ Create an image, either by pull it from the registry or by importing it Insert a file from `url` in the image `name` at `path` - **Example request**: +**Example request**: POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -589,17 +589,15 @@ Insert a file from `url` in the image `name` at `path` {"error":"Invalid..."} ... - Query Parameters: +Query Parameters: +- **url** – The url from where the file is taken +- **path** – The path where the file is stored +Status Codes: - - **url** – The url from where the file is taken - - **path** – The path where the file is stored - - Status Codes: - - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Inspect an image @@ -607,11 +605,11 @@ Insert a file from `url` in the image `name` at `path` Return low-level information on the image `name` - **Example request**: +**Example request**: GET /images/centos/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -644,11 +642,11 @@ Return low-level information on the image `name` "Size": 6824592 } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Get the history of an image @@ -656,11 +654,11 @@ Return low-level information on the image `name` Return the history of the image `name` - **Example request**: +**Example request**: GET /images/fedora/history HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -679,11 +677,11 @@ Return the history of the image `name` } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Push an image on the registry @@ -706,11 +704,11 @@ Push the image `name` on the registry {"error":"Invalid..."} ... - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Tag an image into a repository @@ -718,28 +716,28 @@ Push the image `name` on the registry Tag the image `name` into a repository - **Example request**: +**Example request**: POST /images/test/tag?repo=myrepo&force=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 201 OK - Query Parameters: +Query Parameters:   - - **repo** – The repository to tag in - - **force** – 1/True/true or 0/False/false, default false +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **201** – no error - - **400** – bad parameter - - **404** – no such image - - **409** – conflict - - **500** – server error +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflic +- **500** – server error ### Remove an image @@ -747,11 +745,11 @@ Tag the image `name` into a repository Remove the image `name` from the filesystem - **Example request**: +**Example request**: DELETE /images/test HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-type: application/json @@ -762,12 +760,12 @@ Remove the image `name` from the filesystem {"Deleted":"53b4f83ac9"} ] - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such image - - **409** – conflict - - **500** – server error +- **204** – no error +- **404** – no such image +- **409** – conflic +- **500** – server error ### Search images @@ -775,11 +773,11 @@ Remove the image `name` from the filesystem Search for an image on [Docker Hub](https://hub.docker.com) - **Example request**: +**Example request**: GET /images/search?term=sshd HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -811,30 +809,30 @@ Search for an image on [Docker Hub](https://hub.docker.com) Build an image from Dockerfile - **Example request**: +**Example request**: POST /build HTTP/1.1 {{ TAR STREAM }} - **Example response**: +**Example response**: HTTP/1.1 200 OK {{ STREAM }} - Query Parameters: +Query Parameters:   - - **t** – repository name to be applied to the resulting image in +- **t** – repository name to be applied to the resulting image in case of success - - **remote** – resource to fetch, as URI +- **remote** – resource to fetch, as URI - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error {{ STREAM }} is the raw text output of the build command. It uses the HTTP Hijack method in order to stream. @@ -845,7 +843,7 @@ HTTP Hijack method in order to stream. Get the default username and email - **Example request**: +**Example request**: POST /auth HTTP/1.1 Content-Type: application/json @@ -856,7 +854,7 @@ Get the default username and email "email":"hannibal@a-team.com" } - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -865,13 +863,13 @@ Get the default username and email "Status": "Login Succeeded" } - Status Codes: +Status Codes: - - **200** – no error - - **204** – no error - - **401** – unauthorized - - **403** – forbidden - - **500** – server error +- **200** – no error +- **204** – no error +- **401** – unauthorized +- **403** – forbidden +- **500** – server error ### Display system-wide information @@ -879,11 +877,11 @@ Get the default username and email Display system-wide information - **Example request**: +**Example request**: GET /info HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -898,10 +896,10 @@ Display system-wide information "SwapLimit":false } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Show the docker version information @@ -909,11 +907,11 @@ Display system-wide information Show the docker version information - **Example request**: +**Example request**: GET /version HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -924,10 +922,10 @@ Show the docker version information "GoVersion":"go1.0.3" } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Create a new image from a container's changes @@ -935,7 +933,7 @@ Show the docker version information Create a new image from a container's changes - **Example request**: +**Example request**: POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 Content-Type: application/json @@ -945,29 +943,29 @@ Create a new image from a container's changes "PortSpecs":["22"] } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/vnd.docker.raw-stream {"Id":"596069db4bf5"} - Query Parameters: +Query Parameters:   - - **container** – source container - - **repo** – repository - - **tag** – tag - - **m** – commit message - - **author** – author (e.g., "John Hannibal Smith +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **500** – server error +- **201** – no error +- **404** – no such container +- **500** – server error # 3. Going further @@ -978,7 +976,7 @@ Here are the steps of `docker run` : - Create the container - If the status code is 404, it means the image doesn't exists: - - Try to pull it + - Try to pull i - Then retry to create the container - Start the container @@ -988,7 +986,7 @@ Here are the steps of `docker run` : stderr from the container's start) and stream=1 - If in detached mode or only stdin is attached: - - Display the container's + - Display the container's ## 3.2 Hijacking diff --git a/docs/sources/reference/api/docker_remote_api_v1.3.md b/docs/sources/reference/api/docker_remote_api_v1.3.md index 912ba6fc1f..fb69dcb622 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.3.md +++ b/docs/sources/reference/api/docker_remote_api_v1.3.md @@ -22,11 +22,11 @@ page_keywords: API, Docker, rcli, REST, documentation List containers - **Example request**: +**Example request**: GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -74,26 +74,26 @@ List containers } ] - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default - - **limit** – Show `limit` last created +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul +- **limit** – Show `limit` last created containers, include non-running ones. - - **since** – Show only containers created since Id, include +- **since** – Show only containers created since Id, include non-running ones. - - **before** – Show only containers created before Id, include +- **before** – Show only containers created before Id, include non-running ones. - - **size** – 1/True/true or 0/False/false, Show the containers +- **size** – 1/True/true or 0/False/false, Show the containers sizes - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create a container @@ -101,7 +101,7 @@ List containers Create a container - **Example request**: +**Example request**: POST /containers/create HTTP/1.1 Content-Type: application/json @@ -128,7 +128,7 @@ Create a container "VolumesFrom":"" } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/json @@ -138,18 +138,18 @@ Create a container "Warnings":[] } - Json Parameters: +Json Parameters:   - - **config** – the container's configuration +- **config** – the container's configuration - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **406** – impossible to attach (container not running) - - **500** – server error +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error ### Inspect a container @@ -158,11 +158,11 @@ Create a container Return low-level information on the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -213,11 +213,11 @@ Return low-level information on the container `id` "Volumes": {} } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### List processes running inside a container @@ -225,11 +225,11 @@ Return low-level information on the container `id` List processes running inside the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/top HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -249,11 +249,11 @@ List processes running inside the container `id` } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Inspect changes on a container's filesystem @@ -261,11 +261,11 @@ List processes running inside the container `id` Inspect changes on container `id`'s filesystem - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/changes HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -285,11 +285,11 @@ Inspect changes on container `id`'s filesystem } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Export a container @@ -297,22 +297,22 @@ Inspect changes on container `id`'s filesystem Export the contents of container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/export HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Start a container @@ -320,7 +320,7 @@ Export the contents of container `id` Start the container `id` - **Example request**: +**Example request**: POST /containers/(id)/start HTTP/1.1 Content-Type: application/json @@ -329,22 +329,22 @@ Start the container `id` "Binds":["/tmp:/tmp"] } - **Example response**: +**Example response**: - HTTP/1.1 204 No Content + HTTP/1.1 204 No Conten Content-Type: text/plain - Json Parameters: +Json Parameters:   - - **hostConfig** – the container's host configuration (optional) +- **hostConfig** – the container's host configuration (optional) - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Stop a container @@ -352,25 +352,25 @@ Start the container `id` Stop the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/stop?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Restart a container @@ -378,25 +378,25 @@ Stop the container `id` Restart the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/restart?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Kill a container @@ -404,19 +404,19 @@ Restart the container `id` Kill the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/kill HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Attach to a container @@ -424,38 +424,38 @@ Kill the container `id` Attach to the container `id` - **Example request**: +**Example request**: POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **logs** – 1/True/true or 0/False/false, return logs. Default +- **logs** – 1/True/true or 0/False/false, return logs. Defaul false - - **stream** – 1/True/true or 0/False/false, return stream. +- **stream** – 1/True/true or 0/False/false, return stream. Default false - - **stdin** – 1/True/true or 0/False/false, if stream=true, attach +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false - - **stdout** – 1/True/true or 0/False/false, if logs=true, return +- **stdout** – 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false - - **stderr** – 1/True/true or 0/False/false, if logs=true, return +- **stderr** – 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ### Wait a container @@ -463,22 +463,22 @@ Attach to the container `id` Block until container `id` stops, then returns the exit code - **Example request**: +**Example request**: POST /containers/16253994b7c4/wait HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json {"StatusCode":0} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Remove a container @@ -486,27 +486,27 @@ Block until container `id` stops, then returns the exit code Remove the container `id` from the filesystem - **Example request**: +**Example request**: DELETE /containers/16253994b7c4?v=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **v** – 1/True/true or 0/False/false, Remove the volumes +- **v** – 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false - Status Codes: +Status Codes: - - **204** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ## 2.2 Images @@ -516,11 +516,11 @@ Remove the container `id` from the filesystem List images `format` could be json or viz (json default) - **Example request**: +**Example request**: GET /images/json?all=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -544,11 +544,11 @@ List images `format` could be json or viz (json default) } ] - **Example request**: +**Example request**: GET /images/viz HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: text/plain @@ -571,30 +571,30 @@ List images `format` could be json or viz (json default) base [style=invisible] } - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create an image `POST /images/create` -Create an image, either by pull it from the registry or by importing it +Create an image, either by pull it from the registry or by importing i - **Example request**: +**Example request**: POST /images/create?fromImage=ubuntu HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -604,20 +604,20 @@ Create an image, either by pull it from the registry or by importing it {"error":"Invalid..."} ... - Query Parameters: +Query Parameters:   - - **fromImage** – name of the image to pull - - **fromSrc** – source to import, - means stdin - - **repo** – repository - - **tag** – tag - - **registry** – the registry to pull from +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Insert a file in an image @@ -625,11 +625,11 @@ Create an image, either by pull it from the registry or by importing it Insert a file from `url` in the image `name` at `path` - **Example request**: +**Example request**: POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -639,17 +639,15 @@ Insert a file from `url` in the image `name` at `path` {"error":"Invalid..."} ... - Query Parameters: +Query Parameters: +- **url** – The url from where the file is taken +- **path** – The path where the file is stored +Status Codes: - - **url** – The url from where the file is taken - - **path** – The path where the file is stored - - Status Codes: - - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Inspect an image @@ -657,11 +655,11 @@ Insert a file from `url` in the image `name` at `path` Return low-level information on the image `name` - **Example request**: +**Example request**: GET /images/centos/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -694,11 +692,11 @@ Return low-level information on the image `name` "Size": 6824592 } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Get the history of an image @@ -706,11 +704,11 @@ Return low-level information on the image `name` Return the history of the image `name` - **Example request**: +**Example request**: GET /images/fedora/history HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -728,11 +726,11 @@ Return the history of the image `name` } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Push an image on the registry @@ -755,11 +753,11 @@ Push the image `name` on the registry {"error":"Invalid..."} ... - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Tag an image into a repository @@ -767,28 +765,28 @@ Push the image `name` on the registry Tag the image `name` into a repository - **Example request**: +**Example request**: POST /images/test/tag?repo=myrepo&force=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 201 OK - Query Parameters: +Query Parameters:   - - **repo** – The repository to tag in - - **force** – 1/True/true or 0/False/false, default false +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **201** – no error - - **400** – bad parameter - - **404** – no such image - - **409** – conflict - - **500** – server error +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflic +- **500** – server error ### Remove an image @@ -796,11 +794,11 @@ Tag the image `name` into a repository Remove the image `name` from the filesystem - **Example request**: +**Example request**: DELETE /images/test HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-type: application/json @@ -811,12 +809,12 @@ Remove the image `name` from the filesystem {"Deleted":"53b4f83ac9"} ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **409** – conflict - - **500** – server error +- **200** – no error +- **404** – no such image +- **409** – conflic +- **500** – server error ### Search images @@ -824,11 +822,11 @@ Remove the image `name` from the filesystem Search for an image on [Docker Hub](https://hub.docker.com) - **Example request**: +**Example request**: GET /images/search?term=sshd HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -860,13 +858,13 @@ Search for an image on [Docker Hub](https://hub.docker.com) Build an image from Dockerfile via stdin - **Example request**: +**Example request**: POST /build HTTP/1.1 {{ TAR STREAM }} - **Example response**: +**Example response**: HTTP/1.1 200 OK @@ -874,24 +872,24 @@ Build an image from Dockerfile via stdin The stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz. - The archive must include a file called Dockerfile at its root. It + The archive must include a file called Dockerfile at its root. I may include any number of other files, which will be accessible in the build context (See the ADD build command). The Content-type header should be set to "application/tar". - Query Parameters: +Query Parameters:   - - **t** – repository name (and optionally a tag) to be applied to +- **t** – repository name (and optionally a tag) to be applied to the resulting image in case of success - - **q** – suppress verbose build output +- **q** – suppress verbose build outpu - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Check auth configuration @@ -899,7 +897,7 @@ Build an image from Dockerfile via stdin Get the default username and email - **Example request**: +**Example request**: POST /auth HTTP/1.1 Content-Type: application/json @@ -910,15 +908,15 @@ Get the default username and email "email":"hannibal@a-team.com" } - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **204** – no error - - **500** – server error +- **200** – no error +- **204** – no error +- **500** – server error ### Display system-wide information @@ -926,11 +924,11 @@ Get the default username and email Display system-wide information - **Example request**: +**Example request**: GET /info HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -948,10 +946,10 @@ Display system-wide information "KernelVersion":"3.8.0-19-generic" } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Show the docker version information @@ -959,11 +957,11 @@ Display system-wide information Show the docker version information - **Example request**: +**Example request**: GET /version HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -974,10 +972,10 @@ Show the docker version information "GoVersion":"go1.0.3" } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Create a new image from a container's changes @@ -985,7 +983,7 @@ Show the docker version information Create a new image from a container's changes - **Example request**: +**Example request**: POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 Content-Type: application/json @@ -995,29 +993,29 @@ Create a new image from a container's changes "PortSpecs":["22"] } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/vnd.docker.raw-stream {"Id":"596069db4bf5"} - Query Parameters: +Query Parameters:   - - **container** – source container - - **repo** – repository - - **tag** – tag - - **m** – commit message - - **author** – author (e.g., "John Hannibal Smith +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **500** – server error +- **201** – no error +- **404** – no such container +- **500** – server error ### Monitor Docker's events @@ -1026,11 +1024,11 @@ Create a new image from a container's changes Get events from docker, either in real time via streaming, or via polling (using since) - **Example request**: +**Example request**: GET /events?since=1374067924 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1040,16 +1038,16 @@ polling (using since) {"status":"stop","id":"dfdf82bd3881","time":1374067966} {"status":"destroy","id":"dfdf82bd3881","time":1374067970} - Query Parameters: +Query Parameters:   - - **since** – timestamp used for polling +- **since** – timestamp used for polling - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error # 3. Going further @@ -1060,7 +1058,7 @@ Here are the steps of `docker run` : - Create the container - If the status code is 404, it means the image doesn't exists: - - Try to pull it + - Try to pull i - Then retry to create the container - Start the container diff --git a/docs/sources/reference/api/docker_remote_api_v1.4.md b/docs/sources/reference/api/docker_remote_api_v1.4.md index 70f39f6f24..4ac4f2671e 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.4.md +++ b/docs/sources/reference/api/docker_remote_api_v1.4.md @@ -22,11 +22,11 @@ page_keywords: API, Docker, rcli, REST, documentation List containers - **Example request**: +**Example request**: GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -74,26 +74,26 @@ List containers } ] - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default - - **limit** – Show `limit` last created +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul +- **limit** – Show `limit` last created containers, include non-running ones. - - **since** – Show only containers created since Id, include +- **since** – Show only containers created since Id, include non-running ones. - - **before** – Show only containers created before Id, include +- **before** – Show only containers created before Id, include non-running ones. - - **size** – 1/True/true or 0/False/false, Show the containers +- **size** – 1/True/true or 0/False/false, Show the containers sizes - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create a container @@ -101,7 +101,7 @@ List containers Create a container - **Example request**: +**Example request**: POST /containers/create HTTP/1.1 Content-Type: application/json @@ -131,7 +131,7 @@ Create a container } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/json @@ -141,18 +141,18 @@ Create a container "Warnings":[] } - Json Parameters: +Json Parameters:   - - **config** – the container's configuration +- **config** – the container's configuration - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **406** – impossible to attach (container not running) - - **500** – server error +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error ### Inspect a container @@ -161,11 +161,11 @@ Create a container Return low-level information on the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -218,12 +218,12 @@ Return low-level information on the container `id` "Volumes": {} } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **409** – conflict between containers and images - - **500** – server error +- **200** – no error +- **404** – no such container +- **409** – conflict between containers and images +- **500** – server error ### List processes running inside a container @@ -231,11 +231,11 @@ Return low-level information on the container `id` List processes running inside the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/top HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -260,17 +260,17 @@ List processes running inside the container `id` ] } - Query Parameters: +Query Parameters:   - - **ps_args** – ps arguments to use (e.g., aux) +- **ps_args** – ps arguments to use (e.g., aux) - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Inspect changes on a container's filesystem @@ -278,11 +278,11 @@ List processes running inside the container `id` Inspect changes on container `id`'s filesystem - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/changes HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -302,11 +302,11 @@ Inspect changes on container `id`'s filesystem } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Export a container @@ -314,22 +314,22 @@ Inspect changes on container `id`'s filesystem Export the contents of container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/export HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Start a container @@ -337,7 +337,7 @@ Export the contents of container `id` Start the container `id` - **Example request**: +**Example request**: POST /containers/(id)/start HTTP/1.1 Content-Type: application/json @@ -347,22 +347,22 @@ Start the container `id` "LxcConf":[{"Key":"lxc.utsname","Value":"docker"}] } - **Example response**: +**Example response**: - HTTP/1.1 204 No Content + HTTP/1.1 204 No Conten Content-Type: text/plain - Json Parameters: +Json Parameters:   - - **hostConfig** – the container's host configuration (optional) +- **hostConfig** – the container's host configuration (optional) - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Stop a container @@ -370,25 +370,25 @@ Start the container `id` Stop the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/stop?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Restart a container @@ -396,25 +396,25 @@ Stop the container `id` Restart the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/restart?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Kill a container @@ -422,19 +422,19 @@ Restart the container `id` Kill the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/kill HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Attach to a container @@ -442,38 +442,38 @@ Kill the container `id` Attach to the container `id` - **Example request**: +**Example request**: POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **logs** – 1/True/true or 0/False/false, return logs. Default +- **logs** – 1/True/true or 0/False/false, return logs. Defaul false - - **stream** – 1/True/true or 0/False/false, return stream. +- **stream** – 1/True/true or 0/False/false, return stream. Default false - - **stdin** – 1/True/true or 0/False/false, if stream=true, attach +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false - - **stdout** – 1/True/true or 0/False/false, if logs=true, return +- **stdout** – 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false - - **stderr** – 1/True/true or 0/False/false, if logs=true, return +- **stderr** – 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ### Wait a container @@ -481,22 +481,22 @@ Attach to the container `id` Block until container `id` stops, then returns the exit code - **Example request**: +**Example request**: POST /containers/16253994b7c4/wait HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json {"StatusCode":0} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Remove a container @@ -504,27 +504,27 @@ Block until container `id` stops, then returns the exit code Remove the container `id` from the filesystem - **Example request**: +**Example request**: DELETE /containers/16253994b7c4?v=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **v** – 1/True/true or 0/False/false, Remove the volumes +- **v** – 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false - Status Codes: +Status Codes: - - **204** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ### Copy files or folders from a container @@ -532,7 +532,7 @@ Remove the container `id` from the filesystem Copy files or folders of container `id` - **Example request**: +**Example request**: POST /containers/4fa6e0f0c678/copy HTTP/1.1 Content-Type: application/json @@ -541,18 +541,18 @@ Copy files or folders of container `id` "Resource":"test.txt" } - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ## 2.2 Images @@ -562,11 +562,11 @@ Copy files or folders of container `id` List images `format` could be json or viz (json default) - **Example request**: +**Example request**: GET /images/json?all=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -590,11 +590,11 @@ List images `format` could be json or viz (json default) } ] - **Example request**: +**Example request**: GET /images/viz HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: text/plain @@ -617,30 +617,30 @@ List images `format` could be json or viz (json default) base [style=invisible] } - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create an image `POST /images/create` -Create an image, either by pull it from the registry or by importing it +Create an image, either by pull it from the registry or by importing i - **Example request**: +**Example request**: POST /images/create?fromImage=ubuntu HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -650,20 +650,20 @@ Create an image, either by pull it from the registry or by importing it {"error":"Invalid..."} ... - Query Parameters: +Query Parameters:   - - **fromImage** – name of the image to pull - - **fromSrc** – source to import, - means stdin - - **repo** – repository - - **tag** – tag - - **registry** – the registry to pull from +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Insert a file in an image @@ -671,11 +671,11 @@ Create an image, either by pull it from the registry or by importing it Insert a file from `url` in the image `name` at `path` - **Example request**: +**Example request**: POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -685,17 +685,15 @@ Insert a file from `url` in the image `name` at `path` {"error":"Invalid..."} ... - Query Parameters: +Query Parameters: +- **url** – The url from where the file is taken +- **path** – The path where the file is stored +Status Codes: - - **url** – The url from where the file is taken - - **path** – The path where the file is stored - - Status Codes: - - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Inspect an image @@ -703,11 +701,11 @@ Insert a file from `url` in the image `name` at `path` Return low-level information on the image `name` - **Example request**: +**Example request**: GET /images/centos/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -741,12 +739,12 @@ Return low-level information on the image `name` "Size": 6824592 } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **409** – conflict between containers and images - - **500** – server error +- **200** – no error +- **404** – no such image +- **409** – conflict between containers and images +- **500** – server error ### Get the history of an image @@ -754,11 +752,11 @@ Return low-level information on the image `name` Return the history of the image `name` - **Example request**: +**Example request**: GET /images/fedora/history HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -776,11 +774,11 @@ Return the history of the image `name` } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Push an image on the registry @@ -788,12 +786,12 @@ Return the history of the image `name` Push the image `name` on the registry - **Example request**: +**Example request**: POST /images/test/push HTTP/1.1 {{ authConfig }} - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -801,9 +799,9 @@ Push the image `name` on the registry {"status":"Pushing..."} {"status":"Pushing", "progress":"1/? (n/a)"} {"error":"Invalid..."} ... - Status Codes: +Status Codes: - - **200** – no error :statuscode 404: no such image :statuscode +- **200** – no error :statuscode 404: no such image :statuscode 500: server error ### Tag an image into a repository @@ -812,28 +810,28 @@ Push the image `name` on the registry Tag the image `name` into a repository - **Example request**: +**Example request**: POST /images/test/tag?repo=myrepo&force=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 201 OK - Query Parameters: +Query Parameters:   - - **repo** – The repository to tag in - - **force** – 1/True/true or 0/False/false, default false +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **201** – no error - - **400** – bad parameter - - **404** – no such image - - **409** – conflict - - **500** – server error +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflic +- **500** – server error ### Remove an image @@ -841,11 +839,11 @@ Tag the image `name` into a repository Remove the image `name` from the filesystem - **Example request**: +**Example request**: DELETE /images/test HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-type: application/json @@ -856,12 +854,12 @@ Remove the image `name` from the filesystem {"Deleted":"53b4f83ac9"} ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **409** – conflict - - **500** – server error +- **200** – no error +- **404** – no such image +- **409** – conflic +- **500** – server error ### Search images @@ -869,11 +867,11 @@ Remove the image `name` from the filesystem Search for an image on [Docker Hub](https://hub.docker.com) - **Example request**: +**Example request**: GET /images/search?term=sshd HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -905,13 +903,13 @@ Search for an image on [Docker Hub](https://hub.docker.com) Build an image from Dockerfile via stdin - **Example request**: +**Example request**: POST /build HTTP/1.1 {{ TAR STREAM }} - **Example response**: +**Example response**: HTTP/1.1 200 OK @@ -919,25 +917,25 @@ Build an image from Dockerfile via stdin The stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz. - The archive must include a file called Dockerfile at its root. It + The archive must include a file called Dockerfile at its root. I may include any number of other files, which will be accessible in the build context (See the ADD build command). The Content-type header should be set to "application/tar". - Query Parameters: +Query Parameters:   - - **t** – repository name (and optionally a tag) to be applied to +- **t** – repository name (and optionally a tag) to be applied to the resulting image in case of success - - **q** – suppress verbose build output - - **nocache** – do not use the cache when building the image +- **q** – suppress verbose build outpu +- **nocache** – do not use the cache when building the image - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Check auth configuration @@ -945,7 +943,7 @@ Build an image from Dockerfile via stdin Get the default username and email - **Example request**: +**Example request**: POST /auth HTTP/1.1 Content-Type: application/json @@ -957,15 +955,15 @@ Get the default username and email "serveraddress":"https://index.docker.io/v1/" } - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **204** – no error - - **500** – server error +- **200** – no error +- **204** – no error +- **500** – server error ### Display system-wide information @@ -973,11 +971,11 @@ Get the default username and email Display system-wide information - **Example request**: +**Example request**: GET /info HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -993,10 +991,10 @@ Display system-wide information "IPv4Forwarding":true } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Show the docker version information @@ -1004,26 +1002,26 @@ Display system-wide information Show the docker version information - - **Example request**: - + +**Example request**: + GET /version HTTP/1.1 - - **Example response**: - + +**Example response**: + HTTP/1.1 200 OK Content-Type: application/json - + { "Version":"0.2.2", "GitCommit":"5a2a5cc+CHANGES", "GoVersion":"go1.0.3" } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Create a new image from a container's changes @@ -1031,7 +1029,7 @@ Show the docker version information Create a new image from a container's changes - **Example request**: +**Example request**: POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 Content-Type: application/json @@ -1041,29 +1039,29 @@ Create a new image from a container's changes "PortSpecs":["22"] } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/vnd.docker.raw-stream {"Id":"596069db4bf5"} - Query Parameters: +Query Parameters:   - - **container** – source container - - **repo** – repository - - **tag** – tag - - **m** – commit message - - **author** – author (e.g., "John Hannibal Smith +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **500** – server error +- **201** – no error +- **404** – no such container +- **500** – server error ### Monitor Docker's events @@ -1072,11 +1070,11 @@ Create a new image from a container's changes Get events from docker, either in real time via streaming, or via polling (using since) - **Example request**: +**Example request**: GET /events?since=1374067924 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1086,16 +1084,16 @@ polling (using since) {"status":"stop","id":"dfdf82bd3881","from":"ubuntu:latest","time":1374067966} {"status":"destroy","id":"dfdf82bd3881","from":"ubuntu:latest","time":1374067970} - Query Parameters: +Query Parameters:   - - **since** – timestamp used for polling +- **since** – timestamp used for polling - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error # 3. Going further @@ -1106,7 +1104,7 @@ Here are the steps of `docker run` : - Create the container - If the status code is 404, it means the image doesn't exists: - - Try to pull it + - Try to pull i - Then retry to create the container - Start the container diff --git a/docs/sources/reference/api/docker_remote_api_v1.5.md b/docs/sources/reference/api/docker_remote_api_v1.5.md index 9a35ad85b0..44c3303ce9 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.5.md +++ b/docs/sources/reference/api/docker_remote_api_v1.5.md @@ -22,11 +22,11 @@ page_keywords: API, Docker, rcli, REST, documentation List containers - **Example request**: +**Example request**: GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -74,26 +74,26 @@ List containers } ] - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default - - **limit** – Show `limit` last created +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul +- **limit** – Show `limit` last created containers, include non-running ones. - - **since** – Show only containers created since Id, include +- **since** – Show only containers created since Id, include non-running ones. - - **before** – Show only containers created before Id, include +- **before** – Show only containers created before Id, include non-running ones. - - **size** – 1/True/true or 0/False/false, Show the containers +- **size** – 1/True/true or 0/False/false, Show the containers sizes - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create a container @@ -101,7 +101,7 @@ List containers Create a container - **Example request**: +**Example request**: POST /containers/create HTTP/1.1 Content-Type: application/json @@ -130,7 +130,7 @@ Create a container "WorkingDir":"" } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/json @@ -140,18 +140,18 @@ Create a container "Warnings":[] } - Json Parameters: +Json Parameters:   - - **config** – the container's configuration +- **config** – the container's configuration - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **406** – impossible to attach (container not running) - - **500** – server error +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error ### Inspect a container @@ -160,11 +160,11 @@ Create a container Return low-level information on the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -216,11 +216,11 @@ Return low-level information on the container `id` "Volumes": {} } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### List processes running inside a container @@ -228,11 +228,11 @@ Return low-level information on the container `id` List processes running inside the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/top HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -257,17 +257,17 @@ List processes running inside the container `id` ] } - Query Parameters: +Query Parameters:   - - **ps_args** – ps arguments to use (e.g., aux) +- **ps_args** – ps arguments to use (e.g., aux) - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Inspect changes on a container's filesystem @@ -275,11 +275,11 @@ List processes running inside the container `id` Inspect changes on container `id`'s filesystem - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/changes HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -299,11 +299,11 @@ Inspect changes on container `id`'s filesystem } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Export a container @@ -311,22 +311,22 @@ Inspect changes on container `id`'s filesystem Export the contents of container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/export HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Start a container @@ -334,7 +334,7 @@ Export the contents of container `id` Start the container `id` - **Example request**: +**Example request**: POST /containers/(id)/start HTTP/1.1 Content-Type: application/json @@ -344,22 +344,22 @@ Start the container `id` "LxcConf":[{"Key":"lxc.utsname","Value":"docker"}] } - **Example response**: +**Example response**: - HTTP/1.1 204 No Content + HTTP/1.1 204 No Conten Content-Type: text/plain - Json Parameters: +Json Parameters:   - - **hostConfig** – the container's host configuration (optional) +- **hostConfig** – the container's host configuration (optional) - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Stop a container @@ -367,25 +367,25 @@ Start the container `id` Stop the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/stop?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Restart a container @@ -393,25 +393,25 @@ Stop the container `id` Restart the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/restart?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Kill a container @@ -419,19 +419,19 @@ Restart the container `id` Kill the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/kill HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Attach to a container @@ -439,38 +439,38 @@ Kill the container `id` Attach to the container `id` - **Example request**: +**Example request**: POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **logs** – 1/True/true or 0/False/false, return logs. Default +- **logs** – 1/True/true or 0/False/false, return logs. Defaul false - - **stream** – 1/True/true or 0/False/false, return stream. +- **stream** – 1/True/true or 0/False/false, return stream. Default false - - **stdin** – 1/True/true or 0/False/false, if stream=true, attach +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false - - **stdout** – 1/True/true or 0/False/false, if logs=true, return +- **stdout** – 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false - - **stderr** – 1/True/true or 0/False/false, if logs=true, return +- **stderr** – 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ### Wait a container @@ -478,22 +478,22 @@ Attach to the container `id` Block until container `id` stops, then returns the exit code - **Example request**: +**Example request**: POST /containers/16253994b7c4/wait HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json {"StatusCode":0} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Remove a container @@ -501,27 +501,27 @@ Block until container `id` stops, then returns the exit code Remove the container `id` from the filesystem - **Example request**: +**Example request**: DELETE /containers/16253994b7c4?v=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **v** – 1/True/true or 0/False/false, Remove the volumes +- **v** – 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false - Status Codes: +Status Codes: - - **204** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ### Copy files or folders from a container @@ -529,7 +529,7 @@ Remove the container `id` from the filesystem Copy files or folders of container `id` - **Example request**: +**Example request**: POST /containers/4fa6e0f0c678/copy HTTP/1.1 Content-Type: application/json @@ -538,18 +538,18 @@ Copy files or folders of container `id` "Resource":"test.txt" } - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ## 2.2 Images @@ -559,11 +559,11 @@ Copy files or folders of container `id` List images `format` could be json or viz (json default) - **Example request**: +**Example request**: GET /images/json?all=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -587,11 +587,11 @@ List images `format` could be json or viz (json default) } ] - **Example request**: +**Example request**: GET /images/viz HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: text/plain @@ -614,30 +614,30 @@ List images `format` could be json or viz (json default) base [style=invisible] } - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create an image `POST /images/create` -Create an image, either by pull it from the registry or by importing it +Create an image, either by pull it from the registry or by importing i - **Example request**: +**Example request**: POST /images/create?fromImage=ubuntu HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -651,20 +651,20 @@ Create an image, either by pull it from the registry or by importing it `X-Registry-Auth` header can be used to include a base64-encoded AuthConfig object. - Query Parameters: +Query Parameters:   - - **fromImage** – name of the image to pull - - **fromSrc** – source to import, - means stdin - - **repo** – repository - - **tag** – tag - - **registry** – the registry to pull from +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Insert a file in an image @@ -672,11 +672,11 @@ Create an image, either by pull it from the registry or by importing it Insert a file from `url` in the image `name` at `path` - **Example request**: +**Example request**: POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -686,17 +686,15 @@ Insert a file from `url` in the image `name` at `path` {"error":"Invalid..."} ... - Query Parameters: +Query Parameters: +- **url** – The url from where the file is taken +- **path** – The path where the file is stored +Status Codes: - - **url** – The url from where the file is taken - - **path** – The path where the file is stored - - Status Codes: - - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Inspect an image @@ -704,11 +702,11 @@ Insert a file from `url` in the image `name` at `path` Return low-level information on the image `name` - **Example request**: +**Example request**: GET /images/centos/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -742,11 +740,11 @@ Return low-level information on the image `name` "Size": 6824592 } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Get the history of an image @@ -754,11 +752,11 @@ Return low-level information on the image `name` Return the history of the image `name` - **Example request**: +**Example request**: GET /images/fedora/history HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -776,11 +774,11 @@ Return the history of the image `name` } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Push an image on the registry @@ -788,11 +786,11 @@ Return the history of the image `name` Push the image `name` on the registry - **Example request**: +**Example request**: POST /images/test/push HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -805,11 +803,11 @@ Push the image `name` on the registry The `X-Registry-Auth` header can be used to include a base64-encoded AuthConfig object. - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Tag an image into a repository @@ -817,28 +815,28 @@ Push the image `name` on the registry Tag the image `name` into a repository - **Example request**: +**Example request**: POST /images/test/tag?repo=myrepo&force=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 201 OK - Query Parameters: +Query Parameters:   - - **repo** – The repository to tag in - - **force** – 1/True/true or 0/False/false, default false +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **201** – no error - - **400** – bad parameter - - **404** – no such image - - **409** – conflict - - **500** – server error +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflic +- **500** – server error ### Remove an image @@ -846,11 +844,11 @@ Tag the image `name` into a repository Remove the image `name` from the filesystem - **Example request**: +**Example request**: DELETE /images/test HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-type: application/json @@ -861,12 +859,12 @@ Remove the image `name` from the filesystem {"Deleted":"53b4f83ac9"} ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **409** – conflict - - **500** – server error +- **200** – no error +- **404** – no such image +- **409** – conflic +- **500** – server error ### Search images @@ -874,11 +872,11 @@ Remove the image `name` from the filesystem Search for an image on [Docker Hub](https://hub.docker.com) - **Example request**: +**Example request**: GET /images/search?term=sshd HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -898,16 +896,16 @@ Search for an image on [Docker Hub](https://hub.docker.com) } ] - Query Parameters: +Query Parameters:   - - **term** – term to search +- **term** – term to search - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ## 2.3 Misc @@ -917,13 +915,13 @@ Search for an image on [Docker Hub](https://hub.docker.com) Build an image from Dockerfile via stdin - **Example request**: +**Example request**: POST /build HTTP/1.1 {{ TAR STREAM }} - **Example response**: +**Example response**: HTTP/1.1 200 OK @@ -931,26 +929,26 @@ Build an image from Dockerfile via stdin The stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz. - The archive must include a file called Dockerfile at its root. It + The archive must include a file called Dockerfile at its root. I may include any number of other files, which will be accessible in the build context (See the ADD build command). The Content-type header should be set to "application/tar". - Query Parameters: +Query Parameters:   - - **t** – repository name (and optionally a tag) to be applied to +- **t** – repository name (and optionally a tag) to be applied to the resulting image in case of success - - **q** – suppress verbose build output - - **nocache** – do not use the cache when building the image - - **rm** – remove intermediate containers after a successful build +- **q** – suppress verbose build outpu +- **nocache** – do not use the cache when building the image +- **rm** – remove intermediate containers after a successful build - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Check auth configuration @@ -958,7 +956,7 @@ Build an image from Dockerfile via stdin Get the default username and email - **Example request**: +**Example request**: POST /auth HTTP/1.1 Content-Type: application/json @@ -970,15 +968,15 @@ Get the default username and email "serveraddress":"https://index.docker.io/v1/" } - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **204** – no error - - **500** – server error +- **200** – no error +- **204** – no error +- **500** – server error ### Display system-wide information @@ -986,11 +984,11 @@ Get the default username and email Display system-wide information - **Example request**: +**Example request**: GET /info HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1006,10 +1004,10 @@ Display system-wide information "IPv4Forwarding":true } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Show the docker version information @@ -1017,11 +1015,11 @@ Display system-wide information Show the docker version information - **Example request**: +**Example request**: GET /version HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1032,10 +1030,10 @@ Show the docker version information "GoVersion":"go1.0.3" } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Create a new image from a container's changes @@ -1043,7 +1041,7 @@ Show the docker version information Create a new image from a container's changes - **Example request**: +**Example request**: POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 Content-Type: application/json @@ -1053,29 +1051,29 @@ Create a new image from a container's changes "PortSpecs":["22"] } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/vnd.docker.raw-stream {"Id":"596069db4bf5"} - Query Parameters: +Query Parameters:   - - **container** – source container - - **repo** – repository - - **tag** – tag - - **m** – commit message - - **author** – author (e.g., "John Hannibal Smith +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **500** – server error +- **201** – no error +- **404** – no such container +- **500** – server error ### Monitor Docker's events @@ -1084,11 +1082,11 @@ Create a new image from a container's changes Get events from docker, either in real time via streaming, or via polling (using since) - **Example request**: +**Example request**: GET /events?since=1374067924 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1098,16 +1096,16 @@ polling (using since) {"status":"stop","id":"dfdf82bd3881","from":"ubuntu:latest","time":1374067966} {"status":"destroy","id":"dfdf82bd3881","from":"ubuntu:latest","time":1374067970} - Query Parameters: +Query Parameters:   - - **since** – timestamp used for polling +- **since** – timestamp used for polling - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error # 3. Going further diff --git a/docs/sources/reference/api/docker_remote_api_v1.6.md b/docs/sources/reference/api/docker_remote_api_v1.6.md index da14c69ccc..35bf8cbf01 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.6.md +++ b/docs/sources/reference/api/docker_remote_api_v1.6.md @@ -23,11 +23,11 @@ page_keywords: API, Docker, rcli, REST, documentation List containers - **Example request**: +**Example request**: GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -75,26 +75,26 @@ List containers } ] - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default - - **limit** – Show `limit` last created +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul +- **limit** – Show `limit` last created containers, include non-running ones. - - **since** – Show only containers created since Id, include +- **since** – Show only containers created since Id, include non-running ones. - - **before** – Show only containers created before Id, include +- **before** – Show only containers created before Id, include non-running ones. - - **size** – 1/True/true or 0/False/false, Show the containers +- **size** – 1/True/true or 0/False/false, Show the containers sizes - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create a container @@ -102,7 +102,7 @@ List containers Create a container - **Example request**: +**Example request**: POST /containers/create HTTP/1.1 Content-Type: application/json @@ -130,7 +130,7 @@ Create a container "WorkingDir":"" } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/json @@ -140,27 +140,27 @@ Create a container "Warnings":[] } - Json Parameters: +Json Parameters:   - - **config** – the container's configuration +- **config** – the container's configuration - Query Parameters: +Query Parameters:   - - **name** – container name to use +- **name** – container name to use - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **406** – impossible to attach (container not running) - - **500** – server error +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error **More Complex Example request, in 2 steps.** **First, use create to - expose a Private Port, which can be bound back to a Public Port at + expose a Private Port, which can be bound back to a Public Port a startup**: POST /containers/create HTTP/1.1 @@ -174,7 +174,7 @@ Create a container "ExposedPorts":{"22/tcp":{}} } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/json @@ -184,7 +184,7 @@ Create a container "Warnings":[] } - **Second, start (using the ID returned above) the image we just + **Second, start (using the ID returned above) the image we jus created, mapping the ssh port 22 to something on the host**: POST /containers/e90e34656806/start HTTP/1.1 @@ -194,9 +194,9 @@ Create a container "PortBindings": { "22/tcp": [{ "HostPort": "11022" }]} } - **Example response**: +**Example response**: - HTTP/1.1 204 No Content + HTTP/1.1 204 No Conten Content-Type: text/plain; charset=utf-8 Content-Length: 0 @@ -209,11 +209,11 @@ Create a container Return low-level information on the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -266,11 +266,11 @@ Return low-level information on the container `id` "Volumes": {} } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### List processes running inside a container @@ -278,11 +278,11 @@ Return low-level information on the container `id` List processes running inside the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/top HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -307,17 +307,17 @@ List processes running inside the container `id` ] } - Query Parameters: +Query Parameters:   - - **ps_args** – ps arguments to use (e.g., aux) +- **ps_args** – ps arguments to use (e.g., aux) - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Inspect changes on a container's filesystem @@ -325,11 +325,11 @@ List processes running inside the container `id` Inspect changes on container `id`'s filesystem - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/changes HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -349,11 +349,11 @@ Inspect changes on container `id`'s filesystem } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Export a container @@ -361,22 +361,22 @@ Inspect changes on container `id`'s filesystem Export the contents of container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/export HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Start a container @@ -384,7 +384,7 @@ Export the contents of container `id` Start the container `id` - **Example request**: +**Example request**: POST /containers/(id)/start HTTP/1.1 Content-Type: application/json @@ -399,22 +399,22 @@ Start the container `id` "PublishAllPorts": false } - **Example response**: +**Example response**: - HTTP/1.1 204 No Content + HTTP/1.1 204 No Conten Content-Type: text/plain - Json Parameters: +Json Parameters:   - - **hostConfig** – the container's host configuration (optional) +- **hostConfig** – the container's host configuration (optional) - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Stop a container @@ -422,25 +422,25 @@ Start the container `id` Stop the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/stop?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Restart a container @@ -448,25 +448,25 @@ Stop the container `id` Restart the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/restart?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Kill a container @@ -474,27 +474,27 @@ Restart the container `id` Kill the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/kill HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **signal** – Signal to send to the container (integer). When not +- **signal** – Signal to send to the container (integer). When no set, SIGKILL is assumed and the call will waits for the container to exit. - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Attach to a container @@ -502,38 +502,38 @@ Kill the container `id` Attach to the container `id` - **Example request**: +**Example request**: POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **logs** – 1/True/true or 0/False/false, return logs. Default +- **logs** – 1/True/true or 0/False/false, return logs. Defaul false - - **stream** – 1/True/true or 0/False/false, return stream. +- **stream** – 1/True/true or 0/False/false, return stream. Default false - - **stdin** – 1/True/true or 0/False/false, if stream=true, attach +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false - - **stdout** – 1/True/true or 0/False/false, if logs=true, return +- **stdout** – 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false - - **stderr** – 1/True/true or 0/False/false, if logs=true, return +- **stderr** – 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error **Stream details**: @@ -558,9 +558,9 @@ Attach to the container `id` `STREAM_TYPE` can be: - - 0: stdin (will be written on stdout) - - 1: stdout - - 2: stderr +- 0: stdin (will be written on stdout) +- 1: stdou +- 2: stderr `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of the uint32 size encoded as big endian. @@ -576,7 +576,7 @@ Attach to the container `id` 1. Read 8 bytes 2. chose stdout or stderr depending on the first byte 3. Extract the frame size from the last 4 byets - 4. Read the extracted size and output it on the correct output + 4. Read the extracted size and output it on the correct outpu 5. Goto 1) ### Wait a container @@ -585,22 +585,22 @@ Attach to the container `id` Block until container `id` stops, then returns the exit code - **Example request**: +**Example request**: POST /containers/16253994b7c4/wait HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json {"StatusCode":0} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Remove a container @@ -608,27 +608,27 @@ Block until container `id` stops, then returns the exit code Remove the container `id` from the filesystem - **Example request**: +**Example request**: DELETE /containers/16253994b7c4?v=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **v** – 1/True/true or 0/False/false, Remove the volumes +- **v** – 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false - Status Codes: +Status Codes: - - **204** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ### Copy files or folders from a container @@ -636,7 +636,7 @@ Remove the container `id` from the filesystem Copy files or folders of container `id` - **Example request**: +**Example request**: POST /containers/4fa6e0f0c678/copy HTTP/1.1 Content-Type: application/json @@ -645,18 +645,18 @@ Copy files or folders of container `id` "Resource":"test.txt" } - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ## 2.2 Images @@ -666,11 +666,11 @@ Copy files or folders of container `id` List images `format` could be json or viz (json default) - **Example request**: +**Example request**: GET /images/json?all=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -694,11 +694,11 @@ List images `format` could be json or viz (json default) } ] - **Example request**: +**Example request**: GET /images/viz HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: text/plain @@ -721,30 +721,30 @@ List images `format` could be json or viz (json default) base [style=invisible] } - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create an image `POST /images/create` -Create an image, either by pull it from the registry or by importing it +Create an image, either by pull it from the registry or by importing i - **Example request**: +**Example request**: POST /images/create?fromImage=base HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -758,20 +758,20 @@ Create an image, either by pull it from the registry or by importing it `X-Registry-Auth` header can be used to include a base64-encoded AuthConfig object. - Query Parameters: +Query Parameters:   - - **fromImage** – name of the image to pull - - **fromSrc** – source to import, - means stdin - - **repo** – repository - - **tag** – tag - - **registry** – the registry to pull from +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Insert a file in an image @@ -779,11 +779,11 @@ Create an image, either by pull it from the registry or by importing it Insert a file from `url` in the image `name` at `path` - **Example request**: +**Example request**: POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -793,17 +793,15 @@ Insert a file from `url` in the image `name` at `path` {"error":"Invalid..."} ... - Query Parameters: +Query Parameters: +- **url** – The url from where the file is taken +- **path** – The path where the file is stored +Status Codes: - - **url** – The url from where the file is taken - - **path** – The path where the file is stored - - Status Codes: - - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Inspect an image @@ -811,11 +809,11 @@ Insert a file from `url` in the image `name` at `path` Return low-level information on the image `name` - **Example request**: +**Example request**: GET /images/base/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -849,11 +847,11 @@ Return low-level information on the image `name` "Size": 6824592 } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Get the history of an image @@ -861,11 +859,11 @@ Return low-level information on the image `name` Return the history of the image `name` - **Example request**: +**Example request**: GET /images/base/history HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -883,11 +881,11 @@ Return the history of the image `name` } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Push an image on the registry @@ -895,11 +893,11 @@ Return the history of the image `name` Push the image `name` on the registry - **Example request**: +**Example request**: POST /images/test/push HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -910,9 +908,9 @@ Push the image `name` on the registry > The `X-Registry-Auth` header can be used to > include a base64-encoded AuthConfig object. - Status Codes: +Status Codes: - - **200** – no error :statuscode 404: no such image :statuscode +- **200** – no error :statuscode 404: no such image :statuscode 500: server error ### Tag an image into a repository @@ -921,28 +919,28 @@ Push the image `name` on the registry Tag the image `name` into a repository - **Example request**: +**Example request**: POST /images/test/tag?repo=myrepo&force=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 201 OK - Query Parameters: +Query Parameters:   - - **repo** – The repository to tag in - - **force** – 1/True/true or 0/False/false, default false +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **201** – no error - - **400** – bad parameter - - **404** – no such image - - **409** – conflict - - **500** – server error +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflic +- **500** – server error ### Remove an image @@ -950,11 +948,11 @@ Tag the image `name` into a repository Remove the image `name` from the filesystem - **Example request**: +**Example request**: DELETE /images/test HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-type: application/json @@ -965,12 +963,12 @@ Remove the image `name` from the filesystem {"Deleted":"53b4f83ac9"} ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **409** – conflict - - **500** – server error +- **200** – no error +- **404** – no such image +- **409** – conflic +- **500** – server error ### Search images @@ -978,11 +976,11 @@ Remove the image `name` from the filesystem Search for an image on [Docker Hub](https://hub.docker.com) - **Example request**: +**Example request**: GET /images/search?term=sshd HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1014,13 +1012,13 @@ Search for an image on [Docker Hub](https://hub.docker.com) Build an image from Dockerfile via stdin - **Example request**: +**Example request**: POST /build HTTP/1.1 {{ TAR STREAM }} - **Example response**: +**Example response**: HTTP/1.1 200 OK @@ -1028,25 +1026,25 @@ Build an image from Dockerfile via stdin The stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz. - The archive must include a file called Dockerfile at its root. It + The archive must include a file called Dockerfile at its root. I may include any number of other files, which will be accessible in the build context (See the ADD build command). The Content-type header should be set to "application/tar". - Query Parameters: +Query Parameters:   - - **t** – repository name (and optionally a tag) to be applied to +- **t** – repository name (and optionally a tag) to be applied to the resulting image in case of success - - **q** – suppress verbose build output - - **nocache** – do not use the cache when building the image +- **q** – suppress verbose build outpu +- **nocache** – do not use the cache when building the image - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Check auth configuration @@ -1054,7 +1052,7 @@ Build an image from Dockerfile via stdin Get the default username and email - **Example request**: +**Example request**: POST /auth HTTP/1.1 Content-Type: application/json @@ -1066,15 +1064,15 @@ Get the default username and email "serveraddress":"https://index.docker.io/v1/" } - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **204** – no error - - **500** – server error +- **200** – no error +- **204** – no error +- **500** – server error ### Display system-wide information @@ -1082,11 +1080,11 @@ Get the default username and email Display system-wide information - **Example request**: +**Example request**: GET /info HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1102,10 +1100,10 @@ Display system-wide information "IPv4Forwarding":true } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Show the docker version information @@ -1113,11 +1111,11 @@ Display system-wide information Show the docker version information - **Example request**: +**Example request**: GET /version HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1128,10 +1126,10 @@ Show the docker version information "GoVersion":"go1.0.3" } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Create a new image from a container's changes @@ -1139,7 +1137,7 @@ Show the docker version information Create a new image from a container's changes - **Example request**: +**Example request**: POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 Content-Type: application/json @@ -1149,29 +1147,29 @@ Create a new image from a container's changes "ExposedPorts":{"22/tcp":{}} } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/vnd.docker.raw-stream {"Id":"596069db4bf5"} - Query Parameters: +Query Parameters:   - - **container** – source container - - **repo** – repository - - **tag** – tag - - **m** – commit message - - **author** – author (e.g., "John Hannibal Smith +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **500** – server error +- **201** – no error +- **404** – no such container +- **500** – server error ### Monitor Docker's events @@ -1180,11 +1178,11 @@ Create a new image from a container's changes Get events from docker, either in real time via streaming, or via polling (using since) - **Example request**: +**Example request**: GET /events?since=1374067924 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1194,16 +1192,16 @@ polling (using since) {"status":"stop","id":"dfdf82bd3881","from":"base:latest","time":1374067966} {"status":"destroy","id":"dfdf82bd3881","from":"base:latest","time":1374067970} - Query Parameters: +Query Parameters:   - - **since** – timestamp used for polling +- **since** – timestamp used for polling - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error # 3. Going further @@ -1214,7 +1212,7 @@ Here are the steps of `docker run` : - Create the container - If the status code is 404, it means the image doesn't exists: - - Try to pull it + - Try to pull i - Then retry to create the container - Start the container diff --git a/docs/sources/reference/api/docker_remote_api_v1.7.md b/docs/sources/reference/api/docker_remote_api_v1.7.md index 56207fc3ed..8da35ca59f 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.7.md +++ b/docs/sources/reference/api/docker_remote_api_v1.7.md @@ -23,11 +23,11 @@ page_keywords: API, Docker, rcli, REST, documentation List containers - **Example request**: +**Example request**: GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -75,26 +75,24 @@ List containers } ] - Query Parameters: +Query Parameters: -   - - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default - - **limit** – Show `limit` last created +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul +- **limit** – Show `limit` last created containers, include non-running ones. - - **since** – Show only containers created since Id, include +- **since** – Show only containers created since Id, include non-running ones. - - **before** – Show only containers created before Id, include +- **before** – Show only containers created before Id, include non-running ones. - - **size** – 1/True/true or 0/False/false, Show the containers +- **size** – 1/True/true or 0/False/false, Show the containers sizes - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create a container @@ -102,7 +100,7 @@ List containers Create a container - **Example request**: +**Example request**: POST /containers/create HTTP/1.1 Content-Type: application/json @@ -135,7 +133,7 @@ Create a container } } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/json @@ -145,18 +143,16 @@ Create a container "Warnings":[] } - Json Parameters: +Json Parameters: -   +- **config** – the container's configuration - - **config** – the container's configuration +Status Codes: - Status Codes: - - - **201** – no error - - **404** – no such container - - **406** – impossible to attach (container not running) - - **500** – server error +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error ### Inspect a container @@ -165,11 +161,11 @@ Create a container Return low-level information on the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -222,11 +218,11 @@ Return low-level information on the container `id` "Volumes": {} } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### List processes running inside a container @@ -234,11 +230,11 @@ Return low-level information on the container `id` List processes running inside the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/top HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -263,17 +259,15 @@ List processes running inside the container `id` ] } - Query Parameters: +Query Parameters: -   +- **ps_args** – ps arguments to use (e.g., aux) - - **ps_args** – ps arguments to use (e.g., aux) +Status Codes: - Status Codes: - - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Inspect changes on a container's filesystem @@ -281,11 +275,11 @@ List processes running inside the container `id` Inspect changes on container `id`'s filesystem - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/changes HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -305,11 +299,11 @@ Inspect changes on container `id`'s filesystem } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Export a container @@ -317,22 +311,22 @@ Inspect changes on container `id`'s filesystem Export the contents of container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/export HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Start a container @@ -340,7 +334,7 @@ Export the contents of container `id` Start the container `id` - **Example request**: +**Example request**: POST /containers/(id)/start HTTP/1.1 Content-Type: application/json @@ -356,22 +350,20 @@ Start the container `id` Binds need to reference Volumes that were defined during container creation. - **Example response**: +**Example response**: - HTTP/1.1 204 No Content + HTTP/1.1 204 No Conten Content-Type: text/plain - Json Parameters: +Json Parameters: -   +- **hostConfig** – the container's host configuration (optional) - - **hostConfig** – the container's host configuration (optional) +Status Codes: - Status Codes: - - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Stop a container @@ -379,25 +371,25 @@ Start the container `id` Stop the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/stop?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Restart a container @@ -405,25 +397,25 @@ Stop the container `id` Restart the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/restart?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Kill a container @@ -431,19 +423,19 @@ Restart the container `id` Kill the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/kill HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Attach to a container @@ -451,38 +443,38 @@ Kill the container `id` Attach to the container `id` - **Example request**: +**Example request**: POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **logs** – 1/True/true or 0/False/false, return logs. Default +- **logs** – 1/True/true or 0/False/false, return logs. Defaul false - - **stream** – 1/True/true or 0/False/false, return stream. +- **stream** – 1/True/true or 0/False/false, return stream. Default false - - **stdin** – 1/True/true or 0/False/false, if stream=true, attach +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false - - **stdout** – 1/True/true or 0/False/false, if logs=true, return +- **stdout** – 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false - - **stderr** – 1/True/true or 0/False/false, if logs=true, return +- **stderr** – 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error **Stream details**: @@ -507,9 +499,9 @@ Attach to the container `id` `STREAM_TYPE` can be: - - 0: stdin (will be written on stdout) - - 1: stdout - - 2: stderr +- 0: stdin (will be written on stdout) +- 1: stdou +- 2: stderr `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of the uint32 size encoded as big endian. @@ -525,7 +517,7 @@ Attach to the container `id` 1. Read 8 bytes 2. chose stdout or stderr depending on the first byte 3. Extract the frame size from the last 4 byets - 4. Read the extracted size and output it on the correct output + 4. Read the extracted size and output it on the correct outpu 5. Goto 1) ### Wait a container @@ -534,22 +526,22 @@ Attach to the container `id` Block until container `id` stops, then returns the exit code - **Example request**: +**Example request**: POST /containers/16253994b7c4/wait HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json {"StatusCode":0} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Remove a container @@ -557,27 +549,27 @@ Block until container `id` stops, then returns the exit code Remove the container `id` from the filesystem - **Example request**: +**Example request**: DELETE /containers/16253994b7c4?v=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **v** – 1/True/true or 0/False/false, Remove the volumes +- **v** – 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false - Status Codes: +Status Codes: - - **204** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ### Copy files or folders from a container @@ -585,7 +577,7 @@ Remove the container `id` from the filesystem Copy files or folders of container `id` - **Example request**: +**Example request**: POST /containers/4fa6e0f0c678/copy HTTP/1.1 Content-Type: application/json @@ -594,18 +586,18 @@ Copy files or folders of container `id` "Resource":"test.txt" } - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ## 2.2 Images @@ -617,7 +609,7 @@ Copy files or folders of container `id` GET /images/json?all=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -651,13 +643,13 @@ Copy files or folders of container `id` `POST /images/create` -Create an image, either by pull it from the registry or by importing it +Create an image, either by pull it from the registry or by importing i - **Example request**: +**Example request**: POST /images/create?fromImage=base HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -671,26 +663,26 @@ Create an image, either by pull it from the registry or by importing it `X-Registry-Auth` header can be used to include a base64-encoded AuthConfig object. - Query Parameters: +Query Parameters:   - - **fromImage** – name of the image to pull - - **fromSrc** – source to import, - means stdin - - **repo** – repository - - **tag** – tag - - **registry** – the registry to pull from +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from Request Headers:   - - **X-Registry-Auth** – base64-encoded AuthConfig object +- **X-Registry-Auth** – base64-encoded AuthConfig objec - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Insert a file in an image @@ -698,11 +690,11 @@ Create an image, either by pull it from the registry or by importing it Insert a file from `url` in the image `name` at `path` - **Example request**: +**Example request**: POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -712,17 +704,15 @@ Insert a file from `url` in the image `name` at `path` {"error":"Invalid..."} ... - Query Parameters: +Query Parameters: +- **url** – The url from where the file is taken +- **path** – The path where the file is stored +Status Codes: - - **url** – The url from where the file is taken - - **path** – The path where the file is stored - - Status Codes: - - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Inspect an image @@ -730,11 +720,11 @@ Insert a file from `url` in the image `name` at `path` Return low-level information on the image `name` - **Example request**: +**Example request**: GET /images/base/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -768,11 +758,11 @@ Return low-level information on the image `name` "Size": 6824592 } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Get the history of an image @@ -780,11 +770,11 @@ Return low-level information on the image `name` Return the history of the image `name` - **Example request**: +**Example request**: GET /images/base/history HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -802,11 +792,11 @@ Return the history of the image `name` } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Push an image on the registry @@ -814,11 +804,11 @@ Return the history of the image `name` Push the image `name` on the registry - **Example request**: +**Example request**: POST /images/test/push HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -832,14 +822,14 @@ Push the image `name` on the registry   - - **X-Registry-Auth** – include a base64-encoded AuthConfig +- **X-Registry-Auth** – include a base64-encoded AuthConfig object. - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Tag an image into a repository @@ -847,28 +837,28 @@ Push the image `name` on the registry Tag the image `name` into a repository - **Example request**: +**Example request**: POST /images/test/tag?repo=myrepo&force=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 201 OK - Query Parameters: +Query Parameters:   - - **repo** – The repository to tag in - - **force** – 1/True/true or 0/False/false, default false +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **201** – no error - - **400** – bad parameter - - **404** – no such image - - **409** – conflict - - **500** – server error +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflic +- **500** – server error ### Remove an image @@ -876,11 +866,11 @@ Tag the image `name` into a repository Remove the image `name` from the filesystem - **Example request**: +**Example request**: DELETE /images/test HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-type: application/json @@ -891,12 +881,12 @@ Remove the image `name` from the filesystem {"Deleted":"53b4f83ac9"} ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **409** – conflict - - **500** – server error +- **200** – no error +- **404** – no such image +- **409** – conflic +- **500** – server error ### Search images @@ -908,11 +898,11 @@ Search for an image on [Docker Hub](https://hub.docker.com). > The response keys have changed from API v1.6 to reflect the JSON > sent by the registry server to the docker daemon's request. - **Example request**: +**Example request**: GET /images/search?term=sshd HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -942,16 +932,16 @@ Search for an image on [Docker Hub](https://hub.docker.com). ... ] - Query Parameters: +Query Parameters:   - - **term** – term to search +- **term** – term to search - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ## 2.3 Misc @@ -961,13 +951,13 @@ Search for an image on [Docker Hub](https://hub.docker.com). Build an image from Dockerfile via stdin - **Example request**: +**Example request**: POST /build HTTP/1.1 {{ TAR STREAM }} - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -982,26 +972,26 @@ Build an image from Dockerfile via stdin which will be accessible in the build context (See the [*ADD build command*](/builder/#dockerbuilder)). - Query Parameters: +Query Parameters:   - - **t** – repository name (and optionally a tag) to be applied to +- **t** – repository name (and optionally a tag) to be applied to the resulting image in case of success - - **q** – suppress verbose build output - - **nocache** – do not use the cache when building the image +- **q** – suppress verbose build outpu +- **nocache** – do not use the cache when building the image Request Headers:   - - **Content-type** – should be set to +- **Content-type** – should be set to `"application/tar"`. - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Check auth configuration @@ -1009,7 +999,7 @@ Build an image from Dockerfile via stdin Get the default username and email - **Example request**: +**Example request**: POST /auth HTTP/1.1 Content-Type: application/json @@ -1021,15 +1011,15 @@ Get the default username and email "serveraddress":"https://index.docker.io/v1/" } - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **204** – no error - - **500** – server error +- **200** – no error +- **204** – no error +- **500** – server error ### Display system-wide information @@ -1037,11 +1027,11 @@ Get the default username and email Display system-wide information - **Example request**: +**Example request**: GET /info HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1057,10 +1047,10 @@ Display system-wide information "IPv4Forwarding":true } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Show the docker version information @@ -1068,11 +1058,11 @@ Display system-wide information Show the docker version information - **Example request**: +**Example request**: GET /version HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1083,10 +1073,10 @@ Show the docker version information "GoVersion":"go1.0.3" } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Create a new image from a container's changes @@ -1094,35 +1084,35 @@ Show the docker version information Create a new image from a container's changes - **Example request**: +**Example request**: POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/vnd.docker.raw-stream {"Id":"596069db4bf5"} - Query Parameters: +Query Parameters:   - - **container** – source container - - **repo** – repository - - **tag** – tag - - **m** – commit message - - **author** – author (e.g., "John Hannibal Smith +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") - - **run** – config automatically applied when the image is run. +- **run** – config automatically applied when the image is run. (ex: {"Cmd": ["cat", "/world"], "PortSpecs":["22"]}) - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **500** – server error +- **201** – no error +- **404** – no such container +- **500** – server error ### Monitor Docker's events @@ -1131,11 +1121,11 @@ Create a new image from a container's changes Get events from docker, either in real time via streaming, or via polling (using since) - **Example request**: +**Example request**: GET /events?since=1374067924 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1145,16 +1135,16 @@ polling (using since) {"status":"stop","id":"dfdf82bd3881","from":"base:latest","time":1374067966} {"status":"destroy","id":"dfdf82bd3881","from":"base:latest","time":1374067970} - Query Parameters: +Query Parameters:   - - **since** – timestamp used for polling +- **since** – timestamp used for polling - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Get a tarball containing all images and tags in a repository @@ -1163,11 +1153,11 @@ polling (using since) Get a tarball containing all images and metadata for the repository specified by `name`. - **Example request** +**Example request** - GET /images/ubuntu/get + GET /images/ubuntu/ge - **Example response**: +**Example response**: .. sourcecode:: http @@ -1184,7 +1174,7 @@ specified by `name`. Load a set of images and tags into the docker repository. - **Example request** +**Example request** POST /images/load @@ -1208,7 +1198,7 @@ Here are the steps of `docker run` : - Create the container - If the status code is 404, it means the image doesn't exists: - - Try to pull it + - Try to pull i - Then retry to create the container - Start the container diff --git a/docs/sources/reference/api/docker_remote_api_v1.8.md b/docs/sources/reference/api/docker_remote_api_v1.8.md index b780dfeb96..de9a16d5ae 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.8.md +++ b/docs/sources/reference/api/docker_remote_api_v1.8.md @@ -23,11 +23,11 @@ page_keywords: API, Docker, rcli, REST, documentation List containers - **Example request**: +**Example request**: GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -75,26 +75,26 @@ List containers } ] - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default - - **limit** – Show `limit` last created +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul +- **limit** – Show `limit` last created containers, include non-running ones. - - **since** – Show only containers created since Id, include +- **since** – Show only containers created since Id, include non-running ones. - - **before** – Show only containers created before Id, include +- **before** – Show only containers created before Id, include non-running ones. - - **size** – 1/True/true or 0/False/false, Show the containers +- **size** – 1/True/true or 0/False/false, Show the containers sizes - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create a container @@ -102,7 +102,7 @@ List containers Create a container - **Example request**: +**Example request**: POST /containers/create HTTP/1.1 Content-Type: application/json @@ -136,7 +136,7 @@ Create a container } } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/json @@ -146,38 +146,38 @@ Create a container "Warnings":[] } - Json Parameters: +Json Parameters:   - - **Hostname** – Container host name - - **User** – Username or UID - - **Memory** – Memory Limit in bytes - - **CpuShares** – CPU shares (relative weight) - - **AttachStdin** – 1/True/true or 0/False/false, attach to +- **Hostname** – Container host name +- **User** – Username or UID +- **Memory** – Memory Limit in bytes +- **CpuShares** – CPU shares (relative weight) +- **AttachStdin** – 1/True/true or 0/False/false, attach to standard input. Default false - - **AttachStdout** – 1/True/true or 0/False/false, attach to +- **AttachStdout** – 1/True/true or 0/False/false, attach to standard output. Default false - - **AttachStderr** – 1/True/true or 0/False/false, attach to +- **AttachStderr** – 1/True/true or 0/False/false, attach to standard error. Default false - - **Tty** – 1/True/true or 0/False/false, allocate a pseudo-tty. +- **Tty** – 1/True/true or 0/False/false, allocate a pseudo-tty. Default false - - **OpenStdin** – 1/True/true or 0/False/false, keep stdin open +- **OpenStdin** – 1/True/true or 0/False/false, keep stdin open even if not attached. Default false - Query Parameters: +Query Parameters:   - - **name** – Assign the specified name to the container. Must +- **name** – Assign the specified name to the container. Mus match `/?[a-zA-Z0-9_-]+`. - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **406** – impossible to attach (container not running) - - **500** – server error +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error ### Inspect a container @@ -185,11 +185,11 @@ Create a container Return low-level information on the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -258,11 +258,11 @@ Return low-level information on the container `id` } } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### List processes running inside a container @@ -270,11 +270,11 @@ Return low-level information on the container `id` List processes running inside the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/top HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -299,17 +299,17 @@ List processes running inside the container `id` ] } - Query Parameters: +Query Parameters:   - - **ps_args** – ps arguments to use (e.g., aux) +- **ps_args** – ps arguments to use (e.g., aux) - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Inspect changes on a container's filesystem @@ -317,11 +317,11 @@ List processes running inside the container `id` Inspect changes on container `id`'s filesystem - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/changes HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -341,11 +341,11 @@ Inspect changes on container `id`'s filesystem } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Export a container @@ -353,22 +353,22 @@ Inspect changes on container `id`'s filesystem Export the contents of container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/export HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Start a container @@ -376,7 +376,7 @@ Export the contents of container `id` Start the container `id` - **Example request**: +**Example request**: POST /containers/(id)/start HTTP/1.1 Content-Type: application/json @@ -389,31 +389,31 @@ Start the container `id` "Privileged":false } - **Example response**: +**Example response**: - HTTP/1.1 204 No Content + HTTP/1.1 204 No Conten Content-Type: text/plain - Json Parameters: +Json Parameters:   - - **Binds** – Create a bind mount to a directory or file with +- **Binds** – Create a bind mount to a directory or file with [host-path]:[container-path]:[rw|ro]. If a directory "container-path" is missing, then docker creates a new volume. - - **LxcConf** – Map of custom lxc options - - **PortBindings** – Expose ports from the container, optionally +- **LxcConf** – Map of custom lxc options +- **PortBindings** – Expose ports from the container, optionally publishing them via the HostPort flag - - **PublishAllPorts** – 1/True/true or 0/False/false, publish all +- **PublishAllPorts** – 1/True/true or 0/False/false, publish all exposed ports to the host interfaces. Default false - - **Privileged** – 1/True/true or 0/False/false, give extended +- **Privileged** – 1/True/true or 0/False/false, give extended privileges to this container. Default false - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Stop a container @@ -421,25 +421,25 @@ Start the container `id` Stop the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/stop?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Restart a container @@ -447,25 +447,25 @@ Stop the container `id` Restart the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/restart?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Kill a container @@ -473,19 +473,19 @@ Restart the container `id` Kill the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/kill HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Attach to a container @@ -493,38 +493,38 @@ Kill the container `id` Attach to the container `id` - **Example request**: +**Example request**: POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **logs** – 1/True/true or 0/False/false, return logs. Default +- **logs** – 1/True/true or 0/False/false, return logs. Defaul false - - **stream** – 1/True/true or 0/False/false, return stream. +- **stream** – 1/True/true or 0/False/false, return stream. Default false - - **stdin** – 1/True/true or 0/False/false, if stream=true, attach +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false - - **stdout** – 1/True/true or 0/False/false, if logs=true, return +- **stdout** – 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false - - **stderr** – 1/True/true or 0/False/false, if logs=true, return +- **stderr** – 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error **Stream details**: @@ -549,9 +549,9 @@ Attach to the container `id` `STREAM_TYPE` can be: - - 0: stdin (will be written on stdout) - - 1: stdout - - 2: stderr +- 0: stdin (will be written on stdout) +- 1: stdou +- 2: stderr `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of the uint32 size encoded as big endian. @@ -567,7 +567,7 @@ Attach to the container `id` 1. Read 8 bytes 2. chose stdout or stderr depending on the first byte 3. Extract the frame size from the last 4 byets - 4. Read the extracted size and output it on the correct output + 4. Read the extracted size and output it on the correct outpu 5. Goto 1) ### Wait a container @@ -576,22 +576,22 @@ Attach to the container `id` Block until container `id` stops, then returns the exit code - **Example request**: +**Example request**: POST /containers/16253994b7c4/wait HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json {"StatusCode":0} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Remove a container @@ -599,27 +599,27 @@ Block until container `id` stops, then returns the exit code Remove the container `id` from the filesystem - **Example request**: +**Example request**: DELETE /containers/16253994b7c4?v=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **v** – 1/True/true or 0/False/false, Remove the volumes +- **v** – 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false - Status Codes: +Status Codes: - - **204** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ### Copy files or folders from a container @@ -627,7 +627,7 @@ Remove the container `id` from the filesystem Copy files or folders of container `id` - **Example request**: +**Example request**: POST /containers/4fa6e0f0c678/copy HTTP/1.1 Content-Type: application/json @@ -636,18 +636,18 @@ Copy files or folders of container `id` "Resource":"test.txt" } - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ## 2.2 Images @@ -659,7 +659,7 @@ Copy files or folders of container `id` GET /images/json?all=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -693,13 +693,13 @@ Copy files or folders of container `id` `POST /images/create` -Create an image, either by pull it from the registry or by importing it +Create an image, either by pull it from the registry or by importing i - **Example request**: +**Example request**: POST /images/create?fromImage=base HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -713,26 +713,26 @@ Create an image, either by pull it from the registry or by importing it `X-Registry-Auth` header can be used to include a base64-encoded AuthConfig object. - Query Parameters: +Query Parameters:   - - **fromImage** – name of the image to pull - - **fromSrc** – source to import, - means stdin - - **repo** – repository - - **tag** – tag - - **registry** – the registry to pull from +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from Request Headers:   - - **X-Registry-Auth** – base64-encoded AuthConfig object +- **X-Registry-Auth** – base64-encoded AuthConfig objec - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Insert a file in an image @@ -740,11 +740,11 @@ Create an image, either by pull it from the registry or by importing it Insert a file from `url` in the image `name` at `path` - **Example request**: +**Example request**: POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -754,17 +754,15 @@ Insert a file from `url` in the image `name` at `path` {"error":"Invalid..."} ... - Query Parameters: +Query Parameters: +- **url** – The url from where the file is taken +- **path** – The path where the file is stored +Status Codes: - - **url** – The url from where the file is taken - - **path** – The path where the file is stored - - Status Codes: - - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Inspect an image @@ -772,11 +770,11 @@ Insert a file from `url` in the image `name` at `path` Return low-level information on the image `name` - **Example request**: +**Example request**: GET /images/base/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -810,11 +808,11 @@ Return low-level information on the image `name` "Size": 6824592 } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Get the history of an image @@ -822,11 +820,11 @@ Return low-level information on the image `name` Return the history of the image `name` - **Example request**: +**Example request**: GET /images/base/history HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -844,11 +842,11 @@ Return the history of the image `name` } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Push an image on the registry @@ -856,11 +854,11 @@ Return the history of the image `name` Push the image `name` on the registry - **Example request**: +**Example request**: POST /images/test/push HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -874,14 +872,14 @@ Push the image `name` on the registry   - - **X-Registry-Auth** – include a base64-encoded AuthConfig +- **X-Registry-Auth** – include a base64-encoded AuthConfig object. - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Tag an image into a repository @@ -889,28 +887,28 @@ Push the image `name` on the registry Tag the image `name` into a repository - **Example request**: +**Example request**: POST /images/test/tag?repo=myrepo&force=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 201 OK - Query Parameters: +Query Parameters:   - - **repo** – The repository to tag in - - **force** – 1/True/true or 0/False/false, default false +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **201** – no error - - **400** – bad parameter - - **404** – no such image - - **409** – conflict - - **500** – server error +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflic +- **500** – server error ### Remove an image @@ -918,11 +916,11 @@ Tag the image `name` into a repository Remove the image `name` from the filesystem - **Example request**: +**Example request**: DELETE /images/test HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-type: application/json @@ -933,12 +931,12 @@ Remove the image `name` from the filesystem {"Deleted":"53b4f83ac9"} ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **409** – conflict - - **500** – server error +- **200** – no error +- **404** – no such image +- **409** – conflic +- **500** – server error ### Search images @@ -950,11 +948,11 @@ Search for an image on [Docker Hub](https://hub.docker.com). > The response keys have changed from API v1.6 to reflect the JSON > sent by the registry server to the docker daemon's request. - **Example request**: +**Example request**: GET /images/search?term=sshd HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -984,16 +982,16 @@ Search for an image on [Docker Hub](https://hub.docker.com). ... ] - Query Parameters: +Query Parameters:   - - **term** – term to search +- **term** – term to search - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ## 2.3 Misc @@ -1003,13 +1001,13 @@ Search for an image on [Docker Hub](https://hub.docker.com). Build an image from Dockerfile via stdin - **Example request**: +**Example request**: POST /build HTTP/1.1 {{ TAR STREAM }} - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1026,27 +1024,27 @@ Build an image from Dockerfile via stdin which will be accessible in the build context (See the [*ADD build command*](/reference/builder/#dockerbuilder)). - Query Parameters: +Query Parameters:   - - **t** – repository name (and optionally a tag) to be applied to +- **t** – repository name (and optionally a tag) to be applied to the resulting image in case of success - - **q** – suppress verbose build output - - **nocache** – do not use the cache when building the image +- **q** – suppress verbose build outpu +- **nocache** – do not use the cache when building the image Request Headers:   - - **Content-type** – should be set to +- **Content-type** – should be set to `"application/tar"`. - - **X-Registry-Auth** – base64-encoded AuthConfig object +- **X-Registry-Auth** – base64-encoded AuthConfig objec - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Check auth configuration @@ -1054,7 +1052,7 @@ Build an image from Dockerfile via stdin Get the default username and email - **Example request**: +**Example request**: POST /auth HTTP/1.1 Content-Type: application/json @@ -1066,15 +1064,15 @@ Get the default username and email "serveraddress":"https://index.docker.io/v1/" } - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **204** – no error - - **500** – server error +- **200** – no error +- **204** – no error +- **500** – server error ### Display system-wide information @@ -1082,11 +1080,11 @@ Get the default username and email Display system-wide information - **Example request**: +**Example request**: GET /info HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1102,10 +1100,10 @@ Display system-wide information "IPv4Forwarding":true } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Show the docker version information @@ -1113,11 +1111,11 @@ Display system-wide information Show the docker version information - **Example request**: +**Example request**: GET /version HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1128,10 +1126,10 @@ Show the docker version information "GoVersion":"go1.0.3" } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Create a new image from a container's changes @@ -1139,35 +1137,35 @@ Show the docker version information Create a new image from a container's changes - **Example request**: +**Example request**: POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/vnd.docker.raw-stream {"Id":"596069db4bf5"} - Query Parameters: +Query Parameters:   - - **container** – source container - - **repo** – repository - - **tag** – tag - - **m** – commit message - - **author** – author (e.g., "John Hannibal Smith +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") - - **run** – config automatically applied when the image is run. +- **run** – config automatically applied when the image is run. (ex: {"Cmd": ["cat", "/world"], "PortSpecs":["22"]}) - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **500** – server error +- **201** – no error +- **404** – no such container +- **500** – server error ### Monitor Docker's events @@ -1176,11 +1174,11 @@ Create a new image from a container's changes Get events from docker, either in real time via streaming, or via polling (using since) - **Example request**: +**Example request**: GET /events?since=1374067924 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1190,16 +1188,16 @@ or via polling (using since) {"status":"stop","id":"dfdf82bd3881","from":"base:latest","time":1374067966} {"status":"destroy","id":"dfdf82bd3881","from":"base:latest","time":1374067970} - Query Parameters: +Query Parameters:   - - **since** – timestamp used for polling +- **since** – timestamp used for polling - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Get a tarball containing all images and tags in a repository @@ -1208,21 +1206,21 @@ or via polling (using since) Get a tarball containing all images and metadata for the repository specified by `name`. - **Example request** +**Example request** - GET /images/ubuntu/get + GET /images/ubuntu/ge - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/x-tar Binary data stream - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Load a tarball with a set of images and tags into docker @@ -1230,20 +1228,20 @@ specified by `name`. Load a set of images and tags into the docker repository. - **Example request** +**Example request** POST /images/load Tarball in body - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error # 3. Going further @@ -1254,7 +1252,7 @@ Here are the steps of `docker run`: - Create the container - If the status code is 404, it means the image doesn't exists: - - Try to pull it + - Try to pull i - Then retry to create the container - Start the container diff --git a/docs/sources/reference/api/docker_remote_api_v1.9.md b/docs/sources/reference/api/docker_remote_api_v1.9.md index 5b85828f4b..78849ca94c 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.9.md +++ b/docs/sources/reference/api/docker_remote_api_v1.9.md @@ -23,11 +23,11 @@ page_keywords: API, Docker, rcli, REST, documentation List containers. - **Example request**: +**Example request**: GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -75,26 +75,26 @@ List containers. } ] - Query Parameters: +Query Parameters:   - - **all** – 1/True/true or 0/False/false, Show all containers. - Only running containers are shown by default - - **limit** – Show `limit` last created +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul +- **limit** – Show `limit` last created containers, include non-running ones. - - **since** – Show only containers created since Id, include +- **since** – Show only containers created since Id, include non-running ones. - - **before** – Show only containers created before Id, include +- **before** – Show only containers created before Id, include non-running ones. - - **size** – 1/True/true or 0/False/false, Show the containers +- **size** – 1/True/true or 0/False/false, Show the containers sizes - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **500** – server error ### Create a container @@ -102,7 +102,7 @@ List containers. Create a container - **Example request**: +**Example request**: POST /containers/create HTTP/1.1 Content-Type: application/json @@ -136,7 +136,7 @@ Create a container } } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/json @@ -146,38 +146,38 @@ Create a container "Warnings":[] } - Json Parameters: +Json Parameters:   - - **Hostname** – Container host name - - **User** – Username or UID - - **Memory** – Memory Limit in bytes - - **CpuShares** – CPU shares (relative weight) - - **AttachStdin** – 1/True/true or 0/False/false, attach to +- **Hostname** – Container host name +- **User** – Username or UID +- **Memory** – Memory Limit in bytes +- **CpuShares** – CPU shares (relative weight) +- **AttachStdin** – 1/True/true or 0/False/false, attach to standard input. Default false - - **AttachStdout** – 1/True/true or 0/False/false, attach to +- **AttachStdout** – 1/True/true or 0/False/false, attach to standard output. Default false - - **AttachStderr** – 1/True/true or 0/False/false, attach to +- **AttachStderr** – 1/True/true or 0/False/false, attach to standard error. Default false - - **Tty** – 1/True/true or 0/False/false, allocate a pseudo-tty. +- **Tty** – 1/True/true or 0/False/false, allocate a pseudo-tty. Default false - - **OpenStdin** – 1/True/true or 0/False/false, keep stdin open +- **OpenStdin** – 1/True/true or 0/False/false, keep stdin open even if not attached. Default false - Query Parameters: +Query Parameters:   - - **name** – Assign the specified name to the container. Must +- **name** – Assign the specified name to the container. Mus match `/?[a-zA-Z0-9_-]+`. - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **406** – impossible to attach (container not running) - - **500** – server error +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error ### Inspect a container @@ -185,11 +185,11 @@ Create a container Return low-level information on the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -258,11 +258,11 @@ Return low-level information on the container `id` } } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### List processes running inside a container @@ -270,11 +270,11 @@ Return low-level information on the container `id` List processes running inside the container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/top HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -299,17 +299,17 @@ List processes running inside the container `id` ] } - Query Parameters: +Query Parameters:   - - **ps_args** – ps arguments to use (e.g., aux) +- **ps_args** – ps arguments to use (e.g., aux) - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Inspect changes on a container's filesystem @@ -317,11 +317,11 @@ List processes running inside the container `id` Inspect changes on container `id`'s filesystem - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/changes HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -341,11 +341,11 @@ Inspect changes on container `id`'s filesystem } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Export a container @@ -353,22 +353,22 @@ Inspect changes on container `id`'s filesystem Export the contents of container `id` - **Example request**: +**Example request**: GET /containers/4fa6e0f0c678/export HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Start a container @@ -376,7 +376,7 @@ Export the contents of container `id` Start the container `id` - **Example request**: +**Example request**: POST /containers/(id)/start HTTP/1.1 Content-Type: application/json @@ -389,31 +389,31 @@ Start the container `id` "Privileged":false } - **Example response**: +**Example response**: - HTTP/1.1 204 No Content + HTTP/1.1 204 No Conten Content-Type: text/plain - Json Parameters: +Json Parameters:   - - **Binds** – Create a bind mount to a directory or file with +- **Binds** – Create a bind mount to a directory or file with [host-path]:[container-path]:[rw|ro]. If a directory "container-path" is missing, then docker creates a new volume. - - **LxcConf** – Map of custom lxc options - - **PortBindings** – Expose ports from the container, optionally +- **LxcConf** – Map of custom lxc options +- **PortBindings** – Expose ports from the container, optionally publishing them via the HostPort flag - - **PublishAllPorts** – 1/True/true or 0/False/false, publish all +- **PublishAllPorts** – 1/True/true or 0/False/false, publish all exposed ports to the host interfaces. Default false - - **Privileged** – 1/True/true or 0/False/false, give extended +- **Privileged** – 1/True/true or 0/False/false, give extended privileges to this container. Default false - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Stop a container @@ -421,25 +421,25 @@ Start the container `id` Stop the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/stop?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Restart a container @@ -447,25 +447,25 @@ Stop the container `id` Restart the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/restart?t=5 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **t** – number of seconds to wait before killing the container +- **t** – number of seconds to wait before killing the container - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Kill a container @@ -473,24 +473,24 @@ Restart the container `id` Kill the container `id` - **Example request**: +**Example request**: POST /containers/e90e34656806/kill HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters +Query Parameters - - **signal** - Signal to send to the container: integer or string like "SIGINT". +- **signal** - Signal to send to the container: integer or string like "SIGINT". When not set, SIGKILL is assumed and the call will waits for the container to exit. - Status Codes: +Status Codes: - - **204** – no error - - **404** – no such container - - **500** – server error +- **204** – no error +- **404** – no such container +- **500** – server error ### Attach to a container @@ -498,38 +498,38 @@ Kill the container `id` Attach to the container `id` - **Example request**: +**Example request**: POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream {{ STREAM }} - Query Parameters: +Query Parameters:   - - **logs** – 1/True/true or 0/False/false, return logs. Default +- **logs** – 1/True/true or 0/False/false, return logs. Defaul false - - **stream** – 1/True/true or 0/False/false, return stream. +- **stream** – 1/True/true or 0/False/false, return stream. Default false - - **stdin** – 1/True/true or 0/False/false, if stream=true, attach +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin. Default false - - **stdout** – 1/True/true or 0/False/false, if logs=true, return +- **stdout** – 1/True/true or 0/False/false, if logs=true, return stdout log, if stream=true, attach to stdout. Default false - - **stderr** – 1/True/true or 0/False/false, if logs=true, return +- **stderr** – 1/True/true or 0/False/false, if logs=true, return stderr log, if stream=true, attach to stderr. Default false - Status Codes: +Status Codes: - - **200** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error **Stream details**: @@ -553,9 +553,9 @@ Attach to the container `id` `STREAM_TYPE` can be: - - 0: stdin (will be written on stdout) - - 1: stdout - - 2: stderr +- 0: stdin (will be written on stdout) +- 1: stdou +- 2: stderr `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of the uint32 size encoded as big endian. @@ -571,7 +571,7 @@ Attach to the container `id` 1. Read 8 bytes 2. chose stdout or stderr depending on the first byte 3. Extract the frame size from the last 4 byets - 4. Read the extracted size and output it on the correct output + 4. Read the extracted size and output it on the correct outpu 5. Goto 1) ### Wait a container @@ -580,22 +580,22 @@ Attach to the container `id` Block until container `id` stops, then returns the exit code - **Example request**: +**Example request**: POST /containers/16253994b7c4/wait HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json {"StatusCode":0} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ### Remove a container @@ -603,27 +603,27 @@ Block until container `id` stops, then returns the exit code Remove the container `id` from the filesystem - **Example request**: +**Example request**: DELETE /containers/16253994b7c4?v=1 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 204 OK - Query Parameters: +Query Parameters:   - - **v** – 1/True/true or 0/False/false, Remove the volumes +- **v** – 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false - Status Codes: +Status Codes: - - **204** – no error - - **400** – bad parameter - - **404** – no such container - - **500** – server error +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error ### Copy files or folders from a container @@ -631,7 +631,7 @@ Remove the container `id` from the filesystem Copy files or folders of container `id` - **Example request**: +**Example request**: POST /containers/4fa6e0f0c678/copy HTTP/1.1 Content-Type: application/json @@ -640,18 +640,18 @@ Copy files or folders of container `id` "Resource":"test.txt" } - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/octet-stream {{ TAR STREAM }} - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such container - - **500** – server error +- **200** – no error +- **404** – no such container +- **500** – server error ## 2.2 Images @@ -663,7 +663,7 @@ Copy files or folders of container `id` GET /images/json?all=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -697,13 +697,13 @@ Copy files or folders of container `id` `POST /images/create` -Create an image, either by pull it from the registry or by importing it +Create an image, either by pull it from the registry or by importing i - **Example request**: +**Example request**: POST /images/create?fromImage=base HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -717,26 +717,26 @@ Create an image, either by pull it from the registry or by importing it `X-Registry-Auth` header can be used to include a base64-encoded AuthConfig object. - Query Parameters: +Query Parameters:   - - **fromImage** – name of the image to pull - - **fromSrc** – source to import, - means stdin - - **repo** – repository - - **tag** – tag - - **registry** – the registry to pull from +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from Request Headers:   - - **X-Registry-Auth** – base64-encoded AuthConfig object +- **X-Registry-Auth** – base64-encoded AuthConfig objec - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Insert a file in an image @@ -744,11 +744,11 @@ Create an image, either by pull it from the registry or by importing it Insert a file from `url` in the image `name` at `path` - **Example request**: +**Example request**: POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -758,17 +758,15 @@ Insert a file from `url` in the image `name` at `path` {"error":"Invalid..."} ... - Query Parameters: +Query Parameters: +- **url** – The url from where the file is taken +- **path** – The path where the file is stored +Status Codes: - - **url** – The url from where the file is taken - - **path** – The path where the file is stored - - Status Codes: - - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Inspect an image @@ -776,11 +774,11 @@ Insert a file from `url` in the image `name` at `path` Return low-level information on the image `name` - **Example request**: +**Example request**: GET /images/base/json HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -814,11 +812,11 @@ Return low-level information on the image `name` "Size": 6824592 } - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Get the history of an image @@ -826,11 +824,11 @@ Return low-level information on the image `name` Return the history of the image `name` - **Example request**: +**Example request**: GET /images/base/history HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -848,11 +846,11 @@ Return the history of the image `name` } ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Push an image on the registry @@ -860,11 +858,11 @@ Return the history of the image `name` Push the image `name` on the registry - **Example request**: +**Example request**: POST /images/test/push HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -878,14 +876,14 @@ Push the image `name` on the registry   - - **X-Registry-Auth** – include a base64-encoded AuthConfig +- **X-Registry-Auth** – include a base64-encoded AuthConfig object. - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **500** – server error +- **200** – no error +- **404** – no such image +- **500** – server error ### Tag an image into a repository @@ -893,39 +891,39 @@ Push the image `name` on the registry Tag the image `name` into a repository - **Example request**: +**Example request**: POST /images/test/tag?repo=myrepo&force=0 HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 201 OK - Query Parameters: +Query Parameters:   - - **repo** – The repository to tag in - - **force** – 1/True/true or 0/False/false, default false +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false - Status Codes: +Status Codes: - - **201** – no error - - **400** – bad parameter - - **404** – no such image - - **409** – conflict - - **500** – server error +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflic +- **500** – server error ### Remove an image `DELETE /images/(name*) : Remove the image `name` from the filesystem - **Example request**: +**Example request**: DELETE /images/test HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-type: application/json @@ -936,12 +934,12 @@ Tag the image `name` into a repository {"Deleted":"53b4f83ac9"} ] - Status Codes: +Status Codes: - - **200** – no error - - **404** – no such image - - **409** – conflict - - **500** – server error +- **200** – no error +- **404** – no such image +- **409** – conflic +- **500** – server error ### Search images @@ -953,11 +951,11 @@ Search for an image on [Docker Hub](https://hub.docker.com). > The response keys have changed from API v1.6 to reflect the JSON > sent by the registry server to the docker daemon's request. - **Example request**: +**Example request**: GET /images/search?term=sshd HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -987,16 +985,16 @@ Search for an image on [Docker Hub](https://hub.docker.com). ... ] - Query Parameters: +Query Parameters:   - - **term** – term to search +- **term** – term to search - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ## 2.3 Misc @@ -1006,13 +1004,13 @@ Search for an image on [Docker Hub](https://hub.docker.com). Build an image from Dockerfile using a POST body. - **Example request**: +**Example request**: POST /build HTTP/1.1 {{ TAR STREAM }} - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1029,28 +1027,28 @@ Build an image from Dockerfile using a POST body. which will be accessible in the build context (See the [*ADD build command*](/reference/builder/#dockerbuilder)). - Query Parameters: +Query Parameters:   - - **t** – repository name (and optionally a tag) to be applied to +- **t** – repository name (and optionally a tag) to be applied to the resulting image in case of success - - **q** – suppress verbose build output - - **nocache** – do not use the cache when building the image - - **rm** – Remove intermediate containers after a successful build +- **q** – suppress verbose build outpu +- **nocache** – do not use the cache when building the image +- **rm** – Remove intermediate containers after a successful build Request Headers:   - - **Content-type** – should be set to +- **Content-type** – should be set to `"application/tar"`. - - **X-Registry-Config** – base64-encoded ConfigFile object +- **X-Registry-Config** – base64-encoded ConfigFile objec - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Check auth configuration @@ -1058,7 +1056,7 @@ Build an image from Dockerfile using a POST body. Get the default username and email - **Example request**: +**Example request**: POST /auth HTTP/1.1 Content-Type: application/json @@ -1070,15 +1068,15 @@ Get the default username and email "serveraddress":"https://index.docker.io/v1/" } - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **204** – no error - - **500** – server error +- **200** – no error +- **204** – no error +- **500** – server error ### Display system-wide information @@ -1086,11 +1084,11 @@ Get the default username and email Display system-wide information - **Example request**: +**Example request**: GET /info HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1106,10 +1104,10 @@ Display system-wide information "IPv4Forwarding":true } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Show the docker version information @@ -1117,11 +1115,11 @@ Display system-wide information Show the docker version information - **Example request**: +**Example request**: GET /version HTTP/1.1 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1132,10 +1130,10 @@ Show the docker version information "GoVersion":"go1.0.3" } - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Create a new image from a container's changes @@ -1143,7 +1141,7 @@ Show the docker version information Create a new image from a container's changes - **Example request**: +**Example request**: POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 Content-Type: application/json @@ -1174,35 +1172,35 @@ Create a new image from a container's changes } } - **Example response**: +**Example response**: HTTP/1.1 201 OK Content-Type: application/vnd.docker.raw-stream {"Id":"596069db4bf5"} - Json Parameters: +Json Parameters: - - **config** - the container's configuration +- **config** - the container's configuration - Query Parameters: +Query Parameters:   - - **container** – source container - - **repo** – repository - - **tag** – tag - - **m** – commit message - - **author** – author (e.g., "John Hannibal Smith +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") - Status Codes: +Status Codes: - - **201** – no error - - **404** – no such container - - **500** – server error +- **201** – no error +- **404** – no such container +- **500** – server error ### Monitor Docker's events @@ -1211,11 +1209,11 @@ Create a new image from a container's changes Get events from docker, either in real time via streaming, or via polling (using since) - **Example request**: +**Example request**: GET /events?since=1374067924 - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/json @@ -1225,16 +1223,16 @@ polling (using since) {"status":"stop","id":"dfdf82bd3881","from":"base:latest","time":1374067966} {"status":"destroy","id":"dfdf82bd3881","from":"base:latest","time":1374067970} - Query Parameters: +Query Parameters:   - - **since** – timestamp used for polling +- **since** – timestamp used for polling - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Get a tarball containing all images and tags in a repository @@ -1242,21 +1240,21 @@ polling (using since) Get a tarball containing all images and metadata for the repository specified by `name`. - **Example request** +**Example request** - GET /images/ubuntu/get + GET /images/ubuntu/ge - **Example response**: +**Example response**: HTTP/1.1 200 OK Content-Type: application/x-tar Binary data stream - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error ### Load a tarball with a set of images and tags into docker @@ -1264,20 +1262,20 @@ Get a tarball containing all images and metadata for the repository specified by Load a set of images and tags into the docker repository. - **Example request** +**Example request** POST /images/load Tarball in body - **Example response**: +**Example response**: HTTP/1.1 200 OK - Status Codes: +Status Codes: - - **200** – no error - - **500** – server error +- **200** – no error +- **500** – server error # 3. Going further @@ -1289,19 +1287,19 @@ Here are the steps of `docker run` : - If the status code is 404, it means the image doesn't exists: - - Try to pull it - - Then retry to create the container +- Try to pull i +- Then retry to create the container - Start the container - If you are not in detached mode: - - Attach to the container, using logs=1 (to have stdout and - - stderr from the container's start) and stream=1 +- Attach to the container, using logs=1 (to have stdout and +- stderr from the container's start) and stream=1 - If in detached mode or only stdin is attached: - - Display the container's id +- Display the container's id ## 3.2 Hijacking diff --git a/docs/sources/reference/api/hub_registry_spec.md b/docs/sources/reference/api/hub_registry_spec.md index 1a37cf5694..e88f7c5aa1 100644 --- a/docs/sources/reference/api/hub_registry_spec.md +++ b/docs/sources/reference/api/hub_registry_spec.md @@ -133,41 +133,49 @@ and for an active account. 1. (Docker -> Docker Hub) GET /v1/repositories/foo/bar/images: - **Headers**: +**Headers**: + Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== X-Docker-Token: true - **Action**: +**Action**: + (looking up the foo/bar in db and gets images and checksums for that repo (all if no tag is specified, if tag, only checksums for those tags) see part 4.4.1) 2. (Docker Hub -> Docker) HTTP 200 OK - **Headers**: +**Headers**: + Authorization: Token signature=123abc,repository=”foo/bar”,access=write X-Docker-Endpoints: registry.docker.io [,registry2.docker.io] - **Body**: +**Body**: + Jsonified checksums (see part 4.4.1) 3. (Docker -> Registry) GET /v1/repositories/foo/bar/tags/latest - **Headers**: +**Headers**: + Authorization: Token signature=123abc,repository=”foo/bar”,access=write 4. (Registry -> Docker Hub) GET /v1/repositories/foo/bar/images - **Headers**: +**Headers**: + Authorization: Token signature=123abc,repository=”foo/bar”,access=read - **Body**: +**Body**: + - **Action**: +**Action**: + (Lookup token see if they have access to pull.) If good: @@ -178,7 +186,8 @@ and for an active account. 5. (Docker -> Registry) GET /v1/images/928374982374/ancestry - **Action**: +**Action**: + (for each image id returned in the registry, fetch /json + /layer) > **Note**: @@ -220,92 +229,108 @@ the end). 1. (Docker -> Docker Hub) PUT /v1/repositories/foo/bar/ - **Headers**: +**Headers**: + Authorization: Basic sdkjfskdjfhsdkjfh== X-Docker-Token: true - **Action**: - - in Docker Hub, we allocated a new repository, and set to - initialized +**Action**: - **Body**: - (The body contains the list of images that are going to be - pushed, with empty checksums. The checksums will be set at - the end of the push): +- in Docker Hub, we allocated a new repository, and set to + initialized + +**Body**: + +(The body contains the list of images that are going to be +pushed, with empty checksums. The checksums will be set at +the end of the push): [{“id”: “9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f”}] 2. (Docker Hub -> Docker) 200 Created - **Headers**: - - WWW-Authenticate: Token +**Headers**: + + WWW-Authenticate: Token signature=123abc,repository=”foo/bar”,access=write - - X-Docker-Endpoints: registry.docker.io [, - registry2.docker.io] + X-Docker-Endpoints: registry.docker.io [, registry2.docker.io] 3. (Docker -> Registry) PUT /v1/images/98765432_parent/json - **Headers**: +**Headers**: + Authorization: Token signature=123abc,repository=”foo/bar”,access=write 4. (Registry->Docker Hub) GET /v1/repositories/foo/bar/images - **Headers**: +**Headers**: + Authorization: Token signature=123abc,repository=”foo/bar”,access=write - **Action**: - - Docker Hub: - will invalidate the token. - - Registry: - grants a session (if token is approved) and fetches - the images id +**Action**: + +- Docker Hub: + will invalidate the token. +- Registry: + grants a session (if token is approved) and fetches + the images id 5. (Docker -> Registry) PUT /v1/images/98765432_parent/json - **Headers**:: - - Authorization: Token +**Headers**: + + Authorization: Token signature=123abc,repository=”foo/bar”,access=write - - Cookie: (Cookie provided by the Registry) + Cookie: (Cookie provided by the Registry) 6. (Docker -> Registry) PUT /v1/images/98765432/json - **Headers**: - - Cookie: (Cookie provided by the Registry) +**Headers**: + + Cookie: (Cookie provided by the Registry) 7. (Docker -> Registry) PUT /v1/images/98765432_parent/layer - **Headers**: - - Cookie: (Cookie provided by the Registry) +**Headers**: + + Cookie: (Cookie provided by the Registry) 8. (Docker -> Registry) PUT /v1/images/98765432/layer - **Headers**: +**Headers**: + X-Docker-Checksum: sha256:436745873465fdjkhdfjkgh 9. (Docker -> Registry) PUT /v1/repositories/foo/bar/tags/latest - **Headers**: - - Cookie: (Cookie provided by the Registry) +**Headers**: + + Cookie: (Cookie provided by the Registry) + +**Body**: - **Body**: “98765432” 10. (Docker -> Docker Hub) PUT /v1/repositories/foo/bar/images - **Headers**: +**Headers**: + Authorization: Basic 123oislifjsldfj== X-Docker-Endpoints: registry1.docker.io (no validation on this right now) - **Body**: +**Body**: + (The image, id`s, tags and checksums) [{“id”: “9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f”, “checksum”: “b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087”}] - **Return**: HTTP 204 +**Return**: + + HTTP 204 > **Note:** If push fails and they need to start again, what happens in the Docker Hub, > there will already be a record for the namespace/name, but it will be @@ -344,43 +369,49 @@ nice clean way to do that. Here is the workflow. 1. (Docker -> Docker Hub) DELETE /v1/repositories/foo/bar/ - **Headers**: +**Headers**: + Authorization: Basic sdkjfskdjfhsdkjfh== X-Docker-Token: true - **Action**: - - in Docker Hub, we make sure it is a valid repository, and set - to deleted (logically) +**Action**: + +- in Docker Hub, we make sure it is a valid repository, and set + to deleted (logically) + +**Body**: - **Body**: Empty 2. (Docker Hub -> Docker) 202 Accepted - **Headers**: - - WWW-Authenticate: Token +**Headers**: + + WWW-Authenticate: Token signature=123abc,repository=”foo/bar”,access=delete - - X-Docker-Endpoints: registry.docker.io [, - registry2.docker.io] + X-Docker-Endpoints: registry.docker.io [, registry2.docker.io] # list of endpoints where this repo lives. 3. (Docker -> Registry) DELETE /v1/repositories/foo/bar/ - **Headers**: +**Headers**: + Authorization: Token signature=123abc,repository=”foo/bar”,access=delete 4. (Registry->Docker Hub) PUT /v1/repositories/foo/bar/auth - **Headers**: +**Headers**: + Authorization: Token signature=123abc,repository=”foo/bar”,access=delete - **Action**: - - Docker Hub: - will invalidate the token. - - Registry: - deletes the repository (if token is approved) +**Action**: + +- Docker Hub: + will invalidate the token. +- Registry: + deletes the repository (if token is approved) 5. (Registry -> Docker) 200 OK @@ -389,14 +420,18 @@ nice clean way to do that. Here is the workflow. 6. (Docker -> Docker Hub) DELETE /v1/repositories/foo/bar/ - **Headers**: +**Headers**: + Authorization: Basic 123oislifjsldfj== X-Docker-Endpoints: registry-1.docker.io (no validation on this right now) - **Body**: +**Body**: + Empty - **Return**: HTTP 200 +**Return**: + + HTTP 200 ## How to use the Registry in standalone mode @@ -478,16 +513,20 @@ file is empty. POST /v1/users: - **Body**: +**Body**: + {"email": "[sam@docker.com](mailto:sam%40docker.com)", "password": "toto42", "username": "foobar"`} - **Validation**: - - **username**: min 4 character, max 30 characters, must match the - regular expression [a-z0-9_]. - - **password**: min 5 characters +**Validation**: - **Valid**: return HTTP 200 +- **username**: min 4 character, max 30 characters, must match the + regular expression [a-z0-9_]. +- **password**: min 5 characters + +**Valid**: + + return HTTP 200 Errors: HTTP 400 (we should create error codes for possible errors) - invalid json - missing field - wrong format (username, password, email, @@ -501,7 +540,8 @@ etc) - forbidden name - name already exists PUT /v1/users/ - **Body**: +**Body**: + {"password": "toto"} > **Note**: @@ -515,10 +555,10 @@ validate credentials. HTTP Basic Auth for now, maybe change in future. GET /v1/users - **Return**: - - Valid: HTTP 200 - - Invalid login: HTTP 401 - - Account inactive: HTTP 403 Account is not Active +**Return**: +- Valid: HTTP 200 +- Invalid login: HTTP 401 +- Account inactive: HTTP 403 Account is not Active ### Tags (Registry) @@ -543,14 +583,15 @@ GET /v1/repositories///tags “0.1.1”: “b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087” } - **4.3.2 Read the content of a tag (resolve the image id):** +**4.3.2 Read the content of a tag (resolve the image id):** GET /v1/repositories///tags/ - **Return**: +**Return**: + "9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f" - **4.3.3 Delete a tag (registry):** +**4.3.3 Delete a tag (registry):** DELETE /v1/repositories///tags/ @@ -577,14 +618,17 @@ You always add images, you never remove them. PUT /v1/repositories///images - **Body**: +**Body**: + [ {“id”: “9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f”, “checksum”: “sha256:b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087”} ] - **Return**: 204 +**Return**: + + 204 ### Repositories @@ -640,28 +684,32 @@ You have 3 options: 1. Provide user credentials and ask for a token - **Header**: - - Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== - - X-Docker-Token: true +**Header**: + + Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== + X-Docker-Token: true - In this case, along with the 200 response, you'll get a new token - (if user auth is ok): If authorization isn't correct you get a 401 - response. If account isn't active you will get a 403 response. +In this case, along with the 200 response, you'll get a new token +(if user auth is ok): If authorization isn't correct you get a 401 +response. If account isn't active you will get a 403 response. - **Response**: - - 200 OK - - X-Docker-Token: Token - signature=123abc,repository=”foo/bar”,access=read +**Response**: + + 200 OK + X-Docker-Token: Token + signature=123abc,repository=”foo/bar”,access=read 2. Provide user credentials only - **Header**: +**Header**: + Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== 3. Provide Token - **Header**: +**Header**: + Authorization: Token signature=123abc,repository=”foo/bar”,access=read diff --git a/docs/sources/reference/api/registry_api.md b/docs/sources/reference/api/registry_api.md index 49776b9b18..1ae37dba6d 100644 --- a/docs/sources/reference/api/registry_api.md +++ b/docs/sources/reference/api/registry_api.md @@ -73,13 +73,13 @@ The default namespace for a private repository is `library`. ## Images -### Layer +### Get image layer `GET /v1/images/(image_id)/layer` Get image layer for a given `image_id` - **Example Request**: +**Example Request**: GET /v1/images/088b4505aa3adc3d35e79c031fa126b403200f02f51920fbd9b7c503e87c7a2c/layer HTTP/1.1 Host: registry-1.docker.io @@ -87,11 +87,11 @@ Get image layer for a given `image_id` Content-Type: application/json Authorization: Token signature=123abc,repository="foo/bar",access=read - Parameters: +Parameters: - - **image_id** – the id for the layer you want to get +- **image_id** – the id for the layer you want to get - **Example Response**: +**Example Response**: HTTP/1.1 200 Vary: Accept @@ -100,17 +100,19 @@ Get image layer for a given `image_id` {layer binary data stream} - Status Codes: +Status Codes: - - **200** – OK - - **401** – Requires authorization - - **404** – Image not found +- **200** – OK +- **401** – Requires authorization +- **404** – Image not found + +### Put image layer `PUT /v1/images/(image_id)/layer` Put image layer for a given `image_id` - **Example Request**: +**Example Request**: PUT /v1/images/088b4505aa3adc3d35e79c031fa126b403200f02f51920fbd9b7c503e87c7a2c/layer HTTP/1.1 Host: registry-1.docker.io @@ -119,11 +121,11 @@ Put image layer for a given `image_id` {layer binary data stream} - Parameters: +Parameters: - - **image_id** – the id for the layer you want to get +- **image_id** – the id for the layer you want to get - **Example Response**: +**Example Response**: HTTP/1.1 200 Vary: Accept @@ -132,19 +134,21 @@ Put image layer for a given `image_id` "" - Status Codes: +Status Codes: - - **200** – OK - - **401** – Requires authorization - - **404** – Image not found +- **200** – OK +- **401** – Requires authorization +- **404** – Image not found ## Image +### Put image layer + `PUT /v1/images/(image_id)/json` Put image for a given `image_id` - **Example Request**: +**Example Request**: PUT /v1/images/088b4505aa3adc3d35e79c031fa126b403200f02f51920fbd9b7c503e87c7a2c/json HTTP/1.1 Host: registry-1.docker.io @@ -183,11 +187,11 @@ Put image for a given `image_id` docker_version: "0.1.7" } - Parameters: +Parameters: - - **image_id** – the id for the layer you want to get +- **image_id** – the id for the layer you want to get - **Example Response**: +**Example Response**: HTTP/1.1 200 Vary: Accept @@ -196,16 +200,18 @@ Put image for a given `image_id` "" - Status Codes: +Status Codes: - - **200** – OK - - **401** – Requires authorization +- **200** – OK +- **401** – Requires authorization + +### Get image layer `GET /v1/images/(image_id)/json` Get image for a given `image_id` - **Example Request**: +**Example Request**: GET /v1/images/088b4505aa3adc3d35e79c031fa126b403200f02f51920fbd9b7c503e87c7a2c/json HTTP/1.1 Host: registry-1.docker.io @@ -213,11 +219,11 @@ Get image for a given `image_id` Content-Type: application/json Cookie: (Cookie provided by the Registry) - Parameters: +Parameters: - - **image_id** – the id for the layer you want to get +- **image_id** – the id for the layer you want to get - **Example Response**: +**Example Response**: HTTP/1.1 200 Vary: Accept @@ -257,19 +263,21 @@ Get image for a given `image_id` docker_version: "0.1.7" } - Status Codes: +Status Codes: - - **200** – OK - - **401** – Requires authorization - - **404** – Image not found +- **200** – OK +- **401** – Requires authorization +- **404** – Image not found ## Ancestry +### Get image ancestry + `GET /v1/images/(image_id)/ancestry` Get ancestry for an image given an `image_id` - **Example Request**: +**Example Request**: GET /v1/images/088b4505aa3adc3d35e79c031fa126b403200f02f51920fbd9b7c503e87c7a2c/ancestry HTTP/1.1 Host: registry-1.docker.io @@ -277,11 +285,11 @@ Get ancestry for an image given an `image_id` Content-Type: application/json Cookie: (Cookie provided by the Registry) - Parameters: +Parameters: - - **image_id** – the id for the layer you want to get +- **image_id** – the id for the layer you want to get - **Example Response**: +**Example Response**: HTTP/1.1 200 Vary: Accept @@ -293,19 +301,21 @@ Get ancestry for an image given an `image_id` "bfa4c5326bc764280b0863b46a4b20d940bc1897ef9c1dfec060604bdc383280", "6ab5893c6927c15a15665191f2c6cf751f5056d8b95ceee32e43c5e8a3648544"] - Status Codes: +Status Codes: - - **200** – OK - - **401** – Requires authorization - - **404** – Image not found +- **200** – OK +- **401** – Requires authorization +- **404** – Image not found ## Tags +### List repository tags + `GET /v1/repositories/(namespace)/(repository)/tags` Get all of the tags for the given repo. - **Example Request**: +**Example Request**: GET /v1/repositories/reynholm/help-system-server/tags HTTP/1.1 Host: registry-1.docker.io @@ -314,12 +324,12 @@ Get all of the tags for the given repo. X-Docker-Registry-Version: 0.6.0 Cookie: (Cookie provided by the Registry) - Parameters: +Parameters: - - **namespace** – namespace for the repo - - **repository** – name for the repo +- **namespace** – namespace for the repo +- **repository** – name for the repo - **Example Response**: +**Example Response**: HTTP/1.1 200 Vary: Accept @@ -331,17 +341,19 @@ Get all of the tags for the given repo. "0.1.1": "b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087" } - Status Codes: +Status Codes: - - **200** – OK - - **401** – Requires authorization - - **404** – Repository not found +- **200** – OK +- **401** – Requires authorization +- **404** – Repository not found + +### Get image id for a particular tag `GET /v1/repositories/(namespace)/(repository)/tags/(tag*)` Get a tag for the given repo. - **Example Request**: +**Example Request**: GET /v1/repositories/reynholm/help-system-server/tags/latest HTTP/1.1 Host: registry-1.docker.io @@ -350,13 +362,13 @@ Get a tag for the given repo. X-Docker-Registry-Version: 0.6.0 Cookie: (Cookie provided by the Registry) - Parameters: +Parameters: - - **namespace** – namespace for the repo - - **repository** – name for the repo - - **tag** – name of tag you want to get +- **namespace** – namespace for the repo +- **repository** – name for the repo +- **tag** – name of tag you want to get - **Example Response**: +**Example Response**: HTTP/1.1 200 Vary: Accept @@ -365,17 +377,19 @@ Get a tag for the given repo. "9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f" - Status Codes: +Status Codes: - - **200** – OK - - **401** – Requires authorization - - **404** – Tag not found +- **200** – OK +- **401** – Requires authorization +- **404** – Tag not found + +### Delete a repository tag `DELETE /v1/repositories/(namespace)/(repository)/tags/(tag*)` Delete the tag for the repo - **Example Request**: +**Example Request**: DELETE /v1/repositories/reynholm/help-system-server/tags/latest HTTP/1.1 Host: registry-1.docker.io @@ -383,13 +397,13 @@ Delete the tag for the repo Content-Type: application/json Cookie: (Cookie provided by the Registry) - Parameters: +Parameters: - - **namespace** – namespace for the repo - - **repository** – name for the repo - - **tag** – name of tag you want to delete +- **namespace** – namespace for the repo +- **repository** – name for the repo +- **tag** – name of tag you want to delete - **Example Response**: +**Example Response**: HTTP/1.1 200 Vary: Accept @@ -398,17 +412,19 @@ Delete the tag for the repo "" - Status Codes: +Status Codes: - - **200** – OK - - **401** – Requires authorization - - **404** – Tag not found +- **200** – OK +- **401** – Requires authorization +- **404** – Tag not found + +### Set a tag for a specified image id `PUT /v1/repositories/(namespace)/(repository)/tags/(tag*)` Put a tag for the given repo. - **Example Request**: +**Example Request**: PUT /v1/repositories/reynholm/help-system-server/tags/latest HTTP/1.1 Host: registry-1.docker.io @@ -418,13 +434,13 @@ Put a tag for the given repo. "9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f" - Parameters: +Parameters: - - **namespace** – namespace for the repo - - **repository** – name for the repo - - **tag** – name of tag you want to add +- **namespace** – namespace for the repo +- **repository** – name for the repo +- **tag** – name of tag you want to add - **Example Response**: +**Example Response**: HTTP/1.1 200 Vary: Accept @@ -433,20 +449,22 @@ Put a tag for the given repo. "" - Status Codes: +Status Codes: - - **200** – OK - - **400** – Invalid data - - **401** – Requires authorization - - **404** – Image not found +- **200** – OK +- **400** – Invalid data +- **401** – Requires authorization +- **404** – Image not found ## Repositories +### Delete a repository + `DELETE /v1/repositories/(namespace)/(repository)/` Delete a repository - **Example Request**: +**Example Request**: DELETE /v1/repositories/reynholm/help-system-server/ HTTP/1.1 Host: registry-1.docker.io @@ -456,12 +474,12 @@ Delete a repository "" - Parameters: +Parameters: - - **namespace** – namespace for the repo - - **repository** – name for the repo +- **namespace** – namespace for the repo +- **repository** – name for the repo - **Example Response**: +**Example Response**: HTTP/1.1 200 Vary: Accept @@ -470,20 +488,22 @@ Delete a repository "" - Status Codes: +Status Codes: - - **200** – OK - - **401** – Requires authorization - - **404** – Repository not found +- **200** – OK +- **401** – Requires authorization +- **404** – Repository not found ## Status +### Status check for registry + `GET /v1/_ping` Check status of the registry. This endpoint is also used to determine if the registry supports SSL. - **Example Request**: +**Example Request**: GET /v1/_ping HTTP/1.1 Host: registry-1.docker.io @@ -492,7 +512,7 @@ determine if the registry supports SSL. "" - **Example Response**: +**Example Response**: HTTP/1.1 200 Vary: Accept @@ -501,13 +521,12 @@ determine if the registry supports SSL. "" - Status Codes: +Status Codes: - - **200** – OK +- **200** – OK ## Authorization This is where we describe the authorization process, including the tokens and cookies. -TODO: add more info.