mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Compare commits
28 Commits
v1.12.2
...
docs-v1.12
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c16b5eb4d | ||
|
|
66375de76e | ||
|
|
adeba54893 | ||
|
|
e3b6cca8de | ||
|
|
01940944e4 | ||
|
|
15cbede98c | ||
|
|
3c55fb8c06 | ||
|
|
9738defd13 | ||
|
|
1aecea09a5 | ||
|
|
f41f93a0e5 | ||
|
|
75070282f2 | ||
|
|
40ea65a1b5 | ||
|
|
a39aca4a60 | ||
|
|
2a3562f599 | ||
|
|
3a184996c0 | ||
|
|
88b2dd9d04 | ||
|
|
36911c3a2f | ||
|
|
28120f1236 | ||
|
|
f00afff382 | ||
|
|
62091d021b | ||
|
|
a377019a13 | ||
|
|
4488ae06df | ||
|
|
f61b71549b | ||
|
|
be4ef641d9 | ||
|
|
53e75284a6 | ||
|
|
3696d1fff5 | ||
|
|
c79ef9842a | ||
|
|
0fa541496b |
@@ -36,7 +36,7 @@ Use your favorite editor to enable the `live-restore` option in the
|
||||
|
||||
You have to send a `SIGHUP` signal to the daemon process for it to reload the
|
||||
configuration. For more information on how to configure the Docker daemon using
|
||||
config.json, see [daemon configuration file](../reference/commandline/dockerd.md#daemon-configuration-file)
|
||||
config.json, see [daemon configuration file](../reference/commandline/dockerd.md#daemon-configuration-file).
|
||||
|
||||
* When you start the Docker daemon, pass the `--live-restore` flag:
|
||||
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
# Dockerizing MongoDB: Dockerfile for building MongoDB images
|
||||
# Based on ubuntu:latest, installs MongoDB following the instructions from:
|
||||
# Based on ubuntu:16.04, installs MongoDB following the instructions from:
|
||||
# http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
|
||||
|
||||
FROM ubuntu:latest
|
||||
FROM ubuntu:16.04
|
||||
MAINTAINER Docker
|
||||
|
||||
# Installation:
|
||||
# Import MongoDB public GPG key AND create a MongoDB list file
|
||||
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
|
||||
RUN echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.0.list
|
||||
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
|
||||
RUN echo "deb http://repo.mongodb.org/apt/ubuntu $(cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d= -f2)/mongodb-org/3.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.2.list
|
||||
|
||||
# Update apt-get sources AND install MongoDB
|
||||
RUN apt-get update && apt-get install -y mongodb-org
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ weight = 1
|
||||
|
||||
Docker for Mac is our newest offering for the Mac. It runs as a native Mac application and uses <a href="https://github.com/mist64/xhyve/" target="_blank">xhyve</a> to virtualize the Docker Engine environment and Linux kernel-specific features for the Docker daemon.
|
||||
|
||||
<a class="button" href="https://download.docker.com/mac/beta/Docker.dmg">Get Docker for Mac</a>
|
||||
<a class="button" href="https://download.docker.com/mac/stable/Docker.dmg">Get Docker for Mac</a>
|
||||
|
||||
**Requirements**
|
||||
|
||||
@@ -49,7 +49,7 @@ See [Docker Toolbox Overview](/toolbox/overview.md) for help on installing Docke
|
||||
|
||||
Docker for Windows is our newest offering for PCs. It runs as a native Windows application and uses Hyper-V to virtualize the Docker Engine environment and Linux kernel-specific features for the Docker daemon.
|
||||
|
||||
<a class="button" href="https://download.docker.com/win/beta/InstallDocker.msi">Get Docker for Windows</a>
|
||||
<a class="button" href="https://download.docker.com/win/stable/InstallDocker.msi">Get Docker for Windows</a>
|
||||
|
||||
**Requirements**
|
||||
|
||||
|
||||
@@ -243,15 +243,13 @@ To create the `docker` group and add your user:
|
||||
|
||||
1. Log into Ubuntu as a user with `sudo` privileges.
|
||||
|
||||
This procedure assumes you log in as the `ubuntu` user.
|
||||
|
||||
2. Create the `docker` group.
|
||||
|
||||
$ sudo groupadd docker
|
||||
|
||||
3. Add your user to `docker` group.
|
||||
|
||||
$ sudo usermod -aG docker ubuntu
|
||||
$ sudo usermod -aG docker $USER
|
||||
|
||||
4. Log out and log back in.
|
||||
|
||||
|
||||
@@ -163,6 +163,7 @@ This section lists each version from latest to oldest. Each listing includes a
|
||||
* `POST /containers/create` with both `Hostname` and `Domainname` fields specified will result in the container's hostname being set to `Hostname`, rather than `Hostname.Domainname`.
|
||||
* `GET /volumes` now supports more filters, new added filters are `name` and `driver`.
|
||||
* `GET /containers/(id or name)/logs` now accepts a `details` query parameter to stream the extra attributes that were provided to the containers `LogOpts`, such as environment variables and labels, with the logs.
|
||||
* `POST /images/load` now returns progress information as a JSON stream, and has a `quiet` query parameter to suppress progress details.
|
||||
|
||||
### v1.22 API changes
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -96,7 +96,7 @@ List containers
|
||||
}
|
||||
]
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **all** – 1/True/true or 0/False/false, Show all containers.
|
||||
Only running containers are shown by default (i.e., this defaults to false)
|
||||
@@ -113,7 +113,7 @@ Query Parameters:
|
||||
- `status=`(`restarting`|`running`|`paused`|`exited`)
|
||||
- `label=key` or `label="key=value"` of a container label
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -147,7 +147,7 @@ Create a container
|
||||
"Cmd": [
|
||||
"date"
|
||||
],
|
||||
"Entrypoint": "",
|
||||
"Entrypoint": null,
|
||||
"Image": "ubuntu",
|
||||
"Labels": {
|
||||
"com.example.vendor": "Acme",
|
||||
@@ -155,7 +155,7 @@ Create a container
|
||||
"com.example.version": "1.0"
|
||||
},
|
||||
"Volumes": {
|
||||
"/tmp": {}
|
||||
"/volumes/data": {}
|
||||
},
|
||||
"WorkingDir": "",
|
||||
"NetworkDisabled": false,
|
||||
@@ -207,7 +207,7 @@ Create a container
|
||||
"Warnings":[]
|
||||
}
|
||||
|
||||
Json Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **Hostname** - A string value containing the hostname to use for the
|
||||
container.
|
||||
@@ -226,7 +226,7 @@ Json Parameters:
|
||||
- **Entrypoint** - Set the entry point for the container as a string or an array
|
||||
of strings.
|
||||
- **Image** - A string specifying the image name to use for the container.
|
||||
- **Volumes** – An object mapping mount point paths (strings) inside the
|
||||
- **Volumes** - An object mapping mount point paths (strings) inside the
|
||||
container to empty objects.
|
||||
- **WorkingDir** - A string specifying the working directory for commands to
|
||||
run in.
|
||||
@@ -296,15 +296,15 @@ Json Parameters:
|
||||
- **LogConfig** - Log configuration for the container, specified as a JSON object in the form
|
||||
`{ "Type": "<driver_name>", "Config": {"key1": "val1"}}`.
|
||||
Available types: `json-file`, `syslog`, `journald`, `none`.
|
||||
`syslog` available options are: `address`.
|
||||
- **CgroupParent** - Path to cgroups under which the cgroup for the container will be created. If the path is not absolute, the path is considered to be relative to the cgroups path of the init process. Cgroups will be created if they do not already exist.
|
||||
`syslog` available options are: `address`.
|
||||
- **CgroupParent** - Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **name** – Assign the specified name to the container. Must
|
||||
match `/?[a-zA-Z0-9_-]+`.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -319,7 +319,6 @@ Status Codes:
|
||||
|
||||
Return low-level information on the container `id`
|
||||
|
||||
|
||||
**Example request**:
|
||||
|
||||
GET /containers/4fa6e0f0c678/json HTTP/1.1
|
||||
@@ -445,7 +444,7 @@ Return low-level information on the container `id`
|
||||
"VolumesRW": {}
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -505,11 +504,11 @@ supported on Windows.
|
||||
],
|
||||
}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **ps_args** – `ps` arguments to use (e.g., `aux`), defaults to `-ef`
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -537,7 +536,7 @@ Get `stdout` and `stderr` logs from the container ``id``
|
||||
|
||||
{{ 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`.
|
||||
@@ -548,7 +547,7 @@ Query Parameters:
|
||||
every log line. Default `false`.
|
||||
- **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **101** – no error, hints proxy about hijacking
|
||||
- **200** – no error, no upgrade header found
|
||||
@@ -591,7 +590,7 @@ Values for `Kind`:
|
||||
- `1`: Add
|
||||
- `2`: Delete
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -614,7 +613,7 @@ Export the contents of container `id`
|
||||
|
||||
{{ TAR STREAM }}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -719,11 +718,11 @@ This endpoint returns a live stream of a container's resource usage statistics.
|
||||
|
||||
The precpu_stats is the cpu statistic of last read, which is used for calculating the cpu usage percent. It is not the exact copy of the “cpu_stats” field.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **stream** – 1/True/true or 0/False/false, pull stats once then disconnect. Default `true`.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -745,7 +744,12 @@ Resize the TTY for container with `id`. You must restart the container for the
|
||||
Content-Length: 0
|
||||
Content-Type: text/plain; charset=utf-8
|
||||
|
||||
Status Codes:
|
||||
**Query parameters**:
|
||||
|
||||
- **h** – height of `tty` session
|
||||
- **w** – width
|
||||
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – No such container
|
||||
@@ -763,13 +767,13 @@ Start the container `id`
|
||||
|
||||
**Example request**:
|
||||
|
||||
POST /containers/e90e34656806/start HTTP/1.1
|
||||
POST /containers/e90e34656806/start HTTP/1.1
|
||||
|
||||
**Example response**:
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **304** – container already started
|
||||
@@ -790,11 +794,11 @@ Stop the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **t** – number of seconds to wait before killing the container
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **304** – container already stopped
|
||||
@@ -815,11 +819,11 @@ Restart the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **t** – number of seconds to wait before killing the container
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -839,12 +843,12 @@ Kill the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters
|
||||
**Query parameters**:
|
||||
|
||||
- **signal** - Signal to send to the container: integer or string like `SIGINT`.
|
||||
When not set, `SIGKILL` is assumed and the call waits for the container to exit.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -864,11 +868,11 @@ Rename the container `id` to a `new_name`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **name** – new name for the container
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -889,7 +893,7 @@ Pause the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -909,7 +913,7 @@ Unpause the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -934,7 +938,7 @@ Attach to the container `id`
|
||||
|
||||
{{ STREAM }}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **logs** – 1/True/true or 0/False/false, return logs. Default `false`.
|
||||
- **stream** – 1/True/true or 0/False/false, return stream.
|
||||
@@ -946,7 +950,7 @@ Query Parameters:
|
||||
- **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**:
|
||||
|
||||
- **101** – no error, hints proxy about hijacking
|
||||
- **200** – no error, no upgrade header found
|
||||
@@ -1014,7 +1018,7 @@ Implements websocket protocol handshake according to [RFC 6455](http://tools.iet
|
||||
|
||||
{{ STREAM }}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **logs** – 1/True/true or 0/False/false, return logs. Default `false`.
|
||||
- **stream** – 1/True/true or 0/False/false, return stream.
|
||||
@@ -1026,7 +1030,7 @@ Query Parameters:
|
||||
- **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
|
||||
@@ -1050,7 +1054,7 @@ Block until container `id` stops, then returns the exit code
|
||||
|
||||
{"StatusCode": 0}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -1070,14 +1074,14 @@ Remove the container `id` from the filesystem
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **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.
|
||||
Default `false`.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -1107,7 +1111,7 @@ Copy files or folders of container `id`
|
||||
|
||||
{{ TAR STREAM }}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -1198,7 +1202,7 @@ digest. You can reference this digest using the value:
|
||||
See the `docker run` and `docker build` commands for examples of digest and tag
|
||||
references on the command line.
|
||||
|
||||
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. Available filters:
|
||||
@@ -1242,10 +1246,10 @@ command*](../../reference/builder.md#add)).
|
||||
The build is canceled if the client drops the connection by quitting
|
||||
or being killed.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **dockerfile** - Path within the build context to the `Dockerfile`. This is
|
||||
ignored if `remote` is specified and points to an external `Dockerfile`.
|
||||
- **dockerfile** - Path within the build context to the Dockerfile. This is
|
||||
ignored if `remote` is specified and points to an individual filename.
|
||||
- **t** – Repository name (and optionally a tag) to be applied to
|
||||
the resulting image in case of success.
|
||||
- **remote** – A Git repository URI or HTTP/HTTPS context URI. If the
|
||||
@@ -1272,7 +1276,7 @@ Query Parameters:
|
||||
- **Content-type** – Set to `"application/tar"`.
|
||||
- **X-Registry-Config** – base64-encoded ConfigFile object
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -1301,7 +1305,7 @@ When using this endpoint to pull an image from the registry, the
|
||||
`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. The value may be a URL from which the image
|
||||
@@ -1313,7 +1317,7 @@ Query Parameters:
|
||||
|
||||
- **X-Registry-Auth** – base64-encoded AuthConfig object
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -1367,7 +1371,7 @@ Return low-level information on the image `name`
|
||||
"Size": 6824592
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such image
|
||||
@@ -1421,7 +1425,7 @@ Return the history of the image `name`
|
||||
}
|
||||
]
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such image
|
||||
@@ -1456,7 +1460,7 @@ then be used in the URL. This duplicates the command line's flow.
|
||||
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. This is optional.
|
||||
|
||||
@@ -1465,7 +1469,7 @@ Request Headers:
|
||||
- **X-Registry-Auth** – Include a base64-encoded AuthConfig.
|
||||
object.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such image
|
||||
@@ -1485,13 +1489,13 @@ Tag the image `name` into a repository
|
||||
|
||||
HTTP/1.1 201 Created
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **repo** – The repository to tag in
|
||||
- **force** – 1/True/true or 0/False/false, default false
|
||||
- **tag** - The new tag name
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -1520,12 +1524,12 @@ 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
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such image
|
||||
@@ -1554,39 +1558,39 @@ be deprecated and replaced by the `is_automated` property.
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
[
|
||||
{
|
||||
"star_count": 12,
|
||||
"is_official": false,
|
||||
"name": "wma55/u1210sshd",
|
||||
"is_trusted": false,
|
||||
"is_automated": false,
|
||||
"description": "",
|
||||
},
|
||||
{
|
||||
"star_count": 10,
|
||||
"is_official": false,
|
||||
"name": "jdswinbank/sshd",
|
||||
"is_trusted": false,
|
||||
"is_automated": false,
|
||||
"description": "",
|
||||
},
|
||||
{
|
||||
"star_count": 18,
|
||||
"is_official": false,
|
||||
"name": "vgauthier/sshd",
|
||||
"is_trusted": false,
|
||||
"is_automated": false,
|
||||
"description": "",
|
||||
}
|
||||
...
|
||||
]
|
||||
[
|
||||
{
|
||||
"star_count": 12,
|
||||
"is_official": false,
|
||||
"name": "wma55/u1210sshd",
|
||||
"is_trusted": false,
|
||||
"is_automated": false,
|
||||
"description": "",
|
||||
},
|
||||
{
|
||||
"star_count": 10,
|
||||
"is_official": false,
|
||||
"name": "jdswinbank/sshd",
|
||||
"is_trusted": false,
|
||||
"is_automated": false,
|
||||
"description": "",
|
||||
},
|
||||
{
|
||||
"star_count": 18,
|
||||
"is_official": false,
|
||||
"name": "vgauthier/sshd",
|
||||
"is_trusted": false,
|
||||
"is_automated": false,
|
||||
"description": "",
|
||||
}
|
||||
...
|
||||
]
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **term** – term to search
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -1615,7 +1619,7 @@ Get the default username and email
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **204** – no error
|
||||
@@ -1685,7 +1689,7 @@ Display system-wide information
|
||||
"SystemTime": "2015-03-10T11:11:23.730591467-07:00"
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -1715,7 +1719,7 @@ Show the docker version information
|
||||
"ApiVersion": "1.19"
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -1737,7 +1741,7 @@ Ping the docker server
|
||||
|
||||
OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **500** - server error
|
||||
@@ -1789,11 +1793,11 @@ Create a new image from a container's changes
|
||||
|
||||
{"Id": "596069db4bf5"}
|
||||
|
||||
Json Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **config** - the container's configuration
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **container** – source container
|
||||
- **repo** – repository
|
||||
@@ -1802,7 +1806,7 @@ Query Parameters:
|
||||
- **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
|
||||
@@ -1837,16 +1841,16 @@ and Docker images report:
|
||||
{"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
|
||||
- **until** – Timestamp used for polling
|
||||
- **filters** – A json encoded value of the filters (a map[string][]string) to process on the event list. Available filters:
|
||||
- `container=<string>`; -- container to filter
|
||||
- `event=<string>`; -- event to filter
|
||||
- `image=<string>`; -- image to filter
|
||||
- `container=<string>`; -- container to filter
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -1876,7 +1880,7 @@ See the [image tarball format](#image-tarball-format) for more details.
|
||||
|
||||
Binary data stream
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -1905,7 +1909,7 @@ See the [image tarball format](#image-tarball-format) for more details.
|
||||
|
||||
Binary data stream
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -1920,6 +1924,7 @@ See the [image tarball format](#image-tarball-format) for more details.
|
||||
**Example request**
|
||||
|
||||
POST /images/load
|
||||
Content-Type: application/x-tar
|
||||
|
||||
Tarball in body
|
||||
|
||||
@@ -1927,7 +1932,7 @@ See the [image tarball format](#image-tarball-format) for more details.
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -1971,7 +1976,7 @@ Sets up an exec instance in a running container `id`
|
||||
"Tty": false,
|
||||
"Cmd": [
|
||||
"date"
|
||||
],
|
||||
]
|
||||
}
|
||||
|
||||
**Example response**:
|
||||
@@ -1984,7 +1989,7 @@ Sets up an exec instance in a running container `id`
|
||||
"Warnings":[]
|
||||
}
|
||||
|
||||
Json Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **AttachStdin** - Boolean value, attaches to `stdin` of the `exec` command.
|
||||
- **AttachStdout** - Boolean value, attaches to `stdout` of the `exec` command.
|
||||
@@ -1993,7 +1998,7 @@ Json Parameters:
|
||||
- **Cmd** - Command to run specified as a string or an array of strings.
|
||||
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **404** – no such container
|
||||
@@ -2013,7 +2018,7 @@ interactive session with the `exec` command.
|
||||
|
||||
{
|
||||
"Detach": false,
|
||||
"Tty": false,
|
||||
"Tty": false
|
||||
}
|
||||
|
||||
**Example response**:
|
||||
@@ -2023,12 +2028,12 @@ interactive session with the `exec` command.
|
||||
|
||||
{{ STREAM }}
|
||||
|
||||
Json Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **Detach** - Detach from the `exec` command.
|
||||
- **Tty** - Boolean value to allocate a pseudo-TTY.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such exec instance
|
||||
@@ -2040,12 +2045,12 @@ Status Codes:
|
||||
|
||||
`POST /exec/(id)/resize`
|
||||
|
||||
Resizes the `tty` session used by the `exec` command `id`.
|
||||
Resizes the `tty` session used by the `exec` command `id`. The unit is number of characters.
|
||||
This API is valid only if `tty` was specified as part of creating and starting the `exec` command.
|
||||
|
||||
**Example request**:
|
||||
|
||||
POST /exec/e90e34656806/resize HTTP/1.1
|
||||
POST /exec/e90e34656806/resize?h=40&w=80 HTTP/1.1
|
||||
Content-Type: text/plain
|
||||
|
||||
**Example response**:
|
||||
@@ -2053,12 +2058,12 @@ This API is valid only if `tty` was specified as part of creating and starting t
|
||||
HTTP/1.1 201 Created
|
||||
Content-Type: text/plain
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **h** – height of `tty` session
|
||||
- **w** – width
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **404** – no such exec instance
|
||||
@@ -2162,7 +2167,7 @@ Return low-level information about the `exec` command `id`.
|
||||
}
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such exec instance
|
||||
|
||||
@@ -96,7 +96,7 @@ List containers
|
||||
}
|
||||
]
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **all** – 1/True/true or 0/False/false, Show all containers.
|
||||
Only running containers are shown by default (i.e., this defaults to false)
|
||||
@@ -113,7 +113,7 @@ Query Parameters:
|
||||
- `status=`(`created`|`restarting`|`running`|`paused`|`exited`)
|
||||
- `label=key` or `label="key=value"` of a container label
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -147,7 +147,7 @@ Create a container
|
||||
"Cmd": [
|
||||
"date"
|
||||
],
|
||||
"Entrypoint": "",
|
||||
"Entrypoint": null,
|
||||
"Image": "ubuntu",
|
||||
"Labels": {
|
||||
"com.example.vendor": "Acme",
|
||||
@@ -209,7 +209,7 @@ Create a container
|
||||
"Warnings":[]
|
||||
}
|
||||
|
||||
Json Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **Hostname** - A string value containing the hostname to use for the
|
||||
container.
|
||||
@@ -303,12 +303,12 @@ Json Parameters:
|
||||
`json-file` logging driver.
|
||||
- **CgroupParent** - Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **name** – Assign the specified name to the container. Must
|
||||
match `/?[a-zA-Z0-9_-]+`.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -323,7 +323,6 @@ Status Codes:
|
||||
|
||||
Return low-level information on the container `id`
|
||||
|
||||
|
||||
**Example request**:
|
||||
|
||||
GET /containers/4fa6e0f0c678/json HTTP/1.1
|
||||
@@ -454,7 +453,7 @@ Return low-level information on the container `id`
|
||||
]
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -514,11 +513,11 @@ supported on Windows.
|
||||
],
|
||||
}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **ps_args** – `ps` arguments to use (e.g., `aux`), defaults to `-ef`
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -546,7 +545,7 @@ Get `stdout` and `stderr` logs from the container ``id``
|
||||
|
||||
{{ 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`.
|
||||
@@ -557,7 +556,7 @@ Query Parameters:
|
||||
every log line. Default `false`.
|
||||
- **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **101** – no error, hints proxy about hijacking
|
||||
- **200** – no error, no upgrade header found
|
||||
@@ -600,7 +599,7 @@ Values for `Kind`:
|
||||
- `1`: Add
|
||||
- `2`: Delete
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -623,7 +622,7 @@ Export the contents of container `id`
|
||||
|
||||
{{ TAR STREAM }}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -728,11 +727,11 @@ This endpoint returns a live stream of a container's resource usage statistics.
|
||||
|
||||
The precpu_stats is the cpu statistic of last read, which is used for calculating the cpu usage percent. It is not the exact copy of the “cpu_stats” field.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **stream** – 1/True/true or 0/False/false, pull stats once then disconnect. Default `true`.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -754,7 +753,12 @@ Resize the TTY for container with `id`. You must restart the container for the
|
||||
Content-Length: 0
|
||||
Content-Type: text/plain; charset=utf-8
|
||||
|
||||
Status Codes:
|
||||
**Query parameters**:
|
||||
|
||||
- **h** – height of `tty` session
|
||||
- **w** – width
|
||||
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – No such container
|
||||
@@ -778,7 +782,7 @@ Start the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **304** – container already started
|
||||
@@ -799,11 +803,11 @@ Stop the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **t** – number of seconds to wait before killing the container
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **304** – container already stopped
|
||||
@@ -824,11 +828,11 @@ Restart the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **t** – number of seconds to wait before killing the container
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -848,12 +852,12 @@ Kill the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters
|
||||
**Query parameters**:
|
||||
|
||||
- **signal** - Signal to send to the container: integer or string like `SIGINT`.
|
||||
When not set, `SIGKILL` is assumed and the call waits for the container to exit.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -873,11 +877,11 @@ Rename the container `id` to a `new_name`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **name** – new name for the container
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -898,7 +902,7 @@ Pause the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -918,7 +922,7 @@ Unpause the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -943,7 +947,7 @@ Attach to the container `id`
|
||||
|
||||
{{ STREAM }}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **logs** – 1/True/true or 0/False/false, return logs. Default `false`.
|
||||
- **stream** – 1/True/true or 0/False/false, return stream.
|
||||
@@ -955,7 +959,7 @@ Query Parameters:
|
||||
- **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**:
|
||||
|
||||
- **101** – no error, hints proxy about hijacking
|
||||
- **200** – no error, no upgrade header found
|
||||
@@ -1023,7 +1027,7 @@ Implements websocket protocol handshake according to [RFC 6455](http://tools.iet
|
||||
|
||||
{{ STREAM }}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **logs** – 1/True/true or 0/False/false, return logs. Default `false`.
|
||||
- **stream** – 1/True/true or 0/False/false, return stream.
|
||||
@@ -1035,7 +1039,7 @@ Query Parameters:
|
||||
- **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
|
||||
@@ -1059,7 +1063,7 @@ Block until container `id` stops, then returns the exit code
|
||||
|
||||
{"StatusCode": 0}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -1079,14 +1083,14 @@ Remove the container `id` from the filesystem
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **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.
|
||||
Default `false`.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -1118,7 +1122,7 @@ Copy files or folders of container `id`
|
||||
|
||||
{{ TAR STREAM }}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -1137,7 +1141,7 @@ following section.
|
||||
|
||||
Get a tar archive of a resource in the filesystem of container `id`.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **path** - resource in the container's filesystem to archive. Required.
|
||||
|
||||
@@ -1148,39 +1152,41 @@ Query Parameters:
|
||||
indicates that only the contents of the **path** directory should be
|
||||
copied. A symlink is always resolved to its target.
|
||||
|
||||
**Note**: It is not possible to copy certain system files such as resources
|
||||
under `/proc`, `/sys`, `/dev`, and mounts created by the user in the
|
||||
container.
|
||||
> **Note**: It is not possible to copy certain system files such as resources
|
||||
> under `/proc`, `/sys`, `/dev`, and mounts created by the user in the
|
||||
> container.
|
||||
|
||||
**Example request**:
|
||||
|
||||
GET /containers/8cce319429b2/archive?path=/root HTTP/1.1
|
||||
GET /containers/8cce319429b2/archive?path=/root HTTP/1.1
|
||||
|
||||
**Example response**:
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/x-tar
|
||||
X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0=
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/x-tar
|
||||
X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0=
|
||||
|
||||
{{ TAR STREAM }}
|
||||
{{ TAR STREAM }}
|
||||
|
||||
On success, a response header `X-Docker-Container-Path-Stat` will be set to a
|
||||
base64-encoded JSON object containing some filesystem header information about
|
||||
the archived resource. The above example value would decode to the following
|
||||
JSON object (whitespace added for readability):
|
||||
|
||||
{
|
||||
"name": "root",
|
||||
"size": 4096,
|
||||
"mode": 2147484096,
|
||||
"mtime": "2014-02-27T20:51:23Z",
|
||||
"linkTarget": ""
|
||||
}
|
||||
```json
|
||||
{
|
||||
"name": "root",
|
||||
"size": 4096,
|
||||
"mode": 2147484096,
|
||||
"mtime": "2014-02-27T20:51:23Z",
|
||||
"linkTarget": ""
|
||||
}
|
||||
```
|
||||
|
||||
A `HEAD` request can also be made to this endpoint if only this information is
|
||||
desired.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - success, returns archive of copied resource
|
||||
- **400** - client error, bad parameter, details in JSON response body, one of:
|
||||
@@ -1199,7 +1205,7 @@ Status Codes:
|
||||
Upload a tar archive to be extracted to a path in the filesystem of container
|
||||
`id`.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **path** - path to a directory in the container
|
||||
to extract the archive's contents into. Required.
|
||||
@@ -1212,16 +1218,16 @@ Query Parameters:
|
||||
|
||||
**Example request**:
|
||||
|
||||
PUT /containers/8cce319429b2/archive?path=/vol1 HTTP/1.1
|
||||
Content-Type: application/x-tar
|
||||
PUT /containers/8cce319429b2/archive?path=/vol1 HTTP/1.1
|
||||
Content-Type: application/x-tar
|
||||
|
||||
{{ TAR STREAM }}
|
||||
{{ TAR STREAM }}
|
||||
|
||||
**Example response**:
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – the content was extracted successfully
|
||||
- **400** - client error, bad parameter, details in JSON response body, one of:
|
||||
@@ -1323,7 +1329,7 @@ digest. You can reference this digest using the value:
|
||||
See the `docker run` and `docker build` commands for examples of digest and tag
|
||||
references on the command line.
|
||||
|
||||
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. Available filters:
|
||||
@@ -1367,7 +1373,7 @@ command*](../../reference/builder.md#add)).
|
||||
The build is canceled if the client drops the connection by quitting
|
||||
or being killed.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **dockerfile** - Path within the build context to the Dockerfile. This is
|
||||
ignored if `remote` is specified and points to an individual filename.
|
||||
@@ -1375,7 +1381,7 @@ Query Parameters:
|
||||
the resulting image in case of success.
|
||||
- **remote** – A Git repository URI or HTTP/HTTPS URI build source. If the
|
||||
URI specifies a filename, the file's contents are placed into a file
|
||||
called `Dockerfile`.
|
||||
called `Dockerfile`.
|
||||
- **q** – Suppress verbose build output.
|
||||
- **nocache** – Do not use the cache when building the image.
|
||||
- **pull** - Attempt to pull the image even if an older image exists locally.
|
||||
@@ -1414,7 +1420,7 @@ Query Parameters:
|
||||
be specified with both a "https://" prefix and a "/v1/" suffix even
|
||||
though Docker will prefer to use the v2 registry API.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -1443,7 +1449,7 @@ When using this endpoint to pull an image from the registry, the
|
||||
`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. The value may be a URL from which the image
|
||||
@@ -1455,7 +1461,7 @@ Query Parameters:
|
||||
|
||||
- **X-Registry-Auth** – base64-encoded AuthConfig object
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -1508,7 +1514,7 @@ Return low-level information on the image `name`
|
||||
"Size": 6824592
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such image
|
||||
@@ -1562,7 +1568,7 @@ Return the history of the image `name`
|
||||
}
|
||||
]
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such image
|
||||
@@ -1597,7 +1603,7 @@ then be used in the URL. This duplicates the command line's flow.
|
||||
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. This is optional.
|
||||
|
||||
@@ -1606,7 +1612,7 @@ Request Headers:
|
||||
- **X-Registry-Auth** – Include a base64-encoded AuthConfig.
|
||||
object.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such image
|
||||
@@ -1626,13 +1632,13 @@ Tag the image `name` into a repository
|
||||
|
||||
HTTP/1.1 201 Created
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **repo** – The repository to tag in
|
||||
- **force** – 1/True/true or 0/False/false, default false
|
||||
- **tag** - The new tag name
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -1661,12 +1667,12 @@ 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
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such image
|
||||
@@ -1717,11 +1723,11 @@ Search for an image on [Docker Hub](https://hub.docker.com).
|
||||
...
|
||||
]
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **term** – term to search
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -1750,7 +1756,7 @@ Get the default username and email
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **204** – no error
|
||||
@@ -1820,7 +1826,7 @@ Display system-wide information
|
||||
"SystemTime": "2015-03-10T11:11:23.730591467-07:00"
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -1851,7 +1857,7 @@ Show the docker version information
|
||||
"Experimental": false
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -1873,7 +1879,7 @@ Ping the docker server
|
||||
|
||||
OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **500** - server error
|
||||
@@ -1929,11 +1935,11 @@ Create a new image from a container's changes
|
||||
|
||||
{"Id": "596069db4bf5"}
|
||||
|
||||
Json Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **config** - the container's configuration
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **container** – source container
|
||||
- **repo** – repository
|
||||
@@ -1944,7 +1950,7 @@ Query Parameters:
|
||||
- **pause** – 1/True/true or 0/False/false, whether to pause the container before committing
|
||||
- **changes** – Dockerfile instructions to apply while committing
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **404** – no such container
|
||||
@@ -1979,16 +1985,16 @@ and Docker images report:
|
||||
{"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
|
||||
- **until** – Timestamp used for polling
|
||||
- **filters** – A json encoded value of the filters (a map[string][]string) to process on the event list. Available filters:
|
||||
- `container=<string>`; -- container to filter
|
||||
- `event=<string>`; -- event to filter
|
||||
- `image=<string>`; -- image to filter
|
||||
- `container=<string>`; -- container to filter
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2018,7 +2024,7 @@ See the [image tarball format](#image-tarball-format) for more details.
|
||||
|
||||
Binary data stream
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2047,7 +2053,7 @@ See the [image tarball format](#image-tarball-format) for more details.
|
||||
|
||||
Binary data stream
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2062,6 +2068,7 @@ See the [image tarball format](#image-tarball-format) for more details.
|
||||
**Example request**
|
||||
|
||||
POST /images/load
|
||||
Content-Type: application/x-tar
|
||||
|
||||
Tarball in body
|
||||
|
||||
@@ -2069,7 +2076,7 @@ See the [image tarball format](#image-tarball-format) for more details.
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2126,7 +2133,7 @@ Sets up an exec instance in a running container `id`
|
||||
"Warnings":[]
|
||||
}
|
||||
|
||||
Json Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **AttachStdin** - Boolean value, attaches to `stdin` of the `exec` command.
|
||||
- **AttachStdout** - Boolean value, attaches to `stdout` of the `exec` command.
|
||||
@@ -2135,7 +2142,7 @@ Json Parameters:
|
||||
- **Cmd** - Command to run specified as a string or an array of strings.
|
||||
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **404** – no such container
|
||||
@@ -2165,12 +2172,12 @@ interactive session with the `exec` command.
|
||||
|
||||
{{ STREAM }}
|
||||
|
||||
Json Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **Detach** - Detach from the `exec` command.
|
||||
- **Tty** - Boolean value to allocate a pseudo-TTY.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such exec instance
|
||||
@@ -2195,12 +2202,12 @@ This API is valid only if `tty` was specified as part of creating and starting t
|
||||
HTTP/1.1 201 Created
|
||||
Content-Type: text/plain
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **h** – height of `tty` session
|
||||
- **w** – width
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **404** – no such exec instance
|
||||
@@ -2302,7 +2309,7 @@ Return low-level information about the `exec` command `id`.
|
||||
}
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such exec instance
|
||||
|
||||
@@ -100,7 +100,7 @@ List containers
|
||||
}
|
||||
]
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **all** – 1/True/true or 0/False/false, Show all containers.
|
||||
Only running containers are shown by default (i.e., this defaults to false)
|
||||
@@ -117,7 +117,7 @@ Query Parameters:
|
||||
- `status=`(`created`|`restarting`|`running`|`paused`|`exited`)
|
||||
- `label=key` or `label="key=value"` of a container label
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -151,7 +151,7 @@ Create a container
|
||||
"Cmd": [
|
||||
"date"
|
||||
],
|
||||
"Entrypoint": "",
|
||||
"Entrypoint": null,
|
||||
"Image": "ubuntu",
|
||||
"Labels": {
|
||||
"com.example.vendor": "Acme",
|
||||
@@ -219,7 +219,7 @@ Create a container
|
||||
"Warnings":[]
|
||||
}
|
||||
|
||||
Json Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **Hostname** - A string value containing the hostname to use for the
|
||||
container.
|
||||
@@ -322,12 +322,12 @@ Json Parameters:
|
||||
- **CgroupParent** - Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist.
|
||||
- **VolumeDriver** - Driver that this container users to mount volumes.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **name** – Assign the specified name to the container. Must
|
||||
match `/?[a-zA-Z0-9_-]+`.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -342,7 +342,6 @@ Status Codes:
|
||||
|
||||
Return low-level information on the container `id`
|
||||
|
||||
|
||||
**Example request**:
|
||||
|
||||
GET /containers/4fa6e0f0c678/json HTTP/1.1
|
||||
@@ -517,11 +516,11 @@ Return low-level information on the container `id`
|
||||
....
|
||||
}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **size** – 1/True/true or 0/False/false, return container size information. Default is `false`.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -581,11 +580,11 @@ supported on Windows.
|
||||
],
|
||||
}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **ps_args** – `ps` arguments to use (e.g., `aux`), defaults to `-ef`
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -613,7 +612,7 @@ Get `stdout` and `stderr` logs from the container ``id``
|
||||
|
||||
{{ 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`.
|
||||
@@ -624,7 +623,7 @@ Query Parameters:
|
||||
every log line. Default `false`.
|
||||
- **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **101** – no error, hints proxy about hijacking
|
||||
- **200** – no error, no upgrade header found
|
||||
@@ -667,7 +666,7 @@ Values for `Kind`:
|
||||
- `1`: Add
|
||||
- `2`: Delete
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -690,7 +689,7 @@ Export the contents of container `id`
|
||||
|
||||
{{ TAR STREAM }}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -807,11 +806,11 @@ This endpoint returns a live stream of a container's resource usage statistics.
|
||||
|
||||
The precpu_stats is the cpu statistic of last read, which is used for calculating the cpu usage percent. It is not the exact copy of the “cpu_stats” field.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **stream** – 1/True/true or 0/False/false, pull stats once then disconnect. Default `true`.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -833,12 +832,12 @@ Resize the TTY for container with `id`. The unit is number of characters. You m
|
||||
Content-Length: 0
|
||||
Content-Type: text/plain; charset=utf-8
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **h** – height of `tty` session
|
||||
- **w** – width
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – No such container
|
||||
@@ -862,7 +861,7 @@ Start the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **304** – container already started
|
||||
@@ -883,11 +882,11 @@ Stop the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **t** – number of seconds to wait before killing the container
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **304** – container already stopped
|
||||
@@ -908,11 +907,11 @@ Restart the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **t** – number of seconds to wait before killing the container
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -932,12 +931,12 @@ Kill the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters
|
||||
**Query parameters**:
|
||||
|
||||
- **signal** - Signal to send to the container: integer or string like `SIGINT`.
|
||||
When not set, `SIGKILL` is assumed and the call waits for the container to exit.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -957,11 +956,11 @@ Rename the container `id` to a `new_name`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **name** – new name for the container
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -982,7 +981,7 @@ Pause the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -1002,7 +1001,7 @@ Unpause the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -1027,7 +1026,7 @@ Attach to the container `id`
|
||||
|
||||
{{ STREAM }}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **logs** – 1/True/true or 0/False/false, return logs. Default `false`.
|
||||
- **stream** – 1/True/true or 0/False/false, return stream.
|
||||
@@ -1039,7 +1038,7 @@ Query Parameters:
|
||||
- **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**:
|
||||
|
||||
- **101** – no error, hints proxy about hijacking
|
||||
- **200** – no error, no upgrade header found
|
||||
@@ -1107,7 +1106,7 @@ Implements websocket protocol handshake according to [RFC 6455](http://tools.iet
|
||||
|
||||
{{ STREAM }}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **logs** – 1/True/true or 0/False/false, return logs. Default `false`.
|
||||
- **stream** – 1/True/true or 0/False/false, return stream.
|
||||
@@ -1119,7 +1118,7 @@ Query Parameters:
|
||||
- **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
|
||||
@@ -1143,7 +1142,7 @@ Block until container `id` stops, then returns the exit code
|
||||
|
||||
{"StatusCode": 0}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -1163,14 +1162,14 @@ Remove the container `id` from the filesystem
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **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.
|
||||
Default `false`.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -1202,7 +1201,7 @@ Copy files or folders of container `id`
|
||||
|
||||
{{ TAR STREAM }}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -1221,7 +1220,7 @@ following section.
|
||||
|
||||
Get a tar archive of a resource in the filesystem of container `id`.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **path** - resource in the container's filesystem to archive. Required.
|
||||
|
||||
@@ -1232,39 +1231,41 @@ Query Parameters:
|
||||
indicates that only the contents of the **path** directory should be
|
||||
copied. A symlink is always resolved to its target.
|
||||
|
||||
**Note**: It is not possible to copy certain system files such as resources
|
||||
under `/proc`, `/sys`, `/dev`, and mounts created by the user in the
|
||||
container.
|
||||
> **Note**: It is not possible to copy certain system files such as resources
|
||||
> under `/proc`, `/sys`, `/dev`, and mounts created by the user in the
|
||||
> container.
|
||||
|
||||
**Example request**:
|
||||
|
||||
GET /containers/8cce319429b2/archive?path=/root HTTP/1.1
|
||||
GET /containers/8cce319429b2/archive?path=/root HTTP/1.1
|
||||
|
||||
**Example response**:
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/x-tar
|
||||
X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0=
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/x-tar
|
||||
X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0=
|
||||
|
||||
{{ TAR STREAM }}
|
||||
{{ TAR STREAM }}
|
||||
|
||||
On success, a response header `X-Docker-Container-Path-Stat` will be set to a
|
||||
base64-encoded JSON object containing some filesystem header information about
|
||||
the archived resource. The above example value would decode to the following
|
||||
JSON object (whitespace added for readability):
|
||||
|
||||
{
|
||||
"name": "root",
|
||||
"size": 4096,
|
||||
"mode": 2147484096,
|
||||
"mtime": "2014-02-27T20:51:23Z",
|
||||
"linkTarget": ""
|
||||
}
|
||||
```json
|
||||
{
|
||||
"name": "root",
|
||||
"size": 4096,
|
||||
"mode": 2147484096,
|
||||
"mtime": "2014-02-27T20:51:23Z",
|
||||
"linkTarget": ""
|
||||
}
|
||||
```
|
||||
|
||||
A `HEAD` request can also be made to this endpoint if only this information is
|
||||
desired.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - success, returns archive of copied resource
|
||||
- **400** - client error, bad parameter, details in JSON response body, one of:
|
||||
@@ -1283,7 +1284,7 @@ Status Codes:
|
||||
Upload a tar archive to be extracted to a path in the filesystem of container
|
||||
`id`.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **path** - path to a directory in the container
|
||||
to extract the archive's contents into. Required.
|
||||
@@ -1305,7 +1306,7 @@ Query Parameters:
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – the content was extracted successfully
|
||||
- **400** - client error, bad parameter, details in JSON response body, one of:
|
||||
@@ -1407,7 +1408,7 @@ digest. You can reference this digest using the value:
|
||||
See the `docker run` and `docker build` commands for examples of digest and tag
|
||||
references on the command line.
|
||||
|
||||
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. Available filters:
|
||||
@@ -1451,7 +1452,7 @@ command*](../../reference/builder.md#add)).
|
||||
The build is canceled if the client drops the connection by quitting
|
||||
or being killed.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **dockerfile** - Path within the build context to the Dockerfile. This is
|
||||
ignored if `remote` is specified and points to an individual filename.
|
||||
@@ -1460,7 +1461,7 @@ Query Parameters:
|
||||
You can provide one or more `t` parameters.
|
||||
- **remote** – A Git repository URI or HTTP/HTTPS URI build source. If the
|
||||
URI specifies a filename, the file's contents are placed into a file
|
||||
called `Dockerfile`.
|
||||
called `Dockerfile`.
|
||||
- **q** – Suppress verbose build output.
|
||||
- **nocache** – Do not use the cache when building the image.
|
||||
- **pull** - Attempt to pull the image even if an older image exists locally.
|
||||
@@ -1504,7 +1505,7 @@ Query Parameters:
|
||||
be specified with both a "https://" prefix and a "/v1/" suffix even
|
||||
though Docker will prefer to use the v2 registry API.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -1533,7 +1534,7 @@ When using this endpoint to pull an image from the registry, the
|
||||
`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. The name may include a tag or
|
||||
digest. This parameter may only be used when pulling an image.
|
||||
@@ -1549,7 +1550,7 @@ Query Parameters:
|
||||
|
||||
- **X-Registry-Auth** – base64-encoded AuthConfig object
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -1661,7 +1662,7 @@ Return low-level information on the image `name`
|
||||
}
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such image
|
||||
@@ -1715,7 +1716,7 @@ Return the history of the image `name`
|
||||
}
|
||||
]
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such image
|
||||
@@ -1750,7 +1751,7 @@ then be used in the URL. This duplicates the command line's flow.
|
||||
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. This is optional.
|
||||
|
||||
@@ -1759,7 +1760,7 @@ Request Headers:
|
||||
- **X-Registry-Auth** – Include a base64-encoded AuthConfig.
|
||||
object.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such image
|
||||
@@ -1779,13 +1780,13 @@ Tag the image `name` into a repository
|
||||
|
||||
HTTP/1.1 201 Created
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **repo** – The repository to tag in
|
||||
- **force** – 1/True/true or 0/False/false, default false
|
||||
- **tag** - The new tag name
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -1814,12 +1815,12 @@ 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
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such image
|
||||
@@ -1870,11 +1871,11 @@ Search for an image on [Docker Hub](https://hub.docker.com).
|
||||
...
|
||||
]
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **term** – term to search
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -1903,7 +1904,7 @@ Get the default username and email
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **204** – no error
|
||||
@@ -1975,7 +1976,7 @@ Display system-wide information
|
||||
"SystemTime": "2015-03-10T11:11:23.730591467-07:00"
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2006,7 +2007,7 @@ Show the docker version information
|
||||
"Experimental": false
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2028,7 +2029,7 @@ Ping the docker server
|
||||
|
||||
OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **500** - server error
|
||||
@@ -2084,11 +2085,11 @@ Create a new image from a container's changes
|
||||
|
||||
{"Id": "596069db4bf5"}
|
||||
|
||||
Json Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **config** - the container's configuration
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **container** – source container
|
||||
- **repo** – repository
|
||||
@@ -2099,7 +2100,7 @@ Query Parameters:
|
||||
- **pause** – 1/True/true or 0/False/false, whether to pause the container before committing
|
||||
- **changes** – Dockerfile instructions to apply while committing
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **404** – no such container
|
||||
@@ -2134,7 +2135,7 @@ and Docker images report:
|
||||
{"status":"attach","id":"5745704abe9caa5","from":"busybox","time":1442421716,"timeNano":1442421716894759198}
|
||||
{"status":"start","id":"5745704abe9caa5","from":"busybox","time":1442421716,"timeNano":1442421716983607193}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **since** – Timestamp used for polling
|
||||
- **until** – Timestamp used for polling
|
||||
@@ -2144,7 +2145,7 @@ Query Parameters:
|
||||
- `image=<string>`; -- image to filter
|
||||
- `label=<string>`; -- image and container label to filter
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2174,7 +2175,7 @@ See the [image tarball format](#image-tarball-format) for more details.
|
||||
|
||||
Binary data stream
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2203,7 +2204,7 @@ See the [image tarball format](#image-tarball-format) for more details.
|
||||
|
||||
Binary data stream
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2218,6 +2219,7 @@ See the [image tarball format](#image-tarball-format) for more details.
|
||||
**Example request**
|
||||
|
||||
POST /images/load
|
||||
Content-Type: application/x-tar
|
||||
|
||||
Tarball in body
|
||||
|
||||
@@ -2225,7 +2227,7 @@ See the [image tarball format](#image-tarball-format) for more details.
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2282,7 +2284,7 @@ Sets up an exec instance in a running container `id`
|
||||
"Warnings":[]
|
||||
}
|
||||
|
||||
Json Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **AttachStdin** - Boolean value, attaches to `stdin` of the `exec` command.
|
||||
- **AttachStdout** - Boolean value, attaches to `stdout` of the `exec` command.
|
||||
@@ -2291,7 +2293,7 @@ Json Parameters:
|
||||
- **Cmd** - Command to run specified as a string or an array of strings.
|
||||
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **404** – no such container
|
||||
@@ -2323,12 +2325,12 @@ interactive session with the `exec` command.
|
||||
|
||||
{{ STREAM }}
|
||||
|
||||
Json Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **Detach** - Detach from the `exec` command.
|
||||
- **Tty** - Boolean value to allocate a pseudo-TTY.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such exec instance
|
||||
@@ -2354,12 +2356,12 @@ This API is valid only if `tty` was specified as part of creating and starting t
|
||||
HTTP/1.1 201 Created
|
||||
Content-Type: text/plain
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **h** – height of `tty` session
|
||||
- **w** – width
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **404** – no such exec instance
|
||||
@@ -2484,7 +2486,7 @@ Return low-level information about the `exec` command `id`.
|
||||
}
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such exec instance
|
||||
@@ -2515,11 +2517,11 @@ Status Codes:
|
||||
]
|
||||
}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **filters** - JSON encoded value of the filters (a `map[string][]string`) to process on the volumes list. There is one available filter: `dangling=true`
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **500** - server error
|
||||
@@ -2550,12 +2552,12 @@ Create a volume
|
||||
"Mountpoint": "/var/lib/docker/volumes/tardis"
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** - no error
|
||||
- **500** - server error
|
||||
|
||||
JSON Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **Name** - The new volume's name. If not specified, Docker generates a name.
|
||||
- **Driver** - Name of the volume driver to use. Defaults to `local` for the name.
|
||||
@@ -2583,7 +2585,7 @@ Return low-level information on the volume `name`
|
||||
"Mountpoint": "/var/lib/docker/volumes/tardis"
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **404** - no such volume
|
||||
@@ -2603,7 +2605,7 @@ Instruct the driver to remove the volume (`name`).
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Status Codes
|
||||
**Status codes**:
|
||||
|
||||
- **204** - no error
|
||||
- **404** - no such volume or volume driver
|
||||
@@ -2684,13 +2686,11 @@ Content-Type: application/json
|
||||
]
|
||||
```
|
||||
|
||||
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **filters** - JSON encoded value of the filters (a `map[string][]string`) to process on the networks list. Available filters: `name=[network-names]` , `id=[network-ids]`
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **500** - server error
|
||||
@@ -2741,7 +2741,7 @@ Content-Type: application/json
|
||||
}
|
||||
```
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **404** - network not found
|
||||
@@ -2760,7 +2760,7 @@ Content-Type: application/json
|
||||
|
||||
{
|
||||
"Name":"isolated_nw",
|
||||
"Driver":"bridge"
|
||||
"Driver":"bridge",
|
||||
"IPAM":{
|
||||
"Config":[{
|
||||
"Subnet":"172.20.0.0/16",
|
||||
@@ -2782,13 +2782,13 @@ Content-Type: application/json
|
||||
}
|
||||
```
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** - no error
|
||||
- **404** - plugin not found
|
||||
- **500** - server error
|
||||
|
||||
JSON Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **Name** - The new network's name. this is a mandatory field
|
||||
- **Driver** - Name of the network driver plugin to use. Defaults to `bridge` driver
|
||||
@@ -2817,13 +2817,13 @@ Content-Type: application/json
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **404** - network or container is not found
|
||||
- **500** - Internal Server Error
|
||||
|
||||
JSON Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **container** - container-id/name to be connected to the network
|
||||
|
||||
@@ -2848,13 +2848,13 @@ Content-Type: application/json
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **404** - network or container not found
|
||||
- **500** - Internal Server Error
|
||||
|
||||
JSON Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **Container** - container-id/name to be disconnected from a network
|
||||
|
||||
@@ -2872,7 +2872,7 @@ Instruct the driver to remove the network (`id`).
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
Status Codes
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **404** - no such network
|
||||
|
||||
@@ -187,7 +187,7 @@ List containers
|
||||
}
|
||||
]
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **all** – 1/True/true or 0/False/false, Show all containers.
|
||||
Only running containers are shown by default (i.e., this defaults to false)
|
||||
@@ -205,7 +205,7 @@ Query Parameters:
|
||||
- `label=key` or `label="key=value"` of a container label
|
||||
- `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only)
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -239,7 +239,7 @@ Create a container
|
||||
"Cmd": [
|
||||
"date"
|
||||
],
|
||||
"Entrypoint": "",
|
||||
"Entrypoint": null,
|
||||
"Image": "ubuntu",
|
||||
"Labels": {
|
||||
"com.example.vendor": "Acme",
|
||||
@@ -301,14 +301,15 @@ Create a container
|
||||
"ShmSize": 67108864
|
||||
},
|
||||
"NetworkingConfig": {
|
||||
"EndpointsConfig": {
|
||||
"isolated_nw" : {
|
||||
"IPAMConfig": {
|
||||
"IPv4Address":"172.20.30.33",
|
||||
"IPv6Address":"2001:db8:abcd::3033"
|
||||
},
|
||||
"Links":["container_1", "container_2"],
|
||||
"Aliases":["server_x", "server_y"]
|
||||
"EndpointsConfig": {
|
||||
"isolated_nw" : {
|
||||
"IPAMConfig": {
|
||||
"IPv4Address":"172.20.30.33",
|
||||
"IPv6Address":"2001:db8:abcd::3033"
|
||||
},
|
||||
"Links":["container_1", "container_2"],
|
||||
"Aliases":["server_x", "server_y"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -323,7 +324,7 @@ Create a container
|
||||
"Warnings":[]
|
||||
}
|
||||
|
||||
Json Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **Hostname** - A string value containing the hostname to use for the
|
||||
container.
|
||||
@@ -434,12 +435,12 @@ Json Parameters:
|
||||
- **VolumeDriver** - Driver that this container users to mount volumes.
|
||||
- **ShmSize** - Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **name** – Assign the specified name to the container. Must
|
||||
match `/?[a-zA-Z0-9_-]+`.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -454,7 +455,6 @@ Status Codes:
|
||||
|
||||
Return low-level information on the container `id`
|
||||
|
||||
|
||||
**Example request**:
|
||||
|
||||
GET /containers/4fa6e0f0c678/json HTTP/1.1
|
||||
@@ -500,8 +500,8 @@ Return low-level information on the container `id`
|
||||
"Tty": false,
|
||||
"User": "",
|
||||
"Volumes": {
|
||||
"/volumes/data": {}
|
||||
},
|
||||
"/volumes/data": {}
|
||||
},
|
||||
"WorkingDir": "",
|
||||
"StopSignal": "SIGTERM"
|
||||
},
|
||||
@@ -642,11 +642,11 @@ Return low-level information on the container `id`
|
||||
....
|
||||
}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **size** – 1/True/true or 0/False/false, return container size information. Default is `false`.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -706,11 +706,11 @@ supported on Windows.
|
||||
],
|
||||
}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **ps_args** – `ps` arguments to use (e.g., `aux`), defaults to `-ef`
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -738,7 +738,7 @@ Get `stdout` and `stderr` logs from the container ``id``
|
||||
|
||||
{{ 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`.
|
||||
@@ -749,7 +749,7 @@ Query Parameters:
|
||||
every log line. Default `false`.
|
||||
- **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **101** – no error, hints proxy about hijacking
|
||||
- **200** – no error, no upgrade header found
|
||||
@@ -792,7 +792,7 @@ Values for `Kind`:
|
||||
- `1`: Add
|
||||
- `2`: Delete
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -815,7 +815,7 @@ Export the contents of container `id`
|
||||
|
||||
{{ TAR STREAM }}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -932,11 +932,11 @@ This endpoint returns a live stream of a container's resource usage statistics.
|
||||
|
||||
The precpu_stats is the cpu statistic of last read, which is used for calculating the cpu usage percent. It is not the exact copy of the “cpu_stats” field.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **stream** – 1/True/true or 0/False/false, pull stats once then disconnect. Default `true`.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -958,12 +958,12 @@ Resize the TTY for container with `id`. The unit is number of characters. You m
|
||||
Content-Length: 0
|
||||
Content-Type: text/plain; charset=utf-8
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **h** – height of `tty` session
|
||||
- **w** – width
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – No such container
|
||||
@@ -987,13 +987,13 @@ Start the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **detachKeys** – Override the key sequence for detaching a
|
||||
container. Format is a single character `[a-Z]` or `ctrl-<value>`
|
||||
where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **304** – container already started
|
||||
@@ -1014,11 +1014,11 @@ Stop the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **t** – number of seconds to wait before killing the container
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **304** – container already stopped
|
||||
@@ -1039,11 +1039,11 @@ Restart the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **t** – number of seconds to wait before killing the container
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -1063,12 +1063,12 @@ Kill the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters
|
||||
**Query parameters**:
|
||||
|
||||
- **signal** - Signal to send to the container: integer or string like `SIGINT`.
|
||||
When not set, `SIGKILL` is assumed and the call waits for the container to exit.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -1107,7 +1107,7 @@ Update resource configs of one or more containers.
|
||||
"Warnings": []
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -1128,11 +1128,11 @@ Rename the container `id` to a `new_name`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **name** – new name for the container
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -1153,7 +1153,7 @@ Pause the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -1173,7 +1173,7 @@ Unpause the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -1198,7 +1198,7 @@ Attach to the container `id`
|
||||
|
||||
{{ STREAM }}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **detachKeys** – Override the key sequence for detaching a
|
||||
container. Format is a single character `[a-Z]` or `ctrl-<value>`
|
||||
@@ -1213,12 +1213,13 @@ Query Parameters:
|
||||
- **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**:
|
||||
|
||||
- **101** – no error, hints proxy about hijacking
|
||||
- **200** – no error, no upgrade header found
|
||||
- **400** – bad parameter
|
||||
- **404** – no such container
|
||||
- **409** - container is paused
|
||||
- **500** – server error
|
||||
|
||||
**Stream details**:
|
||||
@@ -1281,7 +1282,7 @@ Implements websocket protocol handshake according to [RFC 6455](http://tools.iet
|
||||
|
||||
{{ STREAM }}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **detachKeys** – Override the key sequence for detaching a
|
||||
container. Format is a single character `[a-Z]` or `ctrl-<value>`
|
||||
@@ -1296,7 +1297,7 @@ Query Parameters:
|
||||
- **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
|
||||
@@ -1320,7 +1321,7 @@ Block until container `id` stops, then returns the exit code
|
||||
|
||||
{"StatusCode": 0}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -1340,14 +1341,14 @@ Remove the container `id` from the filesystem
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **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.
|
||||
Default `false`.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -1379,7 +1380,7 @@ Copy files or folders of container `id`
|
||||
|
||||
{{ TAR STREAM }}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -1398,7 +1399,7 @@ following section.
|
||||
|
||||
Get a tar archive of a resource in the filesystem of container `id`.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **path** - resource in the container's filesystem to archive. Required.
|
||||
|
||||
@@ -1409,39 +1410,41 @@ Query Parameters:
|
||||
indicates that only the contents of the **path** directory should be
|
||||
copied. A symlink is always resolved to its target.
|
||||
|
||||
**Note**: It is not possible to copy certain system files such as resources
|
||||
under `/proc`, `/sys`, `/dev`, and mounts created by the user in the
|
||||
container.
|
||||
> **Note**: It is not possible to copy certain system files such as resources
|
||||
> under `/proc`, `/sys`, `/dev`, and mounts created by the user in the
|
||||
> container.
|
||||
|
||||
**Example request**:
|
||||
|
||||
GET /containers/8cce319429b2/archive?path=/root HTTP/1.1
|
||||
GET /containers/8cce319429b2/archive?path=/root HTTP/1.1
|
||||
|
||||
**Example response**:
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/x-tar
|
||||
X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0=
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/x-tar
|
||||
X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0=
|
||||
|
||||
{{ TAR STREAM }}
|
||||
{{ TAR STREAM }}
|
||||
|
||||
On success, a response header `X-Docker-Container-Path-Stat` will be set to a
|
||||
base64-encoded JSON object containing some filesystem header information about
|
||||
the archived resource. The above example value would decode to the following
|
||||
JSON object (whitespace added for readability):
|
||||
|
||||
{
|
||||
"name": "root",
|
||||
"size": 4096,
|
||||
"mode": 2147484096,
|
||||
"mtime": "2014-02-27T20:51:23Z",
|
||||
"linkTarget": ""
|
||||
}
|
||||
```json
|
||||
{
|
||||
"name": "root",
|
||||
"size": 4096,
|
||||
"mode": 2147484096,
|
||||
"mtime": "2014-02-27T20:51:23Z",
|
||||
"linkTarget": ""
|
||||
}
|
||||
```
|
||||
|
||||
A `HEAD` request can also be made to this endpoint if only this information is
|
||||
desired.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - success, returns archive of copied resource
|
||||
- **400** - client error, bad parameter, details in JSON response body, one of:
|
||||
@@ -1460,7 +1463,7 @@ Status Codes:
|
||||
Upload a tar archive to be extracted to a path in the filesystem of container
|
||||
`id`.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **path** - path to a directory in the container
|
||||
to extract the archive's contents into. Required.
|
||||
@@ -1482,7 +1485,7 @@ Query Parameters:
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – the content was extracted successfully
|
||||
- **400** - client error, bad parameter, details in JSON response body, one of:
|
||||
@@ -1584,7 +1587,7 @@ digest. You can reference this digest using the value:
|
||||
See the `docker run` and `docker build` commands for examples of digest and tag
|
||||
references on the command line.
|
||||
|
||||
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. Available filters:
|
||||
@@ -1628,7 +1631,7 @@ command*](../../reference/builder.md#add)).
|
||||
The build is canceled if the client drops the connection by quitting
|
||||
or being killed.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **dockerfile** - Path within the build context to the Dockerfile. This is
|
||||
ignored if `remote` is specified and points to an individual filename.
|
||||
@@ -1637,7 +1640,7 @@ Query Parameters:
|
||||
You can provide one or more `t` parameters.
|
||||
- **remote** – A Git repository URI or HTTP/HTTPS URI build source. If the
|
||||
URI specifies a filename, the file's contents are placed into a file
|
||||
called `Dockerfile`.
|
||||
called `Dockerfile`.
|
||||
- **q** – Suppress verbose build output.
|
||||
- **nocache** – Do not use the cache when building the image.
|
||||
- **pull** - Attempt to pull the image even if an older image exists locally.
|
||||
@@ -1682,7 +1685,7 @@ Query Parameters:
|
||||
be specified with both a "https://" prefix and a "/v1/" suffix even
|
||||
though Docker will prefer to use the v2 registry API.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -1711,7 +1714,7 @@ When using this endpoint to pull an image from the registry, the
|
||||
`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. The name may include a tag or
|
||||
digest. This parameter may only be used when pulling an image.
|
||||
@@ -1745,7 +1748,7 @@ Query Parameters:
|
||||
}
|
||||
```
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -1857,7 +1860,7 @@ Return low-level information on the image `name`
|
||||
}
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such image
|
||||
@@ -1911,7 +1914,7 @@ Return the history of the image `name`
|
||||
}
|
||||
]
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such image
|
||||
@@ -1948,7 +1951,7 @@ The push is cancelled if the HTTP connection is closed.
|
||||
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. This is optional.
|
||||
|
||||
@@ -1973,7 +1976,7 @@ Request Headers:
|
||||
}
|
||||
```
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such image
|
||||
@@ -1993,13 +1996,13 @@ Tag the image `name` into a repository
|
||||
|
||||
HTTP/1.1 201 Created
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **repo** – The repository to tag in
|
||||
- **force** – 1/True/true or 0/False/false, default false
|
||||
- **tag** - The new tag name
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -2028,12 +2031,12 @@ 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
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such image
|
||||
@@ -2084,11 +2087,11 @@ Search for an image on [Docker Hub](https://hub.docker.com).
|
||||
...
|
||||
]
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **term** – term to search
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2117,7 +2120,7 @@ Get the default username and email
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **204** – no error
|
||||
@@ -2205,7 +2208,7 @@ Display system-wide information
|
||||
"SystemTime": "2015-03-10T11:11:23.730591467-07:00"
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2237,7 +2240,7 @@ Show the docker version information
|
||||
"Experimental": true
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2259,7 +2262,7 @@ Ping the docker server
|
||||
|
||||
OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **500** - server error
|
||||
@@ -2315,11 +2318,11 @@ Create a new image from a container's changes
|
||||
|
||||
{"Id": "596069db4bf5"}
|
||||
|
||||
Json Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **config** - the container's configuration
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **container** – source container
|
||||
- **repo** – repository
|
||||
@@ -2330,7 +2333,7 @@ Query Parameters:
|
||||
- **pause** – 1/True/true or 0/False/false, whether to pause the container before committing
|
||||
- **changes** – Dockerfile instructions to apply while committing
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **404** – no such container
|
||||
@@ -2518,7 +2521,7 @@ Docker networks report the following events:
|
||||
"timeNano": 1461943105338056026
|
||||
}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **since** – Timestamp used for polling
|
||||
- **until** – Timestamp used for polling
|
||||
@@ -2531,7 +2534,7 @@ Query Parameters:
|
||||
- `volume=<string>`; -- volume to filter
|
||||
- `network=<string>`; -- network to filter
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2561,12 +2564,12 @@ See the [image tarball format](#image-tarball-format) for more details.
|
||||
|
||||
Binary data stream
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
|
||||
### Get a tarball containing all images.
|
||||
### Get a tarball containing all images
|
||||
|
||||
`GET /images/get`
|
||||
|
||||
@@ -2590,7 +2593,7 @@ See the [image tarball format](#image-tarball-format) for more details.
|
||||
|
||||
Binary data stream
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2605,6 +2608,7 @@ See the [image tarball format](#image-tarball-format) for more details.
|
||||
**Example request**
|
||||
|
||||
POST /images/load
|
||||
Content-Type: application/x-tar
|
||||
|
||||
Tarball in body
|
||||
|
||||
@@ -2612,7 +2616,7 @@ See the [image tarball format](#image-tarball-format) for more details.
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2670,7 +2674,7 @@ Sets up an exec instance in a running container `id`
|
||||
"Warnings":[]
|
||||
}
|
||||
|
||||
Json Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **AttachStdin** - Boolean value, attaches to `stdin` of the `exec` command.
|
||||
- **AttachStdout** - Boolean value, attaches to `stdout` of the `exec` command.
|
||||
@@ -2682,7 +2686,7 @@ Json Parameters:
|
||||
- **Cmd** - Command to run specified as a string or an array of strings.
|
||||
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **404** – no such container
|
||||
@@ -2714,12 +2718,12 @@ interactive session with the `exec` command.
|
||||
|
||||
{{ STREAM }}
|
||||
|
||||
Json Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **Detach** - Detach from the `exec` command.
|
||||
- **Tty** - Boolean value to allocate a pseudo-TTY.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such exec instance
|
||||
@@ -2745,12 +2749,12 @@ This API is valid only if `tty` was specified as part of creating and starting t
|
||||
HTTP/1.1 201 Created
|
||||
Content-Type: text/plain
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **h** – height of `tty` session
|
||||
- **w** – width
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **404** – no such exec instance
|
||||
@@ -2792,7 +2796,7 @@ Return low-level information about the `exec` command `id`.
|
||||
"Running": false
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such exec instance
|
||||
@@ -2824,11 +2828,11 @@ Status Codes:
|
||||
"Warnings": []
|
||||
}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **filters** - JSON encoded value of the filters (a `map[string][]string`) to process on the volumes list. There is one available filter: `dangling=true`
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **500** - server error
|
||||
@@ -2859,12 +2863,12 @@ Create a volume
|
||||
"Mountpoint": "/var/lib/docker/volumes/tardis"
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** - no error
|
||||
- **500** - server error
|
||||
|
||||
JSON Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **Name** - The new volume's name. If not specified, Docker generates a name.
|
||||
- **Driver** - Name of the volume driver to use. Defaults to `local` for the name.
|
||||
@@ -2892,7 +2896,7 @@ Return low-level information on the volume `name`
|
||||
"Mountpoint": "/var/lib/docker/volumes/tardis"
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **404** - no such volume
|
||||
@@ -2912,7 +2916,7 @@ Instruct the driver to remove the volume (`name`).
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Status Codes
|
||||
**Status codes**:
|
||||
|
||||
- **204** - no error
|
||||
- **404** - no such volume or volume driver
|
||||
@@ -2993,14 +2997,14 @@ Content-Type: application/json
|
||||
]
|
||||
```
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **filters** - JSON encoded network list filter. The filter value is one of:
|
||||
- `name=<network-name>` Matches all or part of a network name.
|
||||
- `id=<network-id>` Matches all or part of a network id.
|
||||
- `name=<network-name>` Matches all or part of a network name.
|
||||
- `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **500** - server error
|
||||
@@ -3056,7 +3060,7 @@ Content-Type: application/json
|
||||
}
|
||||
```
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **404** - network not found
|
||||
@@ -3108,13 +3112,13 @@ Content-Type: application/json
|
||||
}
|
||||
```
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** - no error
|
||||
- **404** - plugin not found
|
||||
- **500** - server error
|
||||
|
||||
JSON Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **Name** - The new network's name. this is a mandatory field
|
||||
- **Driver** - Name of the network driver plugin to use. Defaults to `bridge` driver
|
||||
@@ -3149,13 +3153,13 @@ Content-Type: application/json
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **404** - network or container is not found
|
||||
- **500** - Internal Server Error
|
||||
|
||||
JSON Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **container** - container-id/name to be connected to the network
|
||||
|
||||
@@ -3181,13 +3185,13 @@ Content-Type: application/json
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **404** - network or container not found
|
||||
- **500** - Internal Server Error
|
||||
|
||||
JSON Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **Container** - container-id/name to be disconnected from a network
|
||||
- **Force** - Force the container to disconnect from a network
|
||||
@@ -3206,7 +3210,7 @@ Instruct the driver to remove the network (`id`).
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
Status Codes
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **404** - no such network
|
||||
|
||||
@@ -202,7 +202,7 @@ List containers
|
||||
}
|
||||
]
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **all** – 1/True/true or 0/False/false, Show all containers.
|
||||
Only running containers are shown by default (i.e., this defaults to false)
|
||||
@@ -224,7 +224,7 @@ Query Parameters:
|
||||
- `since`=(`<container id>` or `<container name>`)
|
||||
- `volume`=(`<volume name>` or `<mount point destination>`)
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -321,14 +321,15 @@ Create a container
|
||||
"ShmSize": 67108864
|
||||
},
|
||||
"NetworkingConfig": {
|
||||
"EndpointsConfig": {
|
||||
"isolated_nw" : {
|
||||
"IPAMConfig": {
|
||||
"IPv4Address":"172.20.30.33",
|
||||
"IPv6Address":"2001:db8:abcd::3033"
|
||||
},
|
||||
"Links":["container_1", "container_2"],
|
||||
"Aliases":["server_x", "server_y"]
|
||||
"EndpointsConfig": {
|
||||
"isolated_nw" : {
|
||||
"IPAMConfig": {
|
||||
"IPv4Address":"172.20.30.33",
|
||||
"IPv6Address":"2001:db8:abcd::3033"
|
||||
},
|
||||
"Links":["container_1", "container_2"],
|
||||
"Aliases":["server_x", "server_y"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -343,7 +344,7 @@ Create a container
|
||||
"Warnings":[]
|
||||
}
|
||||
|
||||
Json Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **Hostname** - A string value containing the hostname to use for the
|
||||
container.
|
||||
@@ -457,12 +458,12 @@ Json Parameters:
|
||||
- **VolumeDriver** - Driver that this container users to mount volumes.
|
||||
- **ShmSize** - Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **name** – Assign the specified name to the container. Must
|
||||
match `/?[a-zA-Z0-9_-]+`.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -477,7 +478,6 @@ Status Codes:
|
||||
|
||||
Return low-level information on the container `id`
|
||||
|
||||
|
||||
**Example request**:
|
||||
|
||||
GET /containers/4fa6e0f0c678/json HTTP/1.1
|
||||
@@ -665,11 +665,11 @@ Return low-level information on the container `id`
|
||||
....
|
||||
}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **size** – 1/True/true or 0/False/false, return container size information. Default is `false`.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -729,11 +729,11 @@ supported on Windows.
|
||||
],
|
||||
}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **ps_args** – `ps` arguments to use (e.g., `aux`), defaults to `-ef`
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -761,7 +761,7 @@ Get `stdout` and `stderr` logs from the container ``id``
|
||||
|
||||
{{ 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`.
|
||||
@@ -772,7 +772,7 @@ Query Parameters:
|
||||
every log line. Default `false`.
|
||||
- **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **101** – no error, hints proxy about hijacking
|
||||
- **200** – no error, no upgrade header found
|
||||
@@ -815,7 +815,7 @@ Values for `Kind`:
|
||||
- `1`: Add
|
||||
- `2`: Delete
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -838,7 +838,7 @@ Export the contents of container `id`
|
||||
|
||||
{{ TAR STREAM }}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -958,11 +958,11 @@ This endpoint returns a live stream of a container's resource usage statistics.
|
||||
|
||||
The precpu_stats is the cpu statistic of last read, which is used for calculating the cpu usage percent. It is not the exact copy of the “cpu_stats” field.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **stream** – 1/True/true or 0/False/false, pull stats once then disconnect. Default `true`.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -984,12 +984,12 @@ Resize the TTY for container with `id`. The unit is number of characters. You m
|
||||
Content-Length: 0
|
||||
Content-Type: text/plain; charset=utf-8
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **h** – height of `tty` session
|
||||
- **w** – width
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – No such container
|
||||
@@ -1013,13 +1013,13 @@ Start the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **detachKeys** – Override the key sequence for detaching a
|
||||
container. Format is a single character `[a-Z]` or `ctrl-<value>`
|
||||
where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **304** – container already started
|
||||
@@ -1040,11 +1040,11 @@ Stop the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **t** – number of seconds to wait before killing the container
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **304** – container already stopped
|
||||
@@ -1065,11 +1065,11 @@ Restart the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **t** – number of seconds to wait before killing the container
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -1089,12 +1089,12 @@ Kill the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters
|
||||
**Query parameters**:
|
||||
|
||||
- **signal** - Signal to send to the container: integer or string like `SIGINT`.
|
||||
When not set, `SIGKILL` is assumed and the call waits for the container to exit.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -1137,7 +1137,7 @@ Update configuration of one or more containers.
|
||||
"Warnings": []
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -1158,11 +1158,11 @@ Rename the container `id` to a `new_name`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **name** – new name for the container
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -1183,7 +1183,7 @@ Pause the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -1203,7 +1203,7 @@ Unpause the container `id`
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **404** – no such container
|
||||
@@ -1228,7 +1228,7 @@ Attach to the container `id`
|
||||
|
||||
{{ STREAM }}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **detachKeys** – Override the key sequence for detaching a
|
||||
container. Format is a single character `[a-Z]` or `ctrl-<value>`
|
||||
@@ -1243,12 +1243,13 @@ Query Parameters:
|
||||
- **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**:
|
||||
|
||||
- **101** – no error, hints proxy about hijacking
|
||||
- **200** – no error, no upgrade header found
|
||||
- **400** – bad parameter
|
||||
- **404** – no such container
|
||||
- **409** - container is paused
|
||||
- **500** – server error
|
||||
|
||||
**Stream details**:
|
||||
@@ -1311,7 +1312,7 @@ Implements websocket protocol handshake according to [RFC 6455](http://tools.iet
|
||||
|
||||
{{ STREAM }}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **detachKeys** – Override the key sequence for detaching a
|
||||
container. Format is a single character `[a-Z]` or `ctrl-<value>`
|
||||
@@ -1326,7 +1327,7 @@ Query Parameters:
|
||||
- **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
|
||||
@@ -1350,7 +1351,7 @@ Block until container `id` stops, then returns the exit code
|
||||
|
||||
{"StatusCode": 0}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -1370,14 +1371,14 @@ Remove the container `id` from the filesystem
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **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.
|
||||
Default `false`.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **204** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -1409,7 +1410,7 @@ Copy files or folders of container `id`
|
||||
|
||||
{{ TAR STREAM }}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such container
|
||||
@@ -1428,7 +1429,7 @@ following section.
|
||||
|
||||
Get a tar archive of a resource in the filesystem of container `id`.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **path** - resource in the container's filesystem to archive. Required.
|
||||
|
||||
@@ -1439,39 +1440,41 @@ Query Parameters:
|
||||
indicates that only the contents of the **path** directory should be
|
||||
copied. A symlink is always resolved to its target.
|
||||
|
||||
**Note**: It is not possible to copy certain system files such as resources
|
||||
under `/proc`, `/sys`, `/dev`, and mounts created by the user in the
|
||||
container.
|
||||
> **Note**: It is not possible to copy certain system files such as resources
|
||||
> under `/proc`, `/sys`, `/dev`, and mounts created by the user in the
|
||||
> container.
|
||||
|
||||
**Example request**:
|
||||
|
||||
GET /containers/8cce319429b2/archive?path=/root HTTP/1.1
|
||||
GET /containers/8cce319429b2/archive?path=/root HTTP/1.1
|
||||
|
||||
**Example response**:
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/x-tar
|
||||
X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0=
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/x-tar
|
||||
X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0=
|
||||
|
||||
{{ TAR STREAM }}
|
||||
{{ TAR STREAM }}
|
||||
|
||||
On success, a response header `X-Docker-Container-Path-Stat` will be set to a
|
||||
base64-encoded JSON object containing some filesystem header information about
|
||||
the archived resource. The above example value would decode to the following
|
||||
JSON object (whitespace added for readability):
|
||||
|
||||
{
|
||||
"name": "root",
|
||||
"size": 4096,
|
||||
"mode": 2147484096,
|
||||
"mtime": "2014-02-27T20:51:23Z",
|
||||
"linkTarget": ""
|
||||
}
|
||||
```json
|
||||
{
|
||||
"name": "root",
|
||||
"size": 4096,
|
||||
"mode": 2147484096,
|
||||
"mtime": "2014-02-27T20:51:23Z",
|
||||
"linkTarget": ""
|
||||
}
|
||||
```
|
||||
|
||||
A `HEAD` request can also be made to this endpoint if only this information is
|
||||
desired.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - success, returns archive of copied resource
|
||||
- **400** - client error, bad parameter, details in JSON response body, one of:
|
||||
@@ -1490,7 +1493,7 @@ Status Codes:
|
||||
Upload a tar archive to be extracted to a path in the filesystem of container
|
||||
`id`.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **path** - path to a directory in the container
|
||||
to extract the archive's contents into. Required.
|
||||
@@ -1512,7 +1515,7 @@ Query Parameters:
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – the content was extracted successfully
|
||||
- **400** - client error, bad parameter, details in JSON response body, one of:
|
||||
@@ -1614,7 +1617,7 @@ digest. You can reference this digest using the value:
|
||||
See the `docker run` and `docker build` commands for examples of digest and tag
|
||||
references on the command line.
|
||||
|
||||
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. Available filters:
|
||||
@@ -1658,7 +1661,7 @@ command*](../../reference/builder.md#add)).
|
||||
The build is canceled if the client drops the connection by quitting
|
||||
or being killed.
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **dockerfile** - Path within the build context to the Dockerfile. This is
|
||||
ignored if `remote` is specified and points to an individual filename.
|
||||
@@ -1713,7 +1716,7 @@ Query Parameters:
|
||||
be specified with both a "https://" prefix and a "/v1/" suffix even
|
||||
though Docker will prefer to use the v2 registry API.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -1742,7 +1745,7 @@ When using this endpoint to pull an image from the registry, the
|
||||
`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. The name may include a tag or
|
||||
digest. This parameter may only be used when pulling an image.
|
||||
@@ -1776,7 +1779,7 @@ Query Parameters:
|
||||
}
|
||||
```
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -1895,7 +1898,7 @@ Return low-level information on the image `name`
|
||||
}
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such image
|
||||
@@ -1949,7 +1952,7 @@ Return the history of the image `name`
|
||||
}
|
||||
]
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such image
|
||||
@@ -1986,7 +1989,7 @@ The push is cancelled if the HTTP connection is closed.
|
||||
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. This is optional.
|
||||
|
||||
@@ -2011,7 +2014,7 @@ Request Headers:
|
||||
}
|
||||
```
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such image
|
||||
@@ -2031,13 +2034,13 @@ Tag the image `name` into a repository
|
||||
|
||||
HTTP/1.1 201 Created
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **repo** – The repository to tag in
|
||||
- **force** – 1/True/true or 0/False/false, default false
|
||||
- **tag** - The new tag name
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **400** – bad parameter
|
||||
@@ -2066,12 +2069,12 @@ 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
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such image
|
||||
@@ -2122,11 +2125,11 @@ Search for an image on [Docker Hub](https://hub.docker.com).
|
||||
...
|
||||
]
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **term** – term to search
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2160,7 +2163,7 @@ if available, for accessing the registry without password.
|
||||
"IdentityToken": "9cbaf023786cd7..."
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **204** – no error
|
||||
@@ -2250,7 +2253,7 @@ Display system-wide information
|
||||
"SystemTime": "2015-03-10T11:11:23.730591467-07:00"
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2282,7 +2285,7 @@ Show the docker version information
|
||||
"Experimental": true
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2304,7 +2307,7 @@ Ping the docker server
|
||||
|
||||
OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **500** - server error
|
||||
@@ -2360,11 +2363,11 @@ Create a new image from a container's changes
|
||||
|
||||
{"Id": "596069db4bf5"}
|
||||
|
||||
Json Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **config** - the container's configuration
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **container** – source container
|
||||
- **repo** – repository
|
||||
@@ -2375,7 +2378,7 @@ Query Parameters:
|
||||
- **pause** – 1/True/true or 0/False/false, whether to pause the container before committing
|
||||
- **changes** – Dockerfile instructions to apply while committing
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **404** – no such container
|
||||
@@ -2563,8 +2566,7 @@ Docker networks report the following events:
|
||||
"timeNano": 1461943105338056026
|
||||
}
|
||||
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **since** – Timestamp used for polling
|
||||
- **until** – Timestamp used for polling
|
||||
@@ -2577,7 +2579,7 @@ Query Parameters:
|
||||
- `volume=<string>`; -- volume to filter
|
||||
- `network=<string>`; -- network to filter
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2607,12 +2609,12 @@ See the [image tarball format](#image-tarball-format) for more details.
|
||||
|
||||
Binary data stream
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
|
||||
### Get a tarball containing all images.
|
||||
### Get a tarball containing all images
|
||||
|
||||
`GET /images/get`
|
||||
|
||||
@@ -2636,7 +2638,7 @@ See the [image tarball format](#image-tarball-format) for more details.
|
||||
|
||||
Binary data stream
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2651,14 +2653,41 @@ See the [image tarball format](#image-tarball-format) for more details.
|
||||
**Example request**
|
||||
|
||||
POST /images/load
|
||||
Content-Type: application/x-tar
|
||||
|
||||
Tarball in body
|
||||
|
||||
**Example response**:
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
Transfer-Encoding: chunked
|
||||
|
||||
Status Codes:
|
||||
{"status":"Loading layer","progressDetail":{"current":32768,"total":1292800},"progress":"[= ] 32.77 kB/1.293 MB","id":"8ac8bfaff55a"}
|
||||
{"status":"Loading layer","progressDetail":{"current":65536,"total":1292800},"progress":"[== ] 65.54 kB/1.293 MB","id":"8ac8bfaff55a"}
|
||||
{"status":"Loading layer","progressDetail":{"current":98304,"total":1292800},"progress":"[=== ] 98.3 kB/1.293 MB","id":"8ac8bfaff55a"}
|
||||
{"status":"Loading layer","progressDetail":{"current":131072,"total":1292800},"progress":"[===== ] 131.1 kB/1.293 MB","id":"8ac8bfaff55a"}
|
||||
...
|
||||
{"stream":"Loaded image: busybox:latest\n"}
|
||||
|
||||
**Example response**:
|
||||
|
||||
If the "quiet" query parameter is set to `true` / `1` (`?quiet=1`), progress
|
||||
details are suppressed, and only a confirmation message is returned as plain text
|
||||
once the action completes.
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Length: 29
|
||||
Content-Type: text/plain; charset=utf-8
|
||||
|
||||
Loaded image: busybox:latest
|
||||
|
||||
**Query parameters**:
|
||||
|
||||
- **quiet** – Boolean value, suppress progress details during load. Defaults
|
||||
to `0` / `false` if omitted.
|
||||
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **500** – server error
|
||||
@@ -2716,7 +2745,7 @@ Sets up an exec instance in a running container `id`
|
||||
"Warnings":[]
|
||||
}
|
||||
|
||||
Json Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **AttachStdin** - Boolean value, attaches to `stdin` of the `exec` command.
|
||||
- **AttachStdout** - Boolean value, attaches to `stdout` of the `exec` command.
|
||||
@@ -2728,7 +2757,7 @@ Json Parameters:
|
||||
- **Cmd** - Command to run specified as a string or an array of strings.
|
||||
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **404** – no such container
|
||||
@@ -2760,12 +2789,12 @@ interactive session with the `exec` command.
|
||||
|
||||
{{ STREAM }}
|
||||
|
||||
Json Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **Detach** - Detach from the `exec` command.
|
||||
- **Tty** - Boolean value to allocate a pseudo-TTY.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such exec instance
|
||||
@@ -2791,12 +2820,12 @@ This API is valid only if `tty` was specified as part of creating and starting t
|
||||
HTTP/1.1 201 Created
|
||||
Content-Type: text/plain
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **h** – height of `tty` session
|
||||
- **w** – width
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** – no error
|
||||
- **404** – no such exec instance
|
||||
@@ -2838,7 +2867,7 @@ Return low-level information about the `exec` command `id`.
|
||||
"Running": false
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** – no error
|
||||
- **404** – no such exec instance
|
||||
@@ -2870,11 +2899,11 @@ Status Codes:
|
||||
"Warnings": []
|
||||
}
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **filters** - JSON encoded value of the filters (a `map[string][]string`) to process on the volumes list. There is one available filter: `dangling=true`
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **500** - server error
|
||||
@@ -2913,12 +2942,12 @@ Create a volume
|
||||
},
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** - no error
|
||||
- **500** - server error
|
||||
|
||||
JSON Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **Name** - The new volume's name. If not specified, Docker generates a name.
|
||||
- **Driver** - Name of the volume driver to use. Defaults to `local` for the name.
|
||||
@@ -2951,7 +2980,7 @@ Return low-level information on the volume `name`
|
||||
}
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **404** - no such volume
|
||||
@@ -2971,14 +3000,14 @@ Instruct the driver to remove the volume (`name`).
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Status Codes
|
||||
**Status codes**:
|
||||
|
||||
- **204** - no error
|
||||
- **404** - no such volume or volume driver
|
||||
- **409** - volume is in use and cannot be removed
|
||||
- **500** - server error
|
||||
|
||||
## 2.5 Networks
|
||||
## 3.5 Networks
|
||||
|
||||
### List networks
|
||||
|
||||
@@ -3058,14 +3087,14 @@ Content-Type: application/json
|
||||
]
|
||||
```
|
||||
|
||||
Query Parameters:
|
||||
**Query parameters**:
|
||||
|
||||
- **filters** - JSON encoded network list filter. The filter value is one of:
|
||||
- `name=<network-name>` Matches all or part of a network name.
|
||||
- `id=<network-id>` Matches all or part of a network id.
|
||||
- `name=<network-name>` Matches all or part of a network name.
|
||||
- `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks.
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **500** - server error
|
||||
@@ -3127,7 +3156,7 @@ Content-Type: application/json
|
||||
}
|
||||
```
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **404** - network not found
|
||||
@@ -3193,13 +3222,13 @@ Content-Type: application/json
|
||||
}
|
||||
```
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **201** - no error
|
||||
- **404** - plugin not found
|
||||
- **500** - server error
|
||||
|
||||
JSON Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **Name** - The new network's name. this is a mandatory field
|
||||
- **CheckDuplicate** - Requests daemon to check for networks with same name
|
||||
@@ -3237,13 +3266,13 @@ Content-Type: application/json
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **404** - network or container is not found
|
||||
- **500** - Internal Server Error
|
||||
|
||||
JSON Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **container** - container-id/name to be connected to the network
|
||||
|
||||
@@ -3269,13 +3298,13 @@ Content-Type: application/json
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
Status Codes:
|
||||
**Status codes**:
|
||||
|
||||
- **200** - no error
|
||||
- **404** - network or container not found
|
||||
- **500** - Internal Server Error
|
||||
|
||||
JSON Parameters:
|
||||
**JSON parameters**:
|
||||
|
||||
- **Container** - container-id/name to be disconnected from a network
|
||||
- **Force** - Force the container to disconnect from a network
|
||||
@@ -3294,7 +3323,7 @@ Instruct the driver to remove the network (`id`).
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
Status Codes
|
||||
**Status codes**:
|
||||
|
||||
- **204** - no error
|
||||
- **404** - no such network
|
||||
|
||||
@@ -336,15 +336,16 @@ Create a container
|
||||
"ShmSize": 67108864
|
||||
},
|
||||
"NetworkingConfig": {
|
||||
"EndpointsConfig": {
|
||||
"isolated_nw" : {
|
||||
"IPAMConfig": {
|
||||
"IPv4Address":"172.20.30.33",
|
||||
"IPv6Address":"2001:db8:abcd::3033",
|
||||
"LinkLocalIPs:["169.254.34.68", "fe80::3468"]
|
||||
},
|
||||
"Links":["container_1", "container_2"],
|
||||
"Aliases":["server_x", "server_y"]
|
||||
"EndpointsConfig": {
|
||||
"isolated_nw" : {
|
||||
"IPAMConfig": {
|
||||
"IPv4Address":"172.20.30.33",
|
||||
"IPv6Address":"2001:db8:abcd::3033",
|
||||
"LinkLocalIPs":["169.254.34.68", "fe80::3468"]
|
||||
},
|
||||
"Links":["container_1", "container_2"],
|
||||
"Aliases":["server_x", "server_y"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1276,6 +1277,7 @@ Attach to the container `id`
|
||||
- **200** – no error, no upgrade header found
|
||||
- **400** – bad parameter
|
||||
- **404** – no such container
|
||||
- **409** - container is paused
|
||||
- **500** – server error
|
||||
|
||||
**Stream details**:
|
||||
@@ -2664,12 +2666,39 @@ See the [image tarball format](#image-tarball-format) for more details.
|
||||
**Example request**
|
||||
|
||||
POST /images/load
|
||||
Content-Type: application/x-tar
|
||||
|
||||
Tarball in body
|
||||
|
||||
**Example response**:
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
Transfer-Encoding: chunked
|
||||
|
||||
{"status":"Loading layer","progressDetail":{"current":32768,"total":1292800},"progress":"[= ] 32.77 kB/1.293 MB","id":"8ac8bfaff55a"}
|
||||
{"status":"Loading layer","progressDetail":{"current":65536,"total":1292800},"progress":"[== ] 65.54 kB/1.293 MB","id":"8ac8bfaff55a"}
|
||||
{"status":"Loading layer","progressDetail":{"current":98304,"total":1292800},"progress":"[=== ] 98.3 kB/1.293 MB","id":"8ac8bfaff55a"}
|
||||
{"status":"Loading layer","progressDetail":{"current":131072,"total":1292800},"progress":"[===== ] 131.1 kB/1.293 MB","id":"8ac8bfaff55a"}
|
||||
...
|
||||
{"stream":"Loaded image: busybox:latest\n"}
|
||||
|
||||
**Example response**:
|
||||
|
||||
If the "quiet" query parameter is set to `true` / `1` (`?quiet=1`), progress
|
||||
details are suppressed, and only a confirmation message is returned as plain text
|
||||
once the action completes.
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Length: 29
|
||||
Content-Type: text/plain; charset=utf-8
|
||||
|
||||
Loaded image: busybox:latest
|
||||
|
||||
**Query parameters**:
|
||||
|
||||
- **quiet** – Boolean value, suppress progress details during load. Defaults
|
||||
to `0` / `false` if omitted.
|
||||
|
||||
**Status codes**:
|
||||
|
||||
@@ -3350,8 +3379,12 @@ List nodes
|
||||
"CreatedAt": "2016-06-07T20:31:11.853781916Z",
|
||||
"UpdatedAt": "2016-06-07T20:31:11.999868824Z",
|
||||
"Spec": {
|
||||
"Name": "my-node",
|
||||
"Role": "MANAGER",
|
||||
"Availability": "ACTIVE"
|
||||
"Labels": {
|
||||
"foo": "bar"
|
||||
}
|
||||
},
|
||||
"Description": {
|
||||
"Hostname": "bf3067039e47",
|
||||
@@ -3365,11 +3398,22 @@ List nodes
|
||||
},
|
||||
"Engine": {
|
||||
"EngineVersion": "1.12.0-dev",
|
||||
"Labels": {
|
||||
"foo": "bar",
|
||||
}
|
||||
"Plugins": [
|
||||
{
|
||||
"Type": "Volume",
|
||||
"Name": "local"
|
||||
},
|
||||
{
|
||||
"Type": "Network",
|
||||
"Name": "bridge"
|
||||
}
|
||||
{
|
||||
"Type": "Network",
|
||||
"Name": "null"
|
||||
}
|
||||
{
|
||||
"Type": "Network",
|
||||
"Name": "overlay"
|
||||
@@ -3378,63 +3422,12 @@ List nodes
|
||||
}
|
||||
},
|
||||
"Status": {
|
||||
"State": "READY"
|
||||
"State": "ready"
|
||||
},
|
||||
"Manager": {
|
||||
"Raft": {
|
||||
"RaftID": 10070664527094528000,
|
||||
"Addr": "172.17.0.2:4500",
|
||||
"Status": {
|
||||
"Leader": true,
|
||||
"Reachability": "REACHABLE"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Attachment": {
|
||||
"Network": {
|
||||
"ID": "4qvuz4ko70xaltuqbt8956gd1",
|
||||
"Version": {
|
||||
"Index": 6
|
||||
},
|
||||
"CreatedAt": "2016-06-07T20:31:11.912919752Z",
|
||||
"UpdatedAt": "2016-06-07T20:31:11.921784144Z",
|
||||
"Spec": {
|
||||
"Name": "ingress",
|
||||
"Labels": {
|
||||
"com.docker.swarm.internal": "true"
|
||||
},
|
||||
"DriverConfiguration": {},
|
||||
"IPAM": {
|
||||
"Driver": {},
|
||||
"Configs": [
|
||||
{
|
||||
"Family": "UNKNOWN",
|
||||
"Subnet": "10.255.0.0/16"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"DriverState": {
|
||||
"Name": "overlay",
|
||||
"Options": {
|
||||
"com.docker.network.driver.overlay.vxlanid_list": "256"
|
||||
}
|
||||
},
|
||||
"IPAM": {
|
||||
"Driver": {
|
||||
"Name": "default"
|
||||
},
|
||||
"Configs": [
|
||||
{
|
||||
"Family": "UNKNOWN",
|
||||
"Subnet": "10.255.0.0/16"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"Addresses": [
|
||||
"10.255.0.2/16"
|
||||
]
|
||||
"ManagerStatus": {
|
||||
"Leader": true,
|
||||
"Reachability": "reachable",
|
||||
"Addr": "172.17.0.2:2377""
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -3477,8 +3470,12 @@ Return low-level information on the node `id`
|
||||
"CreatedAt": "2016-06-07T20:31:11.853781916Z",
|
||||
"UpdatedAt": "2016-06-07T20:31:11.999868824Z",
|
||||
"Spec": {
|
||||
"Name": "my-node",
|
||||
"Role": "MANAGER",
|
||||
"Availability": "ACTIVE"
|
||||
"Labels": {
|
||||
"foo": "bar"
|
||||
}
|
||||
},
|
||||
"Description": {
|
||||
"Hostname": "bf3067039e47",
|
||||
@@ -3492,11 +3489,22 @@ Return low-level information on the node `id`
|
||||
},
|
||||
"Engine": {
|
||||
"EngineVersion": "1.12.0-dev",
|
||||
"Labels": {
|
||||
"foo": "bar",
|
||||
}
|
||||
"Plugins": [
|
||||
{
|
||||
"Type": "Volume",
|
||||
"Name": "local"
|
||||
},
|
||||
{
|
||||
"Type": "Network",
|
||||
"Name": "bridge"
|
||||
}
|
||||
{
|
||||
"Type": "Network",
|
||||
"Name": "null"
|
||||
}
|
||||
{
|
||||
"Type": "Network",
|
||||
"Name": "overlay"
|
||||
@@ -3505,63 +3513,12 @@ Return low-level information on the node `id`
|
||||
}
|
||||
},
|
||||
"Status": {
|
||||
"State": "READY"
|
||||
"State": "ready"
|
||||
},
|
||||
"Manager": {
|
||||
"Raft": {
|
||||
"RaftID": 10070664527094528000,
|
||||
"Addr": "172.17.0.2:4500",
|
||||
"Status": {
|
||||
"Leader": true,
|
||||
"Reachability": "REACHABLE"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Attachment": {
|
||||
"Network": {
|
||||
"ID": "4qvuz4ko70xaltuqbt8956gd1",
|
||||
"Version": {
|
||||
"Index": 6
|
||||
},
|
||||
"CreatedAt": "2016-06-07T20:31:11.912919752Z",
|
||||
"UpdatedAt": "2016-06-07T20:31:11.921784144Z",
|
||||
"Spec": {
|
||||
"Name": "ingress",
|
||||
"Labels": {
|
||||
"com.docker.swarm.internal": "true"
|
||||
},
|
||||
"DriverConfiguration": {},
|
||||
"IPAM": {
|
||||
"Driver": {},
|
||||
"Configs": [
|
||||
{
|
||||
"Family": "UNKNOWN",
|
||||
"Subnet": "10.255.0.0/16"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"DriverState": {
|
||||
"Name": "overlay",
|
||||
"Options": {
|
||||
"com.docker.network.driver.overlay.vxlanid_list": "256"
|
||||
}
|
||||
},
|
||||
"IPAM": {
|
||||
"Driver": {
|
||||
"Name": "default"
|
||||
},
|
||||
"Configs": [
|
||||
{
|
||||
"Family": "UNKNOWN",
|
||||
"Subnet": "10.255.0.0/16"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"Addresses": [
|
||||
"10.255.0.2/16"
|
||||
]
|
||||
"ManagerStatus": {
|
||||
"Leader": true,
|
||||
"Reachability": "reachable",
|
||||
"Addr": "172.17.0.2:2377""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3586,8 +3543,8 @@ Initialize a new Swarm
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"ListenAddr": "0.0.0.0:4500",
|
||||
"AdvertiseAddr": "192.168.1.1:4500",
|
||||
"ListenAddr": "0.0.0.0:2377",
|
||||
"AdvertiseAddr": "192.168.1.1:2377",
|
||||
"ForceNewCluster": false,
|
||||
"Spec": {
|
||||
"Orchestration": {},
|
||||
@@ -3658,9 +3615,9 @@ Join an existing new Swarm
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"ListenAddr": "0.0.0.0:4500",
|
||||
"AdvertiseAddr: "192.168.1.1:4500",
|
||||
"RemoteAddrs": ["node1:4500"],
|
||||
"ListenAddr": "0.0.0.0:2377",
|
||||
"AdvertiseAddr": "192.168.1.1:2377",
|
||||
"RemoteAddrs": ["node1:2377"],
|
||||
"JoinToken": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2"
|
||||
}
|
||||
|
||||
@@ -3980,6 +3937,7 @@ Create a service
|
||||
|
||||
- **201** – no error
|
||||
- **406** – server error or node is not part of a Swarm
|
||||
- **409** – name conflicts with an existing object
|
||||
|
||||
JSON Parameters:
|
||||
|
||||
@@ -4504,6 +4462,9 @@ List tasks
|
||||
- `id=<task id>`
|
||||
- `name=<task name>`
|
||||
- `service=<service name>`
|
||||
- `node=<node id>`
|
||||
- `label=key` or `label="key=value"`
|
||||
- `desired-state=(running | shutdown | accepted)`
|
||||
|
||||
**Status codes**:
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ bg8c07zzg87di2mufeq51a2qp redis.7 redis redis:3.0.6 Running 9 minutes Ru
|
||||
|
||||
#### desired-state
|
||||
|
||||
The `desired-state` filter can take the values `running` and `accepted`.
|
||||
The `desired-state` filter can take the values `running`, `shutdown`, and `accepted`.
|
||||
|
||||
|
||||
## Related information
|
||||
|
||||
@@ -95,7 +95,7 @@ Options:
|
||||
-P, --publish-all Publish all exposed ports to random ports
|
||||
--read-only Mount the container's root filesystem as read only
|
||||
--restart string Restart policy to apply when a container exits (default "no")
|
||||
Possible values are : no, on-failuer[:max-retry], always, unless-stopped
|
||||
Possible values are : no, on-failure[:max-retry], always, unless-stopped
|
||||
--rm Automatically remove the container when it exits
|
||||
--runtime string Runtime to use for this container
|
||||
--security-opt value Security Options (default [])
|
||||
|
||||
@@ -89,7 +89,7 @@ ID NAME SERVICE IMAGE DESIRED STATE LAST S
|
||||
|
||||
#### desired-state
|
||||
|
||||
The `desired-state` filter can take the values `running` and `accepted`.
|
||||
The `desired-state` filter can take the values `running`, `shutdown`, and `accepted`.
|
||||
|
||||
|
||||
## Related information
|
||||
|
||||
@@ -90,7 +90,6 @@ This flag is generally not necessary when joining an existing swarm.
|
||||
### `--manager`
|
||||
|
||||
Joins the node as a manager
|
||||
>>>>>>> 22565e1... Split advertised address from listen address
|
||||
|
||||
### `--token string`
|
||||
|
||||
|
||||
@@ -21,13 +21,17 @@ Options:
|
||||
--rotate Rotate join token
|
||||
```
|
||||
|
||||
Join tokens are secrets that determine whether or not a node will join the swarm as a manager node
|
||||
or a worker node. You pass the token using the `--token flag` when you run
|
||||
[swarm join](swarm_join.md). You can access the current tokens or rotate the tokens using
|
||||
`swarm join-token`.
|
||||
Join tokens are secrets that allow a node to join the swarm. There are two
|
||||
different join tokens available, one for the worker role and one for the manager
|
||||
role. You pass the token using the `--token` flag when you run
|
||||
[swarm join](swarm_join.md). Nodes use the join token only when they join the
|
||||
swarm.
|
||||
|
||||
Run with only a single `worker` or `manager` argument, it will print a command for joining a new
|
||||
node to the swarm, including the necessary token:
|
||||
You can view or rotate the join tokens using `swarm join-token`.
|
||||
|
||||
As a convenience, you can pass `worker` or `manager` as an argument to
|
||||
`join-token` to print the full `docker swarm join` command to join a new node to
|
||||
the swarm:
|
||||
|
||||
```bash
|
||||
$ docker swarm join-token worker
|
||||
@@ -64,7 +68,22 @@ SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-b30ljddcqhef9b9v4rs7
|
||||
|
||||
### `--rotate`
|
||||
|
||||
Update the join token for a specified role with a new token and print the token.
|
||||
Because tokens allow new nodes to join the swarm, you should keep them secret.
|
||||
Be particularly careful with manager tokens since they allow new manager nodes
|
||||
to join the swarm. A rogue manager has the potential to disrupt the operation of
|
||||
your swarm.
|
||||
|
||||
Rotate your swarm's join token if a token gets checked-in to version control,
|
||||
stolen, or a node is compromised. You may also want to periodically rotate the
|
||||
token to ensure any unknown token leaks do not allow a rogue node to join
|
||||
the swarm.
|
||||
|
||||
To rotate the join token and print the newly generated token, run
|
||||
`docker swarm join-token --rotate` and pass the role: `manager` or `worker`.
|
||||
|
||||
Rotating a join-token means that no new nodes will be able to join the swarm
|
||||
using the old token. Rotation does not affect existing nodes in the swarm
|
||||
because the join token is only used for authorizing new nodes joining the swarm.
|
||||
|
||||
### `--quiet`
|
||||
|
||||
|
||||
@@ -73,6 +73,14 @@ seccomp profile.
|
||||
A bug in eBPF -- the special in-kernel DSL used to express things like seccomp
|
||||
filters -- allowed arbitrary reads of kernel memory. The `bpf()` system call
|
||||
is blocked inside Docker containers using (ironically) seccomp.
|
||||
* [CVE-2016-3134](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-3134),
|
||||
[4997](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-4997),
|
||||
[4998](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-4998):
|
||||
A bug in setsockopt with `IPT_SO_SET_REPLACE`, `ARPT_SO_SET_REPLACE`, and
|
||||
`ARPT_SO_SET_REPLACE` causing memory corruption / local privilege escalation.
|
||||
These arguments are blocked by `CAP_NET_ADMIN`, which Docker does not allow by
|
||||
default.
|
||||
|
||||
|
||||
Bugs *not* mitigated:
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ CONFIG_SECCOMP=y
|
||||
|
||||
The default seccomp profile provides a sane default for running containers with
|
||||
seccomp and disables around 44 system calls out of 300+. It is moderately protective while providing wide application
|
||||
compatibility. The default Docker profile (found [here](https://github.com/docker/docker/blob/master/profiles/seccomp/default.json) has a JSON layout in the following form:
|
||||
compatibility. The default Docker profile (found [here](https://github.com/docker/docker/blob/master/profiles/seccomp/default.json)) has a JSON layout in the following form:
|
||||
|
||||
```json
|
||||
{
|
||||
|
||||
@@ -56,7 +56,7 @@ Here is an example of how to generate a 2048-bit RSA portion key (all RSA keys
|
||||
must be at least 2048 bits):
|
||||
|
||||
```
|
||||
$ opensl genrsa -out delegation.key 2048
|
||||
$ openssl genrsa -out delegation.key 2048
|
||||
Generating RSA private key, 2048 bit long modulus
|
||||
....................................................+++
|
||||
............+++
|
||||
|
||||
@@ -64,7 +64,7 @@ guaranteed if you encounter more than two network partitions.
|
||||
| 1 | 1 | 0 |
|
||||
| 2 | 2 | 0 |
|
||||
| **3** | 2 | **1** |
|
||||
| 4 | 3 | 2 |
|
||||
| 4 | 3 | 1 |
|
||||
| **5** | 3 | **2** |
|
||||
| 6 | 4 | 2 |
|
||||
| **7** | 4 | **3** |
|
||||
|
||||
@@ -11,7 +11,7 @@ weight="1"
|
||||
<![end-metadata]-->
|
||||
# Swarm mode overview
|
||||
|
||||
To use Docker Engine in swarm mode, install the Docker Engine `v1.12.0-rc1` or
|
||||
To use Docker Engine in swarm mode, install the Docker Engine `v1.12.0` or
|
||||
later from the [Docker releases GitHub
|
||||
repository](https://github.com/docker/docker/releases). Alternatively, install
|
||||
the latest Docker for Mac or Docker for Windows Beta.
|
||||
@@ -21,7 +21,7 @@ Docker Engines called a Swarm. Use the Docker CLI to create a swarm, deploy
|
||||
application services to a swarm, and manage swarm behavior.
|
||||
|
||||
|
||||
If you’re using a Docker version prior to `v1.12.0-rc1`, see [Docker
|
||||
If you’re using a Docker version prior to `v1.12.0`, see [Docker
|
||||
Swarm](https://docs.docker.com/swarm).
|
||||
|
||||
## Feature highlights
|
||||
|
||||
@@ -29,6 +29,11 @@ also run tasks.
|
||||
Before you add nodes to a swarm you must install Docker Engine 1.12 or later on
|
||||
the host machine.
|
||||
|
||||
The Docker Engine joins the swarm depending on the **join-token** you provide to
|
||||
the `docker swarm join` command. The node only uses the token at join time. If
|
||||
you subsequently rotate the token, it doesn't affect existing swarm nodes. Refer
|
||||
to [Run Docker Engine in swarm mode](swarm-mode.md#view-the-join-command-or-update-a-swarm-join-token).
|
||||
|
||||
## Join as a worker node
|
||||
|
||||
To retrieve the join command including the join token for worker nodes, run the
|
||||
@@ -100,30 +105,6 @@ $ docker swarm join \
|
||||
This node joined a swarm as a manager.
|
||||
```
|
||||
|
||||
<!--TODO WIP
|
||||
Manager nodes use the listen address for cluster management communications. The
|
||||
other nodes on the swarm must be able to access the manager node on the
|
||||
IP address and port you specify for the listen address.
|
||||
|
||||
Especially when there are multiple active network interfaces, you should
|
||||
you explicitly define the listen address when you add a manager node to the a
|
||||
swarm:
|
||||
|
||||
```bash
|
||||
docker swarm join \
|
||||
--token <MANAGER-TOKEN> \
|
||||
--listen-addr <NODE-IP>:<PORT> \
|
||||
<MANAGER-IP>:<PORT>
|
||||
```
|
||||
this will change for https://github.com/docker/docker/pull/24237 ->>
|
||||
Replace <NODE-IP> with the IP address of the node that is joining the swarm.
|
||||
Replace <MANAGER-IP> with the address of the swarm manager.
|
||||
|
||||
Only manager nodes use the listen address. If you specify `--listen-addr` for a
|
||||
worker node, the node only uses the listen address if it is promoted to a
|
||||
manager.
|
||||
-->
|
||||
|
||||
## Learn More
|
||||
|
||||
* `swarm join`[command line reference](../reference/commandline/swarm_join.md)
|
||||
|
||||
328
docs/swarm/services.md
Normal file
328
docs/swarm/services.md
Normal file
@@ -0,0 +1,328 @@
|
||||
<!--[metadata]>
|
||||
+++
|
||||
title = "Deploy services to a swarm"
|
||||
description = "Deploy services to a swarm"
|
||||
keywords = ["guide", "swarm mode", "swarm", "service"]
|
||||
[menu.main]
|
||||
identifier="services-guide"
|
||||
parent="engine_swarm"
|
||||
weight=15
|
||||
+++
|
||||
<![end-metadata]-->
|
||||
|
||||
# Deploy services to a swarm
|
||||
|
||||
When you are running Docker Engine in swarm mode, you run
|
||||
`docker service create` to deploy your application in the swarm. The swarm
|
||||
manager accepts the service description as the desired state for your
|
||||
application. The built-in swarm orchestrator and scheduler deploy your
|
||||
application to nodes in your swarm to achieve and maintain the desired state.
|
||||
|
||||
For an overview of how services work, refer to [How services work](how-swarm-mode-works/services.md).
|
||||
|
||||
This guide assumes you are working with the Docker Engine running in swarm
|
||||
mode. You must run all `docker service` commands from a manager node.
|
||||
|
||||
If you haven't already, read through [Swarm mode key concepts](key-concepts.md)
|
||||
and [How services work](how-swarm-mode-works/services.md).
|
||||
|
||||
## Create a service
|
||||
|
||||
To create the simplest type of service in a swarm, you only need to supply
|
||||
a container image:
|
||||
|
||||
```bash
|
||||
$ docker service create <IMAGE>
|
||||
```
|
||||
|
||||
The swarm orchestrator schedules one task on an available node. The task invokes
|
||||
a container based upon the image. For example, you could run the following
|
||||
command to create a service of one instance of an nginx web server:
|
||||
|
||||
```bash
|
||||
$ docker service create --name my_web nginx
|
||||
|
||||
anixjtol6wdfn6yylbkrbj2nx
|
||||
```
|
||||
|
||||
In this example the `--name` flag names the service `my_web`.
|
||||
|
||||
To list the service, run `docker service ls` from a manager node:
|
||||
|
||||
```bash
|
||||
$ docker service ls
|
||||
|
||||
ID NAME REPLICAS IMAGE COMMAND
|
||||
anixjtol6wdf my_web 1/1 nginx
|
||||
```
|
||||
|
||||
To make the web server accessible from outside the swarm, you need to
|
||||
[publish the port](#publish-ports-externally-to-the-swarm) where the swarm
|
||||
listens for web requests.
|
||||
|
||||
You can include a command to run inside containers after the image:
|
||||
|
||||
```bash
|
||||
$ docker service create <IMAGE> <COMMAND>
|
||||
```
|
||||
|
||||
For example to start an `alpine` image that runs `ping docker.com`:
|
||||
|
||||
```bash
|
||||
$ docker service create --name helloworld alpine ping docker.com
|
||||
|
||||
9uk4639qpg7npwf3fn2aasksr
|
||||
```
|
||||
|
||||
## Configure the runtime environment
|
||||
|
||||
You can configure the following options for the runtime environment in the
|
||||
container:
|
||||
|
||||
* environment variables using the `--env` flag
|
||||
* the working directory inside the container using the `--workdir` flag
|
||||
* the username or UID using the `--user` flag
|
||||
|
||||
For example:
|
||||
|
||||
```bash
|
||||
$ docker service create --name helloworld \
|
||||
--env MYVAR=myvalue \
|
||||
--workdir /tmp \
|
||||
--user my_user \
|
||||
alpine ping docker.com
|
||||
|
||||
9uk4639qpg7npwf3fn2aasksr
|
||||
```
|
||||
|
||||
## Control service scale and placement
|
||||
|
||||
Swarm mode has two types of services, replicated and global. For replicated
|
||||
services, you specify the number of replica tasks for the swarm manager to
|
||||
schedule onto available nodes. For global services, the scheduler places one
|
||||
task on each available node.
|
||||
|
||||
You control the type of service using the `--mode` flag. If you don't specify a
|
||||
mode, the service defaults to `replicated`. For replicated services, you specify
|
||||
the number of replica tasks you want to start using the `--replicas` flag. For
|
||||
example, to start a replicated nginx service with 3 replica tasks:
|
||||
|
||||
```bash
|
||||
$ docker service create --name my_web --replicas 3 nginx
|
||||
```
|
||||
|
||||
To start a global service on each available node, pass `--mode global` to
|
||||
`docker service create`. Every time a new node becomes available, the scheduler
|
||||
places a task for the global service on the new node. For example to start a
|
||||
service that runs alpine on every node in the swarm:
|
||||
|
||||
```bash
|
||||
$ docker service create --name myservice --mode global alpine top
|
||||
```
|
||||
|
||||
Service constraints let you set criteria for a node to meet before the scheduler
|
||||
deploys a service to the node. You can apply constraints to the
|
||||
service based upon node attributes and metadata or engine metadata. For more
|
||||
information on constraints, refer to the `docker service create` [CLI reference](../reference/commandline/service_create.md).
|
||||
|
||||
|
||||
## Configure service networking options
|
||||
|
||||
Swarm mode lets you network services in a couple of ways:
|
||||
|
||||
* publish ports externally to the swarm using ingress networking
|
||||
* connect services and tasks within the swarm using overlay networks
|
||||
|
||||
### Publish ports externally to the swarm
|
||||
|
||||
You publish service ports externally to the swarm using the `--publish
|
||||
<TARGET-PORT>:<SERVICE-PORT>` flag. When you publish a service port, the swarm
|
||||
makes the service accessible at the target port on every node regardless if
|
||||
there is a task for the service running on the node.
|
||||
|
||||
For example, imagine you want to deploy a 3-replica nginx service to a 10-node
|
||||
swarm as follows:
|
||||
|
||||
```bash
|
||||
docker service create --name my_web --replicas 3 --publish 8080:80 nginx
|
||||
```
|
||||
|
||||
The scheduler will deploy nginx tasks to a maximum of 3 nodes. However, the
|
||||
swarm makes nginx port 80 from the task container accessible at port 8080 on any
|
||||
node in the swarm. You can direct `curl` at port 8080 of any node in the swarm
|
||||
to access the web server:
|
||||
|
||||
```bash
|
||||
$ curl localhost:8080
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Welcome to nginx!</title>
|
||||
<style>
|
||||
body {
|
||||
width: 35em;
|
||||
margin: 0 auto;
|
||||
font-family: Tahoma, Verdana, Arial, sans-serif;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Welcome to nginx!</h1>
|
||||
<p>If you see this page, the nginx web server is successfully installed and
|
||||
working. Further configuration is required.</p>
|
||||
|
||||
<p>For online documentation and support please refer to
|
||||
<a href="http://nginx.org/">nginx.org</a>.<br/>
|
||||
Commercial support is available at
|
||||
<a href="http://nginx.com/">nginx.com</a>.</p>
|
||||
|
||||
<p><em>Thank you for using nginx.</em></p>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
### Add an overlay network
|
||||
|
||||
Use overlay networks to connect one or more services within the swarm.
|
||||
|
||||
First, create an overlay network on a manager node the `docker network create`
|
||||
command:
|
||||
|
||||
```bash
|
||||
$ docker network create --driver overlay my-network
|
||||
|
||||
etjpu59cykrptrgw0z0hk5snf
|
||||
```
|
||||
|
||||
After you create an overlay network in swarm mode, all manager nodes have access
|
||||
to the network.
|
||||
|
||||
When you create a service and pass the `--network` flag to attach the service to
|
||||
the overlay network:
|
||||
|
||||
```bash
|
||||
$ docker service create \
|
||||
--replicas 3 \
|
||||
--network my-network \
|
||||
--name my-web \
|
||||
nginx
|
||||
|
||||
716thylsndqma81j6kkkb5aus
|
||||
```
|
||||
|
||||
The swarm extends `my-network` to each node running the service.
|
||||
|
||||
<!-- TODO when overlay-security-model is published
|
||||
For more information, refer to [Note on Docker 1.12 Overlay Network Security Model](../userguide/networking/overlay-security-model.md).-->
|
||||
|
||||
## Configure update behavior
|
||||
|
||||
When you create a service, you can specify a rolling update behavior for how the
|
||||
swarm should apply changes to the service when you run `docker service update`.
|
||||
You can also specify these flags as part of the update, as arguments to
|
||||
`docker service update`.
|
||||
|
||||
The `--update-delay` flag configures the time delay between updates to a service
|
||||
task or sets of tasks. You can describe the time `T` as a combination of the
|
||||
number of seconds `Ts`, minutes `Tm`, or hours `Th`. So `10m30s` indicates a 10
|
||||
minute 30 second delay.
|
||||
|
||||
By default the scheduler updates 1 task at a time. You can pass the
|
||||
`--update-parallelism` flag to configure the maximum number of service tasks
|
||||
that the scheduler updates simultaneously.
|
||||
|
||||
When an update to an individual task returns a state of `RUNNING`, the scheduler
|
||||
continues the update by continuing to another task until all tasks are updated.
|
||||
If, at any time during an update a task returns `FAILED`, the scheduler pauses
|
||||
the update. You can control the behavior using the `--update-failure-action`
|
||||
flag for `docker service create` or `docker service update`.
|
||||
|
||||
In the example service below, the scheduler applies updates to a maximum of 2
|
||||
replicas at a time. When an updated task returns either `RUNNING` or `FAILED`,
|
||||
the scheduler waits 10 seconds before stopping the next task to update:
|
||||
|
||||
```bash
|
||||
$ docker service create \
|
||||
--replicas 10 \
|
||||
--name my_web \
|
||||
--update-delay 10s \
|
||||
--update-parallelism 2 \
|
||||
--update-failure-action continue \
|
||||
alpine
|
||||
|
||||
0u6a4s31ybk7yw2wyvtikmu50
|
||||
```
|
||||
|
||||
## Configure mounts
|
||||
|
||||
You can create two types of mounts for services in a swarm, `volume` mounts or
|
||||
`bind` mounts. You pass the `--mount` flag when you create a service. The
|
||||
default is a volume mount if you don't specify a type.
|
||||
|
||||
* Volumes are storage that remain alive after a container for a task has
|
||||
been removed. The preferred method to mount volumes is to leverage an existing
|
||||
volume:
|
||||
|
||||
```bash
|
||||
$ docker service create \
|
||||
--mount src=<VOLUME-NAME>,dst=<CONTAINER-PATH> \
|
||||
--name myservice \
|
||||
<IMAGE>
|
||||
```
|
||||
|
||||
For more information on how to create a volume, see the `volume create` [CLI reference](../reference/commandline/volume_create.md).
|
||||
|
||||
The following method creates the volume at deployment time when the scheduler
|
||||
dispatches a task, just before the starting the container:
|
||||
|
||||
```bash
|
||||
$ docker service create \
|
||||
--mount type=volume,src=<VOLUME-NAME>,dst=<CONTAINER-PATH>,volume-driver=<DRIVER>,volume-opt=<KEY0>=<VALUE0>,volume-opt=<KEY1>=<VALUE1>
|
||||
--name myservice \
|
||||
<IMAGE>
|
||||
```
|
||||
|
||||
* Bind mounts are file system paths from the host where the scheduler deploys
|
||||
the container for the task. Docker mounts the path into the container. The
|
||||
file system path must exist before the swarm initializes the container for the
|
||||
task.
|
||||
|
||||
The following examples show bind mount syntax:
|
||||
|
||||
```bash
|
||||
# Mount a read-write bind
|
||||
$ docker service create \
|
||||
--mount type=bind,src=<HOST-PATH>,dst=<CONTAINER-PATH> \
|
||||
--name myservice \
|
||||
<IMAGE>
|
||||
|
||||
# Mount a read-only bind
|
||||
$ docker service create \
|
||||
--mount type=bind,src=<HOST-PATH>,dst=<CONTAINER-PATH>,readonly \
|
||||
--name myservice \
|
||||
<IMAGE>
|
||||
```
|
||||
|
||||
>**Important note:** Bind mounts can be useful but they are also dangerous. In
|
||||
most cases, we recommend that you architect your application such that mounting
|
||||
paths from the host is unnecessary. The main risks include the following:<br />
|
||||
> <br />
|
||||
> If you bind mount a host path into your service’s containers, the path
|
||||
> must exist on every machine. The Docker swarm mode scheduler can schedule
|
||||
> containers on any machine that meets resource availability requirements
|
||||
> and satisfies all `--constraint`s you specify.<br />
|
||||
> <br />
|
||||
> The Docker swarm mode scheduler may reschedule your running service
|
||||
> containers at any time if they become unhealthy or unreachable.<br />
|
||||
> <br />
|
||||
> Host bind mounts are completely non-portable. When you use bind mounts,
|
||||
> there is no guarantee that your application will run the same way in
|
||||
> development as it does in production.
|
||||
|
||||
|
||||
## Learn More
|
||||
|
||||
* [Swarm administration guide](admin_guide.md)
|
||||
* [Docker Engine command line reference](../reference/commandline/index.md)
|
||||
* [Swarm mode tutorial](swarm-tutorial/index.md)
|
||||
@@ -27,7 +27,7 @@ your production environment, swarm mode provides a fault-tolerant platform with
|
||||
cluster management features to keep your services running and available.
|
||||
|
||||
These instructions assume you have installed the Docker Engine 1.12 or later on
|
||||
a machine to serve as a manager node in your swawrm.
|
||||
a machine to serve as a manager node in your swarm.
|
||||
|
||||
If you haven't already, read through the [swarm mode key concepts](key-concepts.md)
|
||||
and try the [swarm mode tutorial](swarm-tutorial/index.md).
|
||||
@@ -36,7 +36,7 @@ and try the [swarm mode tutorial](swarm-tutorial/index.md).
|
||||
|
||||
When you run the command to create a swarm, the Docker Engine starts running in swarm mode.
|
||||
|
||||
Run [`docker swarm init`](/engine/reference/commandline/swarm_init.md)]
|
||||
Run [`docker swarm init`](../reference/commandline/swarm_init.md)
|
||||
to create a single-node swarm on the current node. The Engine sets up the swarm
|
||||
as follows:
|
||||
|
||||
@@ -73,10 +73,41 @@ To add a manager to this swarm, run the following command:
|
||||
192.168.99.100:2377
|
||||
```
|
||||
|
||||
### Configure the advertise address
|
||||
|
||||
Manager nodes use an advertise address to allow other nodes in the swarm access
|
||||
to the Swarmkit API and overlay networking. The other nodes on the swarm must be
|
||||
able to access the manager node on its advertise address IP address.
|
||||
|
||||
If you don't specify an advertise address, Docker checks if the system has a
|
||||
single IP address. If so, Docker uses the IP address with with the listening
|
||||
port `2377` by default. If the system has multiple IP addresses, you must
|
||||
specify the correct `--advertise-addr` to enable inter-manager communication
|
||||
and overlay networking:
|
||||
|
||||
```bash
|
||||
$ docker swarm init --advertise-addr <MANAGER-IP>
|
||||
```
|
||||
|
||||
You must also specify the `--advertise-addr` if the address where other nodes
|
||||
reach the first manager node is not the same address the manager sees as its
|
||||
own. For instance, in a cloud setup that spans different regions, hosts have
|
||||
both internal addresses for access within the region and external addresses that
|
||||
you use for access from outside that region. In this case, specify the external
|
||||
address with `--advertise-addr` so that the node can propogate that information
|
||||
to other nodes that subsequently connect to it.
|
||||
|
||||
Refer to the `docker swarm init` [CLI reference](../reference/commandline/swarm_init.md)
|
||||
for more detail on the advertise address.
|
||||
|
||||
### View the join command or update a swarm join token
|
||||
|
||||
The manager node requires a secret token for a new node to join the swarm. The
|
||||
token for worker nodes is different from the token for manager nodes.
|
||||
Nodes require a secret token to join the swarm. The token for worker nodes is
|
||||
different from the token for manager nodes. Nodes only use the join-token at the
|
||||
moment they join the swarm. Rotating the join token after a node has already
|
||||
joined a swarm does not affect the node's swarm membership. Token rotation
|
||||
ensures an old token cannot be used by any new nodes attempting to join the
|
||||
swarm.
|
||||
|
||||
To retrieve the join command including the join token for worker nodes, run:
|
||||
|
||||
@@ -110,10 +141,29 @@ $ docker swarm join-token --quiet worker
|
||||
SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c
|
||||
```
|
||||
|
||||
Pass the `--rotate` for `swarm join-token` to the token for a worker or manager
|
||||
Be careful with the join tokens because they are the secrets necessary to join
|
||||
the swarm. In particular, checking a secret into version control is a bad
|
||||
practice because it would allow anyone with access to the the application source
|
||||
code to add new nodes to the swarm. Manager tokens are especially sensitive
|
||||
because they allow a new manager node to join and gain control over the whole
|
||||
swarm.
|
||||
|
||||
We recommend that you rotate the join tokens in the following circumstances:
|
||||
|
||||
* If a token was checked-in by accident into a version control system, group
|
||||
chat or accidentally printed to your logs.
|
||||
* If you suspect a node has been compromised.
|
||||
* If you wish to guarantee that no new nodes can join the swarm.
|
||||
|
||||
Additionally, it is a best practice to implement a regular rotation schedule for
|
||||
any secret including swarm join tokens. We recommend that you rotate your tokens
|
||||
at least every 6 months.
|
||||
|
||||
Run `swarm join-token --rotate` to invalidate the old token and generate a new
|
||||
token. Specify whether you want to rotate the token for `worker` or `manager`
|
||||
nodes:
|
||||
|
||||
```
|
||||
```bash
|
||||
$docker swarm join-token --rotate worker
|
||||
|
||||
To add a worker to this swarm, run the following command:
|
||||
|
||||
@@ -90,10 +90,11 @@ task assignments for the `redis` service:
|
||||
```bash
|
||||
$ docker service ps redis
|
||||
|
||||
ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
|
||||
7q92v0nr1hcgts2amcjyqg3pq redis.1 redis redis:3.0.6 Running 4 minutes Running manager1
|
||||
b4hovzed7id8irg1to42egue8 redis.2 redis redis:3.0.6 Running About a minute Running worker2
|
||||
9bg7cezvedmkgg6c8yzvbhwsd redis.3 redis redis:3.0.6 Running 4 minutes Running worker2
|
||||
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR
|
||||
7q92v0nr1hcgts2amcjyqg3pq redis.1 redis:3.0.6 manager1 Running Running 4 minutes
|
||||
b4hovzed7id8irg1to42egue8 redis.2 redis:3.0.6 worker2 Running Running About a minute
|
||||
7h2l8h3q3wqy5f66hlv9ddmi6 \_ redis.2 redis:3.0.6 worker1 Shutdown Shutdown 2 minutes ago
|
||||
9bg7cezvedmkgg6c8yzvbhwsd redis.3 redis:3.0.6 worker2 Running Running 4 minutes
|
||||
```
|
||||
|
||||
The Swarm manager maintains the desired state by ending the task on a node
|
||||
|
||||
@@ -50,23 +50,16 @@ provider. This tutorial uses the following machine names:
|
||||
|
||||
### Docker Engine 1.12 or later
|
||||
|
||||
You must install Docker Engine on each one of the host machines. To use swarm
|
||||
mode, install the Docker Engine `v1.12.0-rc1` or later from the [Docker releases
|
||||
GitHub repository](https://github.com/docker/docker/releases). Alternatively,
|
||||
install the latest Docker for Mac or Docker for Windows Beta.
|
||||
To use swarm mode, you must [install Docker Engine](../../installation/index.md)
|
||||
on each one of the host machines. Alternatively, install the latest Docker for
|
||||
Mac or Docker for Windows.
|
||||
|
||||
>**Advisory**: Some multi-node features may not work for Docker for Mac Beta and
|
||||
Docker for Windows Beta. We're working on the multi-node features for GA.
|
||||
>**Note**: Docker for Mac and Docker for Windows let you use single-node
|
||||
features of swarm mode, like creating a swarm and creating a service. Multi-node
|
||||
features like joining additional nodes and scaling a service are not available.
|
||||
|
||||
Verify that the Docker Engine daemon is running on each of the machines.
|
||||
|
||||
<!-- See the following options to install:
|
||||
|
||||
* [Install Docker Engine](../../installation/index.md).
|
||||
|
||||
* [Example: Manual install on cloud provider](../../installation/cloud/cloud-ex-aws.md).
|
||||
-->
|
||||
|
||||
### The IP address of the manager machine
|
||||
|
||||
The IP address must be assigned to an a network interface available to the host
|
||||
|
||||
@@ -138,10 +138,13 @@ desired state:
|
||||
```bash
|
||||
$ docker service ps redis
|
||||
|
||||
ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
|
||||
dos1zffgeofhagnve8w864fco redis.1 redis redis:3.0.7 Running 37 seconds Running worker1
|
||||
9l3i4j85517skba5o7tn5m8g0 redis.2 redis redis:3.0.7 Running About a minute Running worker2
|
||||
egiuiqpzrdbxks3wxgn8qib1g redis.3 redis redis:3.0.7 Running 48 seconds Running worker1
|
||||
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR
|
||||
dos1zffgeofhagnve8w864fco redis.1 redis:3.0.7 worker1 Running Running 37 seconds
|
||||
88rdo6pa52ki8oqx6dogf04fh \_ redis.1 redis:3.0.6 worker2 Shutdown Shutdown 56 seconds ago
|
||||
9l3i4j85517skba5o7tn5m8g0 redis.2 redis:3.0.7 worker2 Running Running About a minute
|
||||
66k185wilg8ele7ntu8f6nj6i \_ redis.2 redis:3.0.6 worker1 Shutdown Shutdown 2 minutes ago
|
||||
egiuiqpzrdbxks3wxgn8qib1g redis.3 redis:3.0.7 worker1 Running Running 48 seconds
|
||||
ctzktfddb2tepkr45qcmqln04 \_ redis.3 redis:3.0.6 mmanager1 Shutdown Shutdown 2 minutes ago
|
||||
```
|
||||
|
||||
Before Swarm updates all of the tasks, you can see that some are running
|
||||
|
||||
@@ -187,9 +187,13 @@ you'd like to update.
|
||||
> Take note of the container ID that has been created, `0b2616b0e5a8`, as you'll
|
||||
> need it in a moment.
|
||||
|
||||
Inside our running container let's add the `json` gem.
|
||||
Inside our running container first let's update Ruby:
|
||||
|
||||
root@0b2616b0e5a8:/# gem install json
|
||||
root@0b2616b0e5a8:/# apt-get install -y ruby2.0-dev
|
||||
|
||||
Now let's add the `json` gem.
|
||||
|
||||
root@0b2616b0e5a8:/# gem2.0 install json
|
||||
|
||||
Once this has completed let's exit our container using the `exit`
|
||||
command.
|
||||
|
||||
@@ -147,12 +147,12 @@ To create an overlay network
|
||||
└ Containers: 2
|
||||
└ Reserved CPUs: 0 / 1
|
||||
└ Reserved Memory: 0 B / 1.021 GiB
|
||||
└ Labels: executiondriver=native-0.2, kernelversion=4.1.10-boot2docker, operatingsystem=Boot2Docker 1.9.0-rc1 (TCL 6.4); master : 4187d2c - Wed Oct 14 14:00:28 UTC 2015, provider=virtualbox, storagedriver=aufs
|
||||
└ Labels: executiondriver=native-0.2, kernelversion=4.1.10-boot2docker, operatingsystem=Boot2Docker 1.9.0 (TCL 6.4); master : 4187d2c - Wed Oct 14 14:00:28 UTC 2015, provider=virtualbox, storagedriver=aufs
|
||||
mhs-demo1: 192.168.99.105:2376
|
||||
└ Containers: 1
|
||||
└ Reserved CPUs: 0 / 1
|
||||
└ Reserved Memory: 0 B / 1.021 GiB
|
||||
└ Labels: executiondriver=native-0.2, kernelversion=4.1.10-boot2docker, operatingsystem=Boot2Docker 1.9.0-rc1 (TCL 6.4); master : 4187d2c - Wed Oct 14 14:00:28 UTC 2015, provider=virtualbox, storagedriver=aufs
|
||||
└ Labels: executiondriver=native-0.2, kernelversion=4.1.10-boot2docker, operatingsystem=Boot2Docker 1.9.0 (TCL 6.4); master : 4187d2c - Wed Oct 14 14:00:28 UTC 2015, provider=virtualbox, storagedriver=aufs
|
||||
CPUs: 2
|
||||
Total Memory: 2.043 GiB
|
||||
Name: 30438ece0915
|
||||
|
||||
@@ -216,7 +216,7 @@ a `direct-lvm` configuration.
|
||||
The procedure below will create a logical volume configured as a thin pool to
|
||||
use as backing for the storage pool. It assumes that you have a spare block
|
||||
device at `/dev/xvdf` with enough free space to complete the task. The device
|
||||
identifier and volume sizes may be be different in your environment and you
|
||||
identifier and volume sizes may be different in your environment and you
|
||||
should substitute your own values throughout the procedure. The procedure also
|
||||
assumes that the Docker daemon is in the `stopped` state.
|
||||
|
||||
@@ -423,7 +423,7 @@ Containers: 0
|
||||
Paused: 0
|
||||
Stopped: 0
|
||||
Images: 2
|
||||
Server Version: 1.11.0-rc2
|
||||
Server Version: 1.11.0
|
||||
Storage Driver: devicemapper
|
||||
Pool Name: docker-8:1-123141-pool
|
||||
Pool Blocksize: 65.54 kB
|
||||
|
||||
Reference in New Issue
Block a user