summaryrefslogtreecommitdiff
path: root/docs/sources/reference
diff options
context:
space:
mode:
authorPaul Sherwood <paul.sherwood@codethink.co.uk>2014-08-07 22:01:07 +0000
committerPaul Sherwood <paul.sherwood@codethink.co.uk>2014-08-07 22:01:07 +0000
commit622225b48e72a2d43eeb63d5301ce3aa1fd7edb2 (patch)
tree7fefd8da54773f4365fe32c119be24c58906c015 /docs/sources/reference
parentb3552c73bbc69ff3e8878e4b6ef3349c8cabc434 (diff)
parentd84a070e476ce923dd03e28232564a87704613ab (diff)
downloaddocker-baserock/v1.1.2.tar.gz
Merge tag 'v1.1.2' into foobaserock/v1.1.2
v1.1.2
Diffstat (limited to 'docs/sources/reference')
-rw-r--r--docs/sources/reference/api/docker_remote_api.md34
-rw-r--r--docs/sources/reference/api/docker_remote_api_v1.0.md6
-rw-r--r--docs/sources/reference/api/docker_remote_api_v1.1.md6
-rw-r--r--docs/sources/reference/api/docker_remote_api_v1.10.md6
-rw-r--r--docs/sources/reference/api/docker_remote_api_v1.11.md16
-rw-r--r--docs/sources/reference/api/docker_remote_api_v1.12.md58
-rw-r--r--docs/sources/reference/api/docker_remote_api_v1.13.md1422
-rw-r--r--docs/sources/reference/api/docker_remote_api_v1.2.md6
-rw-r--r--docs/sources/reference/api/docker_remote_api_v1.3.md6
-rw-r--r--docs/sources/reference/api/docker_remote_api_v1.4.md8
-rw-r--r--docs/sources/reference/api/docker_remote_api_v1.5.md8
-rw-r--r--docs/sources/reference/api/docker_remote_api_v1.6.md10
-rw-r--r--docs/sources/reference/api/docker_remote_api_v1.7.md10
-rw-r--r--docs/sources/reference/api/docker_remote_api_v1.8.md10
-rw-r--r--docs/sources/reference/api/docker_remote_api_v1.9.md10
-rw-r--r--docs/sources/reference/api/hub_registry_spec.md4
-rw-r--r--docs/sources/reference/api/registry_api.md4
-rw-r--r--docs/sources/reference/api/remote_api_client_libraries.md8
-rw-r--r--docs/sources/reference/builder.md53
-rw-r--r--docs/sources/reference/commandline/cli.md224
-rw-r--r--docs/sources/reference/run.md229
21 files changed, 1868 insertions, 270 deletions
diff --git a/docs/sources/reference/api/docker_remote_api.md b/docs/sources/reference/api/docker_remote_api.md
index 38cfc244e1..36f35383e1 100644
--- a/docs/sources/reference/api/docker_remote_api.md
+++ b/docs/sources/reference/api/docker_remote_api.md
@@ -18,14 +18,42 @@ page_keywords: API, Docker, rcli, REST, documentation
encoded (JSON) string with credentials:
`{'username': string, 'password': string, 'email': string, 'serveraddress' : string}`
-The current version of the API is v1.12
+The current version of the API is v1.13
Calling `/images/<name>/insert` is the same as calling
-`/v1.12/images/<name>/insert`.
+`/v1.13/images/<name>/insert`.
You can still call an old version of the API using
`/v1.12/images/<name>/insert`.
+## v1.13
+
+### Full Documentation
+
+[*Docker Remote API v1.13*](/reference/api/docker_remote_api_v1.13/)
+
+### What's new
+
+`GET /containers/(name)/json`
+
+**New!**
+The `HostConfig.Links` field is now filled correctly
+
+**New!**
+`Sockets` parameter added to the `/info` endpoint listing all the sockets the
+daemon is configured to listen on.
+
+`POST /containers/(name)/start`
+`POST /containers/(name)/stop`
+
+**New!**
+`start` and `stop` will now return 304 if the container's status is not modified
+
+`POST /commit`
+
+**New!**
+Added a `pause` parameter (default `true`) to pause the container during commit
+
## v1.12
### Full Documentation
@@ -350,7 +378,7 @@ List containers (/containers/json):
Start containers (/containers/<id>/start):
- - You can now pass host-specific configuration (e.g. bind mounts) in
+ - You can now pass host-specific configuration (e.g., bind mounts) in
the POST body for start calls
## v1.2
diff --git a/docs/sources/reference/api/docker_remote_api_v1.0.md b/docs/sources/reference/api/docker_remote_api_v1.0.md
index 2f17b2a74d..b906298b85 100644
--- a/docs/sources/reference/api/docker_remote_api_v1.0.md
+++ b/docs/sources/reference/api/docker_remote_api_v1.0.md
@@ -605,8 +605,8 @@ Return low-level information on the image `name`
"OpenStdin":true,
"StdinOnce":false,
"Env":null,
- "Cmd": ["/bin/bash"]
- ,"Dns":null,
+ "Cmd": ["/bin/bash"],
+ "Dns":null,
"Image":"centos",
"Volumes":null,
"VolumesFrom":""
@@ -935,7 +935,7 @@ Create a new image from a container's changes
- **repo** – repository
- **tag** – tag
- **m** – commit message
- - **author** – author (eg. "John Hannibal Smith
+ - **author** – author (e.g., "John Hannibal Smith
<[hannibal@a-team.com](mailto:hannibal%40a-team.com)>")
Status Codes:
diff --git a/docs/sources/reference/api/docker_remote_api_v1.1.md b/docs/sources/reference/api/docker_remote_api_v1.1.md
index e777901c6c..4e449bccec 100644
--- a/docs/sources/reference/api/docker_remote_api_v1.1.md
+++ b/docs/sources/reference/api/docker_remote_api_v1.1.md
@@ -612,8 +612,8 @@ Return low-level information on the image `name`
"OpenStdin":true,
"StdinOnce":false,
"Env":null,
- "Cmd": ["/bin/bash"]
- ,"Dns":null,
+ "Cmd": ["/bin/bash"],
+ "Dns":null,
"Image":"centos",
"Volumes":null,
"VolumesFrom":""
@@ -946,7 +946,7 @@ Create a new image from a container's changes
- **repo** – repository
- **tag** – tag
- **m** – commit message
- - **author** – author (eg. "John Hannibal Smith
+ - **author** – author (e.g., "John Hannibal Smith
<[hannibal@a-team.com](mailto:hannibal%40a-team.com)>")
Status Codes:
diff --git a/docs/sources/reference/api/docker_remote_api_v1.10.md b/docs/sources/reference/api/docker_remote_api_v1.10.md
index 0292c1ab2f..264cdefc20 100644
--- a/docs/sources/reference/api/docker_remote_api_v1.10.md
+++ b/docs/sources/reference/api/docker_remote_api_v1.10.md
@@ -286,7 +286,7 @@ List processes running inside the container `id`
 
- - **ps\_args** – ps arguments to use (eg. aux)
+ - **ps\_args** – ps arguments to use (e.g., aux)
Status Codes:
@@ -530,7 +530,7 @@ Attach to the container `id`
`STREAM_TYPE` can be:
- - 0: stdin (will be writen on stdout)
+ - 0: stdin (will be written on stdout)
- 1: stdout
- 2: stderr
@@ -1181,7 +1181,7 @@ Create a new image from a container's changes
- **repo** – repository
- **tag** – tag
- **m** – commit message
- - **author** – author (eg. "John Hannibal Smith
+ - **author** – author (e.g., "John Hannibal Smith
<[hannibal@a-team.com](mailto:hannibal%40a-team.com)>")
Status Codes:
diff --git a/docs/sources/reference/api/docker_remote_api_v1.11.md b/docs/sources/reference/api/docker_remote_api_v1.11.md
index 90a5e7f362..ae2daae407 100644
--- a/docs/sources/reference/api/docker_remote_api_v1.11.md
+++ b/docs/sources/reference/api/docker_remote_api_v1.11.md
@@ -290,7 +290,7 @@ List processes running inside the container `id`
 
- - **ps_args** – ps arguments to use (eg. aux)
+ - **ps_args** – ps arguments to use (e.g., aux)
Status Codes:
@@ -570,7 +570,7 @@ Attach to the container `id`
`STREAM_TYPE` can be:
- - 0: stdin (will be writen on stdout)
+ - 0: stdin (will be written on stdout)
- 1: stdout
- 2: stderr
@@ -791,8 +791,8 @@ Return low-level information on the image `name`
"OpenStdin":true,
"StdinOnce":false,
"Env":null,
- "Cmd": ["/bin/bash"]
- ,"Dns":null,
+ "Cmd": ["/bin/bash"],
+ "Dns":null,
"Image":"base",
"Volumes":null,
"VolumesFrom":"",
@@ -1099,9 +1099,15 @@ Display system-wide information
{
"Containers":11,
"Images":16,
+ "Driver":"btrfs",
+ "ExecutionDriver":"native-0.1",
+ "KernelVersion":"3.12.0-1-amd64"
"Debug":false,
"NFd": 11,
"NGoroutines":21,
+ "NEventsListener":0,
+ "InitPath":"/usr/bin/docker",
+ "IndexServerAddress":["https://index.docker.io/v1/"],
"MemoryLimit":true,
"SwapLimit":false,
"IPv4Forwarding":true
@@ -1217,7 +1223,7 @@ Create a new image from a container's changes
- **repo** – repository
- **tag** – tag
- **m** – commit message
- - **author** – author (eg. "John Hannibal Smith
+ - **author** – author (e.g., "John Hannibal Smith
<[hannibal@a-team.com](mailto:hannibal%40a-team.com)>")
Status Codes:
diff --git a/docs/sources/reference/api/docker_remote_api_v1.12.md b/docs/sources/reference/api/docker_remote_api_v1.12.md
index 5b6d79d2fb..19fb24fe48 100644
--- a/docs/sources/reference/api/docker_remote_api_v1.12.md
+++ b/docs/sources/reference/api/docker_remote_api_v1.12.md
@@ -290,7 +290,7 @@ List processes running inside the container `id`
 
- - **ps_args** – ps arguments to use (eg. aux)
+ - **ps_args** – ps arguments to use (e.g., aux)
Status Codes:
@@ -509,6 +509,46 @@ Kill the container `id`
- **404** – no such container
- **500** – server error
+### Pause a container
+
+`POST /containers/(id)/pause`
+
+Pause the container `id`
+
+ **Example request**:
+
+ POST /containers/e90e34656806/pause HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 204 OK
+
+ Status Codes:
+
+ - **204** – no error
+ - **404** – no such container
+ - **500** – server error
+
+### Unpause a container
+
+`POST /containers/(id)/unpause`
+
+Unpause the container `id`
+
+ **Example request**:
+
+ POST /containers/e90e34656806/unpause HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 204 OK
+
+ Status Codes:
+
+ - **204** – no error
+ - **404** – no such container
+ - **500** – server error
+
### Attach to a container
`POST /containers/(id)/attach`
@@ -571,7 +611,7 @@ Attach to the container `id`
`STREAM_TYPE` can be:
- - 0: stdin (will be writen on stdout)
+ - 0: stdin (will be written on stdout)
- 1: stdout
- 2: stderr
@@ -720,7 +760,7 @@ Copy files or folders of container `id`
- **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.
-
+
### Create an image
@@ -825,8 +865,8 @@ Return low-level information on the image `name`
"OpenStdin":true,
"StdinOnce":false,
"Env":null,
- "Cmd": ["/bin/bash"]
- ,"Dns":null,
+ "Cmd": ["/bin/bash"],
+ "Dns":null,
"Image":"base",
"Volumes":null,
"VolumesFrom":"",
@@ -1136,9 +1176,15 @@ Display system-wide information
{
"Containers":11,
"Images":16,
+ "Driver":"btrfs",
+ "ExecutionDriver":"native-0.1",
+ "KernelVersion":"3.12.0-1-amd64"
"Debug":false,
"NFd": 11,
"NGoroutines":21,
+ "NEventsListener":0,
+ "InitPath":"/usr/bin/docker",
+ "IndexServerAddress":["https://index.docker.io/v1/"],
"MemoryLimit":true,
"SwapLimit":false,
"IPv4Forwarding":true
@@ -1255,7 +1301,7 @@ Create a new image from a container's changes
- **repo** – repository
- **tag** – tag
- **m** – commit message
- - **author** – author (eg. "John Hannibal Smith
+ - **author** – author (e.g., "John Hannibal Smith
<[hannibal@a-team.com](mailto:hannibal%40a-team.com)>")
Status Codes:
diff --git a/docs/sources/reference/api/docker_remote_api_v1.13.md b/docs/sources/reference/api/docker_remote_api_v1.13.md
new file mode 100644
index 0000000000..e0ad957941
--- /dev/null
+++ b/docs/sources/reference/api/docker_remote_api_v1.13.md
@@ -0,0 +1,1422 @@
+page_title: Remote API v1.12
+page_description: API Documentation for Docker
+page_keywords: API, Docker, rcli, REST, documentation
+
+# Docker Remote API v1.13
+
+## 1. Brief introduction
+
+ - The Remote API has replaced `rcli`.
+ - The daemon listens on `unix:///var/run/docker.sock` but you can
+ [*Bind Docker to another host/port or a Unix socket*](
+ /use/basics/#bind-docker).
+ - The API tends to be REST, but for some complex commands, like `attach`
+ or `pull`, the HTTP connection is hijacked to transport `STDOUT`,
+ `STDIN` and `STDERR`.
+
+# 2. Endpoints
+
+## 2.1 Containers
+
+### List containers
+
+`GET /containers/json`
+
+List containers
+
+ **Example request**:
+
+ GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-Type: application/json
+
+ [
+ {
+ "Id": "8dfafdbc3a40",
+ "Image": "base:latest",
+ "Command": "echo 1",
+ "Created": 1367854155,
+ "Status": "Exit 0",
+ "Ports":[{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}],
+ "SizeRw":12288,
+ "SizeRootFs":0
+ },
+ {
+ "Id": "9cd87474be90",
+ "Image": "base:latest",
+ "Command": "echo 222222",
+ "Created": 1367854155,
+ "Status": "Exit 0",
+ "Ports":[],
+ "SizeRw":12288,
+ "SizeRootFs":0
+ },
+ {
+ "Id": "3176a2479c92",
+ "Image": "base:latest",
+ "Command": "echo 3333333333333333",
+ "Created": 1367854154,
+ "Status": "Exit 0",
+ "Ports":[],
+ "SizeRw":12288,
+ "SizeRootFs":0
+ },
+ {
+ "Id": "4cb07b47f9fb",
+ "Image": "base:latest",
+ "Command": "echo 444444444444444444444444444444444",
+ "Created": 1367854152,
+ "Status": "Exit 0",
+ "Ports":[],
+ "SizeRw":12288,
+ "SizeRootFs":0
+ }
+ ]
+
+ Query Parameters:
+
+  
+
+ - **all** – 1/True/true or 0/False/false, Show all containers.
+ Only running containers are shown by default
+ - **limit** – Show `limit` last created
+ containers, include non-running ones.
+ - **since** – Show only containers created since Id, include
+ non-running ones.
+ - **before** – Show only containers created before Id, include
+ non-running ones.
+ - **size** – 1/True/true or 0/False/false, Show the containers
+ sizes
+
+ Status Codes:
+
+ - **200** – no error
+ - **400** – bad parameter
+ - **500** – server error
+
+### Create a container
+
+`POST /containers/create`
+
+Create a container
+
+ **Example request**:
+
+ POST /containers/create HTTP/1.1
+ Content-Type: application/json
+
+ {
+ "Hostname":"",
+ "User":"",
+ "Memory":0,
+ "MemorySwap":0,
+ "AttachStdin":false,
+ "AttachStdout":true,
+ "AttachStderr":true,
+ "PortSpecs":null,
+ "Tty":false,
+ "OpenStdin":false,
+ "StdinOnce":false,
+ "Env":null,
+ "Cmd":[
+ "date"
+ ],
+ "Image":"base",
+ "Volumes":{
+ "/tmp": {}
+ },
+ "WorkingDir":"",
+ "DisableNetwork": false,
+ "ExposedPorts":{
+ "22/tcp": {}
+ }
+ }
+
+ **Example response**:
+
+ HTTP/1.1 201 OK
+ Content-Type: application/json
+
+ {
+ "Id":"e90e34656806"
+ "Warnings":[]
+ }
+
+ Json Parameters:
+
+  
+
+ - **config** – the container's configuration
+
+ Query Parameters:
+
+  
+
+ - **name** – Assign the specified name to the container. Must
+ match `/?[a-zA-Z0-9_-]+`.
+
+ Status Codes:
+
+ - **201** – no error
+ - **404** – no such container
+ - **406** – impossible to attach (container not running)
+ - **500** – server error
+
+### Inspect a container
+
+`GET /containers/(id)/json`
+
+Return low-level information on the container `id`
+
+
+ **Example request**:
+
+ GET /containers/4fa6e0f0c678/json HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-Type: application/json
+
+ {
+ "Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2",
+ "Created": "2013-05-07T14:51:42.041847+02:00",
+ "Path": "date",
+ "Args": [],
+ "Config": {
+ "Hostname": "4fa6e0f0c678",
+ "User": "",
+ "Memory": 0,
+ "MemorySwap": 0,
+ "AttachStdin": false,
+ "AttachStdout": true,
+ "AttachStderr": true,
+ "PortSpecs": null,
+ "Tty": false,
+ "OpenStdin": false,
+ "StdinOnce": false,
+ "Env": null,
+ "Cmd": [
+ "date"
+ ],
+ "Dns": null,
+ "Image": "base",
+ "Volumes": {},
+ "VolumesFrom": "",
+ "WorkingDir":""
+
+ },
+ "State": {
+ "Running": false,
+ "Pid": 0,
+ "ExitCode": 0,
+ "StartedAt": "2013-05-07T14:51:42.087658+02:01360",
+ "Ghost": false
+ },
+ "Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc",
+ "NetworkSettings": {
+ "IpAddress": "",
+ "IpPrefixLen": 0,
+ "Gateway": "",
+ "Bridge": "",
+ "PortMapping": null
+ },
+ "SysInitPath": "/home/kitty/go/src/github.com/dotcloud/docker/bin/docker",
+ "ResolvConfPath": "/etc/resolv.conf",
+ "Volumes": {},
+ "HostConfig": {
+ "Binds": null,
+ "ContainerIDFile": "",
+ "LxcConf": [],
+ "Privileged": false,
+ "PortBindings": {
+ "80/tcp": [
+ {
+ "HostIp": "0.0.0.0",
+ "HostPort": "49153"
+ }
+ ]
+ },
+ "Links": ["/name:alias"],
+ "PublishAllPorts": false
+ }
+ }
+
+ Status Codes:
+
+ - **200** – no error
+ - **404** – no such container
+ - **500** – server error
+
+### List processes running inside a container
+
+`GET /containers/(id)/top`
+
+List processes running inside the container `id`
+
+ **Example request**:
+
+ GET /containers/4fa6e0f0c678/top HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-Type: application/json
+
+ {
+ "Titles":[
+ "USER",
+ "PID",
+ "%CPU",
+ "%MEM",
+ "VSZ",
+ "RSS",
+ "TTY",
+ "STAT",
+ "START",
+ "TIME",
+ "COMMAND"
+ ],
+ "Processes":[
+ ["root","20147","0.0","0.1","18060","1864","pts/4","S","10:06","0:00","bash"],
+ ["root","20271","0.0","0.0","4312","352","pts/4","S+","10:07","0:00","sleep","10"]
+ ]
+ }
+
+ Query Parameters:
+
+  
+
+ - **ps_args** – ps arguments to use (e.g., aux)
+
+ Status Codes:
+
+ - **200** – no error
+ - **404** – no such container
+ - **500** – server error
+
+### Get container logs
+
+`GET /containers/(id)/logs`
+
+Get stdout and stderr logs from the container ``id``
+
+ **Example request**:
+
+ GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1&timestamps=1&follow=1&tail=10 HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-Type: application/vnd.docker.raw-stream
+
+ {{ STREAM }}
+
+ Query Parameters:
+
+  
+
+ - **follow** – 1/True/true or 0/False/false, return stream. Default false
+ - **stdout** – 1/True/true or 0/False/false, show stdout log. Default false
+ - **stderr** – 1/True/true or 0/False/false, show stderr log. Default false
+ - **timestamps** – 1/True/true or 0/False/false, print timestamps for
+ every log line. Default false
+ - **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all
+
+ Status Codes:
+
+ - **200** – no error
+ - **404** – no such container
+ - **500** – server error
+
+### Inspect changes on a container's filesystem
+
+`GET /containers/(id)/changes`
+
+Inspect changes on container `id`'s filesystem
+
+ **Example request**:
+
+ GET /containers/4fa6e0f0c678/changes HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-Type: application/json
+
+ [
+ {
+ "Path":"/dev",
+ "Kind":0
+ },
+ {
+ "Path":"/dev/kmsg",
+ "Kind":1
+ },
+ {
+ "Path":"/test",
+ "Kind":1
+ }
+ ]
+
+ Status Codes:
+
+ - **200** – no error
+ - **404** – no such container
+ - **500** – server error
+
+### Export a container
+
+`GET /containers/(id)/export`
+
+Export the contents of container `id`
+
+ **Example request**:
+
+ GET /containers/4fa6e0f0c678/export HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-Type: application/octet-stream
+
+ {{ STREAM }}
+
+ Status Codes:
+
+ - **200** – no error
+ - **404** – no such container
+ - **500** – server error
+
+### Start a container
+
+`POST /containers/(id)/start`
+
+Start the container `id`
+
+ **Example request**:
+
+ POST /containers/(id)/start HTTP/1.1
+ Content-Type: application/json
+
+ {
+ "Binds":["/tmp:/tmp"],
+ "Links":["redis3:redis"],
+ "LxcConf":{"lxc.utsname":"docker"},
+ "PortBindings":{ "22/tcp": [{ "HostPort": "11022" }] },
+ "PublishAllPorts":false,
+ "Privileged":false,
+ "Dns": ["8.8.8.8"],
+ "VolumesFrom": ["parent", "other:ro"]
+ }
+
+ **Example response**:
+
+ HTTP/1.1 204 No Content
+ Content-Type: text/plain
+
+ Json Parameters:
+
+  
+
+ - **hostConfig** – the container's host configuration (optional)
+
+ Status Codes:
+
+ - **204** – no error
+ - **304** – container already started
+ - **404** – no such container
+ - **500** – server error
+
+### Stop a container
+
+`POST /containers/(id)/stop`
+
+Stop the container `id`
+
+ **Example request**:
+
+ POST /containers/e90e34656806/stop?t=5 HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 204 OK
+
+ Query Parameters:
+
+  
+
+ - **t** – number of seconds to wait before killing the container
+
+ Status Codes:
+
+ - **204** – no error
+ - **304** – container already stopped
+ - **404** – no such container
+ - **500** – server error
+
+### Restart a container
+
+`POST /containers/(id)/restart`
+
+Restart the container `id`
+
+ **Example request**:
+
+ POST /containers/e90e34656806/restart?t=5 HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 204 OK
+
+ Query Parameters:
+
+  
+
+ - **t** – number of seconds to wait before killing the container
+
+ Status Codes:
+
+ - **204** – no error
+ - **404** – no such container
+ - **500** – server error
+
+### Kill a container
+
+`POST /containers/(id)/kill`
+
+Kill the container `id`
+
+ **Example request**:
+
+ POST /containers/e90e34656806/kill HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 204 OK
+
+ Query Parameters
+
+ - **signal** - Signal to send to the container: integer or string like "SIGINT".
+ When not set, SIGKILL is assumed and the call will waits for the container to exit.
+
+ Status Codes:
+
+ - **204** – no error
+ - **404** – no such container
+ - **500** – server error
+
+### Pause a container
+
+`POST /containers/(id)/pause`
+
+Pause the container `id`
+
+ **Example request**:
+
+ POST /containers/e90e34656806/pause HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 204 OK
+
+ Status Codes:
+
+ - **204** – no error
+ - **404** – no such container
+ - **500** – server error
+
+### Unpause a container
+
+`POST /containers/(id)/unpause`
+
+Unpause the container `id`
+
+ **Example request**:
+
+ POST /containers/e90e34656806/unpause HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 204 OK
+
+ Status Codes:
+
+ - **204** – no error
+ - **404** – no such container
+ - **500** – server error
+
+### Attach to a container
+
+`POST /containers/(id)/attach`
+
+Attach to the container `id`
+
+ **Example request**:
+
+ POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-Type: application/vnd.docker.raw-stream
+
+ {{ STREAM }}
+
+ Query Parameters:
+
+  
+
+ - **logs** – 1/True/true or 0/False/false, return logs. Default
+ false
+ - **stream** – 1/True/true or 0/False/false, return stream.
+ Default false
+ - **stdin** – 1/True/true or 0/False/false, if stream=true, attach
+ to stdin. Default false
+ - **stdout** – 1/True/true or 0/False/false, if logs=true, return
+ stdout log, if stream=true, attach to stdout. Default false
+ - **stderr** – 1/True/true or 0/False/false, if logs=true, return
+ stderr log, if stream=true, attach to stderr. Default false
+
+ Status Codes:
+
+ - **200** – no error
+ - **400** – bad parameter
+ - **404** – no such container
+ - **500** – server error
+
+ **Stream details**:
+
+ When using the TTY setting is enabled in
+ [`POST /containers/create`
+ ](../docker_remote_api_v1.9/#post--containers-create "POST /containers/create"),
+ the stream is the raw data from the process PTY and client's stdin.
+ When the TTY is disabled, then the stream is multiplexed to separate
+ stdout and stderr.
+
+ The format is a **Header** and a **Payload** (frame).
+
+ **HEADER**
+
+ The header will contain the information on which stream write the
+ stream (stdout or stderr). It also contain the size of the
+ associated frame encoded on the last 4 bytes (uint32).
+
+ It is encoded on the first 8 bytes like this:
+
+ header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}
+
+ `STREAM_TYPE` can be:
+
+ - 0: stdin (will be written on stdout)
+ - 1: stdout
+ - 2: stderr
+
+ `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of
+ the uint32 size encoded as big endian.
+
+ **PAYLOAD**
+
+ The payload is the raw stream.
+
+ **IMPLEMENTATION**
+
+ The simplest way to implement the Attach protocol is the following:
+
+ 1. Read 8 bytes
+ 2. chose stdout or stderr depending on the first byte
+ 3. Extract the frame size from the last 4 byets
+ 4. Read the extracted size and output it on the correct output
+ 5. Goto 1)
+
+### Wait a container
+
+`POST /containers/(id)/wait`
+
+Block until container `id` stops, then returns the exit code
+
+ **Example request**:
+
+ POST /containers/16253994b7c4/wait HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-Type: application/json
+
+ {"StatusCode":0}
+
+ Status Codes:
+
+ - **200** – no error
+ - **404** – no such container
+ - **500** – server error
+
+### Remove a container
+
+`DELETE /containers/(id)`
+
+Remove the container `id` from the filesystem
+
+ **Example request**:
+
+ DELETE /containers/16253994b7c4?v=1 HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 204 OK
+
+ 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, Removes the container
+ even if it was running. Default false
+
+ Status Codes:
+
+ - **204** – no error
+ - **400** – bad parameter
+ - **404** – no such container
+ - **500** – server error
+
+### Copy files or folders from a container
+
+`POST /containers/(id)/copy`
+
+Copy files or folders of container `id`
+
+ **Example request**:
+
+ POST /containers/4fa6e0f0c678/copy HTTP/1.1
+ Content-Type: application/json
+
+ {
+ "Resource":"test.txt"
+ }
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-Type: application/octet-stream
+
+ {{ STREAM }}
+
+ Status Codes:
+
+ - **200** – no error
+ - **404** – no such container
+ - **500** – server error
+
+## 2.2 Images
+
+### List Images
+
+`GET /images/json`
+
+**Example request**:
+
+ GET /images/json?all=0 HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-Type: application/json
+
+ [
+ {
+ "RepoTags": [
+ "ubuntu:12.04",
+ "ubuntu:precise",
+ "ubuntu:latest"
+ ],
+ "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c",
+ "Created": 1365714795,
+ "Size": 131506275,
+ "VirtualSize": 131506275
+ },
+ {
+ "RepoTags": [
+ "ubuntu:12.10",
+ "ubuntu:quantal"
+ ],
+ "ParentId": "27cf784147099545",
+ "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc",
+ "Created": 1364102658,
+ "Size": 24653,
+ "VirtualSize": 180116135
+ }
+ ]
+
+
+ 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.
+
+
+
+### Create an image
+
+`POST /images/create`
+
+Create an image, either by pull it from the registry or by importing it
+
+ **Example request**:
+
+ POST /images/create?fromImage=base HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-Type: application/json
+
+ {"status":"Pulling..."}
+ {"status":"Pulling", "progress":"1 B/ 100 B", "progressDetail":{"current":1, "total":100}}
+ {"error":"Invalid..."}
+ ...
+
+ 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:
+
+  
+
+ - **fromImage** – name of the image to pull
+ - **fromSrc** – source to import, - means stdin
+ - **repo** – repository
+ - **tag** – tag
+ - **registry** – the registry to pull from
+
+ Request Headers:
+
+  
+
+ - **X-Registry-Auth** – base64-encoded AuthConfig object
+
+ Status Codes:
+
+ - **200** – no error
+ - **500** – server error
+
+### Insert a file in an image
+
+`POST /images/(name)/insert`
+
+Insert a file from `url` in the image `name` at `path`
+
+ **Example request**:
+
+ POST /images/test/insert?path=/usr&url=myurl HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-Type: application/json
+
+ {"status":"Inserting..."}
+ {"status":"Inserting", "progress":"1/? (n/a)", "progressDetail":{"current":1}}
+ {"error":"Invalid..."}
+ ...
+
+ Status Codes:
+
+ - **200** – no error
+ - **500** – server error
+
+### Inspect an image
+
+`GET /images/(name)/json`
+
+Return low-level information on the image `name`
+
+ **Example request**:
+
+ GET /images/base/json HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-Type: application/json
+
+ {
+ "Created":"2013-03-23T22:24:18.818426-07:00",
+ "Container":"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0",
+ "ContainerConfig":
+ {
+ "Hostname":"",
+ "User":"",
+ "Memory":0,
+ "MemorySwap":0,
+ "AttachStdin":false,
+ "AttachStdout":false,
+ "AttachStderr":false,
+ "PortSpecs":null,
+ "Tty":true,
+ "OpenStdin":true,
+ "StdinOnce":false,
+ "Env":null,
+ "Cmd": ["/bin/bash"],
+ "Dns":null,
+ "Image":"base",
+ "Volumes":null,
+ "VolumesFrom":"",
+ "WorkingDir":""
+ },
+ "Id":"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc",
+ "Parent":"27cf784147099545",
+ "Size": 6824592
+ }
+
+ Status Codes:
+
+ - **200** – no error
+ - **404** – no such image
+ - **500** – server error
+
+### Get the history of an image
+
+`GET /images/(name)/history`
+
+Return the history of the image `name`
+
+ **Example request**:
+
+ GET /images/base/history HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-Type: application/json
+
+ [
+ {
+ "Id":"b750fe79269d",
+ "Created":1364102658,
+ "CreatedBy":"/bin/bash"
+ },
+ {
+ "Id":"27cf78414709",
+ "Created":1364068391,
+ "CreatedBy":""
+ }
+ ]
+
+ Status Codes:
+
+ - **200** – no error
+ - **404** – no such image
+ - **500** – server error
+
+### Push an image on the registry
+
+`POST /images/(name)/push`
+
+Push the image `name` on the registry
+
+ **Example request**:
+
+ POST /images/test/push HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-Type: application/json
+
+ {"status":"Pushing..."}
+ {"status":"Pushing", "progress":"1/? (n/a)", "progressDetail":{"current":1}}}
+ {"error":"Invalid..."}
+ ...
+
+ Query Parameters:
+
+  
+
+ - **registry** – the registry you wan to push, optional
+
+ Request Headers:
+
+  
+
+ - **X-Registry-Auth** – include a base64-encoded AuthConfig
+ object.
+
+ Status Codes:
+
+ - **200** – no error
+ - **404** – no such image
+ - **500** – server error
+
+### Tag an image into a repository
+
+`POST /images/(name)/tag`
+
+Tag the image `name` into a repository
+
+ **Example request**:
+
+ POST /images/test/tag?repo=myrepo&force=0 HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 201 OK
+
+ Query Parameters:
+
+  
+
+ - **repo** – The repository to tag in
+ - **force** – 1/True/true or 0/False/false, default false
+
+ Status Codes:
+
+ - **201** – no error
+ - **400** – bad parameter
+ - **404** – no such image
+ - **409** – conflict
+ - **500** – server error
+
+### Remove an image
+
+`DELETE /images/(name)`
+
+Remove the image `name` from the filesystem
+
+ **Example request**:
+
+ DELETE /images/test HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-type: application/json
+
+ [
+ {"Untagged":"3e2f21a89f"},
+ {"Deleted":"3e2f21a89f"},
+ {"Deleted":"53b4f83ac9"}
+ ]
+
+ Query Parameters:
+
+  
+
+ - **force** – 1/True/true or 0/False/false, default false
+ - **noprune** – 1/True/true or 0/False/false, default false
+
+ Status Codes:
+
+ - **200** – no error
+ - **404** – no such image
+ - **409** – conflict
+ - **500** – server error
+
+### Search images
+
+`GET /images/search`
+
+Search for an image on [Docker Hub](https://hub.docker.com).
+
+> **Note**:
+> The response keys have changed from API v1.6 to reflect the JSON
+> sent by the registry server to the docker daemon's request.
+
+ **Example request**:
+
+ GET /images/search?term=sshd HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-Type: application/json
+
+ [
+ {
+ "description": "",
+ "is_official": false,
+ "is_automated": false,
+ "name": "wma55/u1210sshd",
+ "star_count": 0
+ },
+ {
+ "description": "",
+ "is_official": false,
+ "is_automated": false,
+ "name": "jdswinbank/sshd",
+ "star_count": 0
+ },
+ {
+ "description": "",
+ "is_official": false,
+ "is_automated": false,
+ "name": "vgauthier/sshd",
+ "star_count": 0
+ }
+ ...
+ ]
+
+ Query Parameters:
+
+  
+
+ - **term** – term to search
+
+ Status Codes:
+
+ - **200** – no error
+ - **500** – server error
+
+## 2.3 Misc
+
+### Build an image from Dockerfile via stdin
+
+`POST /build`
+
+Build an image from Dockerfile via stdin
+
+ **Example request**:
+
+ POST /build HTTP/1.1
+
+ {{ STREAM }}
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-Type: application/json
+
+ {"stream":"Step 1..."}
+ {"stream":"..."}
+ {"error":"Error...", "errorDetail":{"code": 123, "message": "Error..."}}
+
+ The stream must be a tar archive compressed with one of the
+ following algorithms: identity (no compression), gzip, bzip2, xz.
+
+ The archive must include a file called `Dockerfile`
+ at its root. It may include any number of other files,
+ which will be accessible in the build context (See the [*ADD build
+ command*](/reference/builder/#dockerbuilder)).
+
+ Query Parameters:
+
+  
+
+ - **t** – repository name (and optionally a tag) to be applied to
+ the resulting image in case of success
+ - **q** – suppress verbose build output
+ - **nocache** – do not use the cache when building the image
+ - **rm** - remove intermediate containers after a successful build (default behavior)
+ - **forcerm - always remove intermediate containers (includes rm)
+
+ Request Headers:
+
+  
+
+ - **Content-type** – should be set to
+ `"application/tar"`.
+ - **X-Registry-Config** – base64-encoded ConfigFile object
+
+ Status Codes:
+
+ - **200** – no error
+ - **500** – server error
+
+### Check auth configuration
+
+`POST /auth`
+
+Get the default username and email
+
+ **Example request**:
+
+ POST /auth HTTP/1.1
+ Content-Type: application/json
+
+ {
+ "username":"hannibal",
+ "password:"xxxx",
+ "email":"hannibal@a-team.com",
+ "serveraddress":"https://index.docker.io/v1/"
+ }
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+
+ Status Codes:
+
+ - **200** – no error
+ - **204** – no error
+ - **500** – server error
+
+### Display system-wide information
+
+`GET /info`
+
+Display system-wide information
+
+ **Example request**:
+
+ GET /info HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-Type: application/json
+
+ {
+ "Containers":11,
+ "Images":16,
+ "Driver":"btrfs",
+ "ExecutionDriver":"native-0.1",
+ "KernelVersion":"3.12.0-1-amd64"
+ "Debug":false,
+ "NFd": 11,
+ "NGoroutines":21,
+ "NEventsListener":0,
+ "InitPath":"/usr/bin/docker",
+ "Sockets":["unix:///var/run/docker.sock"],
+ "IndexServerAddress":["https://index.docker.io/v1/"],
+ "MemoryLimit":true,
+ "SwapLimit":false,
+ "IPv4Forwarding":true
+ }
+
+ Status Codes:
+
+ - **200** – no error
+ - **500** – server error
+
+### Show the docker version information
+
+`GET /version`
+
+Show the docker version information
+
+ **Example request**:
+
+ GET /version HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-Type: application/json
+
+ {
+ "ApiVersion":"1.12",
+ "Version":"0.2.2",
+ "GitCommit":"5a2a5cc+CHANGES",
+ "GoVersion":"go1.0.3"
+ }
+
+ Status Codes:
+
+ - **200** – no error
+ - **500** – server error
+
+### Ping the docker server
+
+`GET /_ping`
+
+Ping the docker server
+
+ **Example request**:
+
+ GET /_ping HTTP/1.1
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+
+ OK
+
+ Status Codes:
+
+ - **200** - no error
+ - **500** - server error
+
+### Create a new image from a container's changes
+
+`POST /commit`
+
+Create a new image from a container's changes
+
+ **Example request**:
+
+ POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1
+ Content-Type: application/json
+
+ {
+ "Hostname":"",
+ "User":"",
+ "Memory":0,
+ "MemorySwap":0,
+ "AttachStdin":false,
+ "AttachStdout":true,
+ "AttachStderr":true,
+ "PortSpecs":null,
+ "Tty":false,
+ "OpenStdin":false,
+ "StdinOnce":false,
+ "Env":null,
+ "Cmd":[
+ "date"
+ ],
+ "Volumes":{
+ "/tmp": {}
+ },
+ "WorkingDir":"",
+ "DisableNetwork": false,
+ "ExposedPorts":{
+ "22/tcp": {}
+ }
+ }
+
+ **Example response**:
+
+ HTTP/1.1 201 OK
+ Content-Type: application/vnd.docker.raw-stream
+
+ {"Id":"596069db4bf5"}
+
+ Json Parameters:
+
+
+
+ - **config** - the container's configuration
+
+ Query Parameters:
+
+  
+
+ - **container** – source container
+ - **repo** – repository
+ - **tag** – tag
+ - **m** – commit message
+ - **author** – author (e.g., "John Hannibal Smith
+ <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>")
+
+ Status Codes:
+
+ - **201** – no error
+ - **404** – no such container
+ - **500** – server error
+
+### Monitor Docker's events
+
+`GET /events`
+
+Get events from docker, either in real time via streaming, or
+via polling (using since)
+
+ **Example request**:
+
+ GET /events?since=1374067924
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-Type: application/json
+
+ {"status":"create","id":"dfdf82bd3881","from":"base:latest","time":1374067924}
+ {"status":"start","id":"dfdf82bd3881","from":"base:latest","time":1374067924}
+ {"status":"stop","id":"dfdf82bd3881","from":"base:latest","time":1374067966}
+ {"status":"destroy","id":"dfdf82bd3881","from":"base:latest","time":1374067970}
+
+ Query Parameters:
+
+  
+
+ - **since** – timestamp used for polling
+ - **until** – timestamp used for polling
+
+ Status Codes:
+
+ - **200** – no error
+ - **500** – server error
+
+### Get a tarball containing all images and tags in a repository
+
+`GET /images/(name)/get`
+
+Get a tarball containing all images and metadata for the repository
+specified by `name`.
+
+ **Example request**
+
+ GET /images/ubuntu/get
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+ Content-Type: application/x-tar
+
+ Binary data stream
+
+ Status Codes:
+
+ - **200** – no error
+ - **500** – server error
+
+### Load a tarball with a set of images and tags into docker
+
+`POST /images/load`
+
+Load a set of images and tags into the docker repository.
+
+ **Example request**
+
+ POST /images/load
+
+ Tarball in body
+
+ **Example response**:
+
+ HTTP/1.1 200 OK
+
+ Status Codes:
+
+ - **200** – no error
+ - **500** – server error
+
+# 3. Going further
+
+## 3.1 Inside `docker run`
+
+Here are the steps of `docker run`:
+
+- Create the container
+
+- If the status code is 404, it means the image doesn't exists:
+ - Try to pull it
+ - Then retry to create the container
+
+- Start the container
+
+- If you are not in detached mode:
+ - Attach to the container, using logs=1 (to have stdout and
+ stderr from the container's start) and stream=1
+
+- If in detached mode or only stdin is attached:
+ - Display the container's id
+
+## 3.2 Hijacking
+
+In this version of the API, /attach, uses hijacking to transport stdin,
+stdout and stderr on the same socket. This might change in the future.
+
+## 3.3 CORS Requests
+
+To enable cross origin requests to the remote api add the flag
+"–api-enable-cors" when running docker in daemon mode.
+
+ $ docker -d -H="192.168.1.9:2375" --api-enable-cors
diff --git a/docs/sources/reference/api/docker_remote_api_v1.2.md b/docs/sources/reference/api/docker_remote_api_v1.2.md
index cecab5bb4e..37a8e1c012 100644
--- a/docs/sources/reference/api/docker_remote_api_v1.2.md
+++ b/docs/sources/reference/api/docker_remote_api_v1.2.md
@@ -628,8 +628,8 @@ Return low-level information on the image `name`
"OpenStdin":true,
"StdinOnce":false,
"Env":null,
- "Cmd": ["/bin/bash"]
- ,"Dns":null,
+ "Cmd": ["/bin/bash"],
+ "Dns":null,
"Image":"centos",
"Volumes":null,
"VolumesFrom":""
@@ -959,7 +959,7 @@ Create a new image from a container's changes
- **repo** – repository
- **tag** – tag
- **m** – commit message
- - **author** – author (eg. "John Hannibal Smith
+ - **author** – author (e.g., "John Hannibal Smith
<[hannibal@a-team.com](mailto:hannibal%40a-team.com)>")
Status Codes:
diff --git a/docs/sources/reference/api/docker_remote_api_v1.3.md b/docs/sources/reference/api/docker_remote_api_v1.3.md
index 1d60b4300d..b510f660fd 100644
--- a/docs/sources/reference/api/docker_remote_api_v1.3.md
+++ b/docs/sources/reference/api/docker_remote_api_v1.3.md
@@ -678,8 +678,8 @@ Return low-level information on the image `name`
"OpenStdin":true,
"StdinOnce":false,
"Env":null,
- "Cmd": ["/bin/bash"]
- ,"Dns":null,
+ "Cmd": ["/bin/bash"],
+ "Dns":null,
"Image":"centos",
"Volumes":null,
"VolumesFrom":""
@@ -1009,7 +1009,7 @@ Create a new image from a container's changes
- **repo** – repository
- **tag** – tag
- **m** – commit message
- - **author** – author (eg. "John Hannibal Smith
+ - **author** – author (e.g., "John Hannibal Smith
<[hannibal@a-team.com](mailto:hannibal%40a-team.com)>")
Status Codes:
diff --git a/docs/sources/reference/api/docker_remote_api_v1.4.md b/docs/sources/reference/api/docker_remote_api_v1.4.md
index f7d6e82c19..0e49402621 100644
--- a/docs/sources/reference/api/docker_remote_api_v1.4.md
+++ b/docs/sources/reference/api/docker_remote_api_v1.4.md
@@ -264,7 +264,7 @@ List processes running inside the container `id`
 
- - **ps_args** – ps arguments to use (eg. aux)
+ - **ps_args** – ps arguments to use (e.g., aux)
Status Codes:
@@ -724,8 +724,8 @@ Return low-level information on the image `name`
"OpenStdin":true,
"StdinOnce":false,
"Env":null,
- "Cmd": ["/bin/bash"]
- ,"Dns":null,
+ "Cmd": ["/bin/bash"],
+ "Dns":null,
"Image":"centos",
"Volumes":null,
"VolumesFrom":"",
@@ -1055,7 +1055,7 @@ Create a new image from a container's changes
- **repo** – repository
- **tag** – tag
- **m** – commit message
- - **author** – author (eg. "John Hannibal Smith
+ - **author** – author (e.g., "John Hannibal Smith
<[hannibal@a-team.com](mailto:hannibal%40a-team.com)>")
Status Codes:
diff --git a/docs/sources/reference/api/docker_remote_api_v1.5.md b/docs/sources/reference/api/docker_remote_api_v1.5.md
index 53d970accd..33c1aeca1e 100644
--- a/docs/sources/reference/api/docker_remote_api_v1.5.md
+++ b/docs/sources/reference/api/docker_remote_api_v1.5.md
@@ -261,7 +261,7 @@ List processes running inside the container `id`
 
- - **ps_args** – ps arguments to use (eg. aux)
+ - **ps_args** – ps arguments to use (e.g., aux)
Status Codes:
@@ -725,8 +725,8 @@ Return low-level information on the image `name`
"OpenStdin":true,
"StdinOnce":false,
"Env":null,
- "Cmd": ["/bin/bash"]
- ,"Dns":null,
+ "Cmd": ["/bin/bash"],
+ "Dns":null,
"Image":"centos",
"Volumes":null,
"VolumesFrom":"",
@@ -1067,7 +1067,7 @@ Create a new image from a container's changes
- **repo** – repository
- **tag** – tag
- **m** – commit message
- - **author** – author (eg. "John Hannibal Smith
+ - **author** – author (e.g., "John Hannibal Smith
<[hannibal@a-team.com](mailto:hannibal%40a-team.com)>")
Status Codes:
diff --git a/docs/sources/reference/api/docker_remote_api_v1.6.md b/docs/sources/reference/api/docker_remote_api_v1.6.md
index 9b7cded33f..4500c1554c 100644
--- a/docs/sources/reference/api/docker_remote_api_v1.6.md
+++ b/docs/sources/reference/api/docker_remote_api_v1.6.md
@@ -311,7 +311,7 @@ List processes running inside the container `id`
 
- - **ps_args** – ps arguments to use (eg. aux)
+ - **ps_args** – ps arguments to use (e.g., aux)
Status Codes:
@@ -558,7 +558,7 @@ Attach to the container `id`
`STREAM_TYPE` can be:
- - 0: stdin (will be writen on stdout)
+ - 0: stdin (will be written on stdout)
- 1: stdout
- 2: stderr
@@ -832,8 +832,8 @@ Return low-level information on the image `name`
"OpenStdin":true,
"StdinOnce":false,
"Env":null,
- "Cmd": ["/bin/bash"]
- ,"Dns":null,
+ "Cmd": ["/bin/bash"],
+ "Dns":null,
"Image":"base",
"Volumes":null,
"VolumesFrom":"",
@@ -1163,7 +1163,7 @@ Create a new image from a container's changes
- **repo** – repository
- **tag** – tag
- **m** – commit message
- - **author** – author (eg. "John Hannibal Smith
+ - **author** – author (e.g., "John Hannibal Smith
<[hannibal@a-team.com](mailto:hannibal%40a-team.com)>")
Status Codes:
diff --git a/docs/sources/reference/api/docker_remote_api_v1.7.md b/docs/sources/reference/api/docker_remote_api_v1.7.md
index 3432e9bb21..402efa4262 100644
--- a/docs/sources/reference/api/docker_remote_api_v1.7.md
+++ b/docs/sources/reference/api/docker_remote_api_v1.7.md
@@ -267,7 +267,7 @@ List processes running inside the container `id`
 
- - **ps_args** – ps arguments to use (eg. aux)
+ - **ps_args** – ps arguments to use (e.g., aux)
Status Codes:
@@ -507,7 +507,7 @@ Attach to the container `id`
`STREAM_TYPE` can be:
- - 0: stdin (will be writen on stdout)
+ - 0: stdin (will be written on stdout)
- 1: stdout
- 2: stderr
@@ -751,8 +751,8 @@ Return low-level information on the image `name`
"OpenStdin":true,
"StdinOnce":false,
"Env":null,
- "Cmd": ["/bin/bash"]
- ,"Dns":null,
+ "Cmd": ["/bin/bash"],
+ "Dns":null,
"Image":"base",
"Volumes":null,
"VolumesFrom":"",
@@ -1112,7 +1112,7 @@ Create a new image from a container's changes
- **repo** – repository
- **tag** – tag
- **m** – commit message
- - **author** – author (eg. "John Hannibal Smith
+ - **author** – author (e.g., "John Hannibal Smith
<[hannibal@a-team.com](mailto:hannibal%40a-team.com)>")
- **run** – config automatically applied when the image is run.
(ex: {"Cmd": ["cat", "/world"], "PortSpecs":["22"]})
diff --git a/docs/sources/reference/api/docker_remote_api_v1.8.md b/docs/sources/reference/api/docker_remote_api_v1.8.md
index 184e107cdc..78fccaf281 100644
--- a/docs/sources/reference/api/docker_remote_api_v1.8.md
+++ b/docs/sources/reference/api/docker_remote_api_v1.8.md
@@ -303,7 +303,7 @@ List processes running inside the container `id`
 
- - **ps_args** – ps arguments to use (eg. aux)
+ - **ps_args** – ps arguments to use (e.g., aux)
Status Codes:
@@ -549,7 +549,7 @@ Attach to the container `id`
`STREAM_TYPE` can be:
- - 0: stdin (will be writen on stdout)
+ - 0: stdin (will be written on stdout)
- 1: stdout
- 2: stderr
@@ -793,8 +793,8 @@ Return low-level information on the image `name`
"OpenStdin":true,
"StdinOnce":false,
"Env":null,
- "Cmd": ["/bin/bash"]
- ,"Dns":null,
+ "Cmd": ["/bin/bash"],
+ "Dns":null,
"Image":"base",
"Volumes":null,
"VolumesFrom":"",
@@ -1157,7 +1157,7 @@ Create a new image from a container's changes
- **repo** – repository
- **tag** – tag
- **m** – commit message
- - **author** – author (eg. "John Hannibal Smith
+ - **author** – author (e.g., "John Hannibal Smith
<[hannibal@a-team.com](mailto:hannibal%40a-team.com)>")
- **run** – config automatically applied when the image is run.
(ex: {"Cmd": ["cat", "/world"], "PortSpecs":["22"]})
diff --git a/docs/sources/reference/api/docker_remote_api_v1.9.md b/docs/sources/reference/api/docker_remote_api_v1.9.md
index fc9f9b8d5b..741a9ac955 100644
--- a/docs/sources/reference/api/docker_remote_api_v1.9.md
+++ b/docs/sources/reference/api/docker_remote_api_v1.9.md
@@ -303,7 +303,7 @@ List processes running inside the container `id`
 
- - **ps_args** – ps arguments to use (eg. aux)
+ - **ps_args** – ps arguments to use (e.g., aux)
Status Codes:
@@ -553,7 +553,7 @@ Attach to the container `id`
`STREAM_TYPE` can be:
- - 0: stdin (will be writen on stdout)
+ - 0: stdin (will be written on stdout)
- 1: stdout
- 2: stderr
@@ -797,8 +797,8 @@ Return low-level information on the image `name`
"OpenStdin":true,
"StdinOnce":false,
"Env":null,
- "Cmd": ["/bin/bash"]
- ,"Dns":null,
+ "Cmd": ["/bin/bash"],
+ "Dns":null,
"Image":"base",
"Volumes":null,
"VolumesFrom":"",
@@ -1194,7 +1194,7 @@ Create a new image from a container's changes
- **repo** – repository
- **tag** – tag
- **m** – commit message
- - **author** – author (eg. "John Hannibal Smith
+ - **author** – author (e.g., "John Hannibal Smith
<[hannibal@a-team.com](mailto:hannibal%40a-team.com)>")
Status Codes:
diff --git a/docs/sources/reference/api/hub_registry_spec.md b/docs/sources/reference/api/hub_registry_spec.md
index bb0e4ec7e3..1a2cf9423d 100644
--- a/docs/sources/reference/api/hub_registry_spec.md
+++ b/docs/sources/reference/api/hub_registry_spec.md
@@ -77,11 +77,11 @@ grasp the context, here are some examples of registries:
> - local mount point;
> - remote docker addressed through SSH.
-The latter would only require two new commands in docker, e.g.
+The latter would only require two new commands in docker, e.g.,
`registryget` and `registryput`,
wrapping access to the local filesystem (and optionally doing
consistency checks). Authentication and authorization are then delegated
-to SSH (e.g. with public keys).
+to SSH (e.g., with public keys).
### Docker
diff --git a/docs/sources/reference/api/registry_api.md b/docs/sources/reference/api/registry_api.md
index f8bdd6657d..2840693fa8 100644
--- a/docs/sources/reference/api/registry_api.md
+++ b/docs/sources/reference/api/registry_api.md
@@ -62,10 +62,10 @@ grasp the context, here are some examples of registries:
> - local mount point;
> - remote docker addressed through SSH.
-The latter would only require two new commands in docker, e.g.
+The latter would only require two new commands in docker, e.g.,
`registryget` and `registryput`, wrapping access to the local filesystem
(and optionally doing consistency checks). Authentication and authorization
-are then delegated to SSH (e.g. with public keys).
+are then delegated to SSH (e.g., with public keys).
# Endpoints
diff --git a/docs/sources/reference/api/remote_api_client_libraries.md b/docs/sources/reference/api/remote_api_client_libraries.md
index e299e6ed81..d1d26a1ddf 100644
--- a/docs/sources/reference/api/remote_api_client_libraries.md
+++ b/docs/sources/reference/api/remote_api_client_libraries.md
@@ -124,11 +124,17 @@ will add the libraries here.
</tr>
<tr class="row-even">
<td>Scala</td>
+ <td>tugboat</td>
+ <td><a class="reference external" href="https://github.com/softprops/tugboat">https://github.com/softprops/tugboat</a></td>
+ <td>Active</td>
+ </tr>
+ <tr class="row-odd">
+ <td>Scala</td>
<td>reactive-docker</td>
<td><a class="reference external" href="https://github.com/almoehi/reactive-docker">https://github.com/almoehi/reactive-docker</a></td>
<td>Active</td>
</tr>
- <tr class="row-odd">
+ <tr class="row-even">
<td>Java</td>
<td>docker-client</td>
<td><a class="reference external" href="https://github.com/spotify/docker-client">https://github.com/spotify/docker-client</a></td>
diff --git a/docs/sources/reference/builder.md b/docs/sources/reference/builder.md
index 8717eb7bfc..91190933c9 100644
--- a/docs/sources/reference/builder.md
+++ b/docs/sources/reference/builder.md
@@ -15,7 +15,7 @@ To [*build*](../commandline/cli/#cli-build) an image from a source repository,
create a description file called Dockerfile at the root of your repository.
This file will describe the steps to assemble the image.
-Then call `docker build` with the path of you source repository as argument
+Then call `docker build` with the path of your source repository as the argument
(for example, `.`):
$ sudo docker build .
@@ -83,6 +83,38 @@ be treated as an argument. This allows statements like:
Here is the set of instructions you can use in a Dockerfile
for building images.
+## .dockerignore
+
+If a file named `.dockerignore` exists in the source repository, then it
+is interpreted as a newline-separated list of exclusion patterns.
+Exclusion patterns match files or directories relative to the source repository
+that will be excluded from the context. Globbing is done using Go's
+[filepath.Match](http://golang.org/pkg/path/filepath#Match) rules.
+
+The following example shows the use of the `.dockerignore` file to exclude the
+`.git` directory from the context. Its effect can be seen in the changed size of
+the uploaded context.
+
+ $ docker build .
+ Uploading context 18.829 MB
+ Uploading context
+ Step 0 : FROM busybox
+ ---> 769b9341d937
+ Step 1 : CMD echo Hello World
+ ---> Using cache
+ ---> 99cc1ad10469
+ Successfully built 99cc1ad10469
+ $ echo ".git" > .dockerignore
+ $ docker build .
+ Uploading context 6.76 MB
+ Uploading context
+ Step 0 : FROM busybox
+ ---> 769b9341d937
+ Step 1 : CMD echo Hello World
+ ---> Using cache
+ ---> 99cc1ad10469
+ Successfully built 99cc1ad10469
+
## FROM
FROM <image>
@@ -238,14 +270,19 @@ All new files and directories are created with a uid and gid of 0.
In the case where `<src>` is a remote file URL, the destination will have permissions 600.
> **Note**:
-> If you build using STDIN (`docker build - < somefile`), there is no
-> build context, so the Dockerfile can only contain an URL based ADD
-> statement.
-
+> If you build by passing a Dockerfile through STDIN (`docker build - < somefile`),
+> there is no build context, so the Dockerfile can only contain a URL
+> based ADD statement.
+
+> You can also pass a compressed archive through STDIN:
+> (`docker build - < archive.tar.gz`), the `Dockerfile` at the root of
+> the archive and the rest of the archive will get used at the context
+> of the build.
+>
> **Note**:
> If your URL files are protected using authentication, you will need to
-> use an `RUN wget` , `RUN curl`
-> or other tool from within the container as ADD does not support
+> use `RUN wget` , `RUN curl`
+> or use another tool from within the container as ADD does not support
> authentication.
The copy obeys the following rules:
@@ -361,7 +398,7 @@ execute in `/bin/sh -c`:
FROM ubuntu
ENTRYPOINT wc -l -
-For example, that Dockerfile's image will *always* take stdin as input
+For example, that Dockerfile's image will *always* take STDIN as input
("-") and print the number of lines ("-l"). If you wanted to make this
optional but default, you could use a CMD:
diff --git a/docs/sources/reference/commandline/cli.md b/docs/sources/reference/commandline/cli.md
index e496ce425f..301593f2f1 100644
--- a/docs/sources/reference/commandline/cli.md
+++ b/docs/sources/reference/commandline/cli.md
@@ -54,14 +54,14 @@ expect an integer, and they can only be specified once.
-b, --bridge="" Attach containers to a pre-existing network bridge
use 'none' to disable container networking
--bip="" Use this CIDR notation address for the network bridge's IP, not compatible with -b
- -d, --daemon=false Enable daemon mode
-D, --debug=false Enable debug mode
- --dns=[] Force docker to use specific DNS servers
+ -d, --daemon=false Enable daemon mode
+ --dns=[] Force Docker to use specific DNS servers
--dns-search=[] Force Docker to use specific DNS search domains
- -e, --exec-driver="native" Force the docker runtime to use a specific exec driver
+ -e, --exec-driver="native" Force the Docker runtime to use a specific exec driver
-G, --group="docker" Group to assign the unix socket specified by -H when running in daemon mode
use '' (the empty string) to disable setting of a group
- -g, --graph="/var/lib/docker" Path to use as the root of the docker runtime
+ -g, --graph="/var/lib/docker" Path to use as the root of the Docker runtime
-H, --host=[] The socket(s) to bind to in daemon mode
specified using one or more tcp://host:port, unix:///path/to/socket, fd://* or fd://socketfd.
--icc=true Enable inter-container communication
@@ -72,9 +72,9 @@ expect an integer, and they can only be specified once.
if no value is provided: default to the default route MTU or 1500 if no default route is available
-p, --pidfile="/var/run/docker.pid" Path to use for daemon PID file
-r, --restart=true Restart previously running containers
- -s, --storage-driver="" Force the docker runtime to use a specific storage driver
- --storage-opt=[] Set storage driver options
+ -s, --storage-driver="" Force the Docker runtime to use a specific storage driver
--selinux-enabled=false Enable selinux support
+ --storage-opt=[] Set storage driver options
--tls=false Use TLS; implied by tls-verify flags
--tlscacert="/home/sven/.docker/ca.pem" Trust only remotes providing a certificate signed by the CA given here
--tlscert="/home/sven/.docker/cert.pem" Path to TLS certificate file
@@ -134,8 +134,8 @@ like this:
Attach to a running container
- --no-stdin=false Do not attach stdin
- --sig-proxy=true Proxify all received signal to the process (even in non-tty mode)
+ --no-stdin=false Do not attach STDIN
+ --sig-proxy=true Proxify all received signals to the process (even in non-TTY mode). SIGCHLD is not proxied.
The `attach` command will allow you to view or
interact with any running container, detached (`-d`)
@@ -199,25 +199,31 @@ To kill the container, use `docker kill`.
--rm=true Remove intermediate containers after a successful build
-t, --tag="" Repository name (and optionally a tag) to be applied to the resulting image in case of success
-Use this command to build Docker images from a Dockerfile
-and a "context".
+Use this command to build Docker images from a Dockerfile and a
+"context".
-The files at `PATH` or `URL` are called the "context" of the build. The build
-process may refer to any of the files in the context, for example when using an
-[*ADD*](/reference/builder/#dockerfile-add) instruction. When a single Dockerfile is
-given as `URL` or is piped through STDIN (`docker build - < Dockerfile`), then
-no context is set.
+The files at `PATH` or `URL` are called the "context" of the build. The
+build process may refer to any of the files in the context, for example
+when using an [*ADD*](/reference/builder/#dockerfile-add) instruction.
+When a single Dockerfile is given as `URL` or is piped through `STDIN`
+(`docker build - < Dockerfile`), then no context is set.
-When a Git repository is set as `URL`, then the
-repository is used as the context. The Git repository is cloned with its
-submodules (git clone –recursive). A fresh git clone occurs in a
-temporary directory on your local host, and then this is sent to the
-Docker daemon as the context. This way, your local user credentials and
-vpn's etc can be used to access private repositories.
+When a Git repository is set as `URL`, then the repository is used as
+the context. The Git repository is cloned with its submodules (`git
+clone -recursive`). A fresh `git clone` occurs in a temporary directory
+on your local host, and then this is sent to the Docker daemon as the
+context. This way, your local user credentials and VPN's etc can be
+used to access private repositories.
+
+If a file named `.dockerignore` exists in the root of `PATH` then it
+is interpreted as a newline-separated list of exclusion patterns.
+Exclusion patterns match files or directories relative to `PATH` that
+will be excluded from the context. Globbing is done using Go's
+[filepath.Match](http://golang.org/pkg/path/filepath#Match) rules.
See also:
-[*Dockerfile Reference*](/reference/builder/#dockerbuilder).
+[*Dockerfile Reference*](/reference/builder).
### Examples:
@@ -240,7 +246,7 @@ See also:
drwxr-xr-x 2 root root 4.0K Mar 12 2013 tmp
drwxr-xr-x 2 root root 4.0K Nov 15 23:34 usr
---> b35f4035db3f
- Step 3 : CMD echo Hello World
+ Step 3 : CMD echo Hello world
---> Running in 02071fceb21b
---> f52f38b7823e
Successfully built f52f38b7823e
@@ -266,6 +272,30 @@ If you wish to keep the intermediate containers after the build is
complete, you must use `--rm=false`. This does not
affect the build cache.
+ $ docker build .
+ Uploading context 18.829 MB
+ Uploading context
+ Step 0 : FROM busybox
+ ---> 769b9341d937
+ Step 1 : CMD echo Hello world
+ ---> Using cache
+ ---> 99cc1ad10469
+ Successfully built 99cc1ad10469
+ $ echo ".git" > .dockerignore
+ $ docker build .
+ Uploading context 6.76 MB
+ Uploading context
+ Step 0 : FROM busybox
+ ---> 769b9341d937
+ Step 1 : CMD echo Hello world
+ ---> Using cache
+ ---> 99cc1ad10469
+ Successfully built 99cc1ad10469
+
+This example shows the use of the `.dockerignore` file to exclude the `.git`
+directory from the context. Its effect can be seen in the changed size of the
+uploaded context.
+
$ sudo docker build -t vieux/apache:2.0 .
This will build like the previous example, but it will then tag the
@@ -274,11 +304,15 @@ and the tag will be `2.0`
$ sudo docker build - < Dockerfile
-This will read a Dockerfile from *stdin* without
-context. Due to the lack of a context, no contents of any local
-directory will be sent to the `docker` daemon. Since
-there is no context, a Dockerfile `ADD`
-only works if it refers to a remote URL.
+This will read a Dockerfile from `STDIN` without context. Due to the
+lack of a context, no contents of any local directory will be sent to
+the Docker daemon. Since there is no context, a Dockerfile `ADD` only
+works if it refers to a remote URL.
+
+ $ sudo docker build - < context.tar.gz
+
+This will build an image for a compressed context read from `STDIN`.
+Supported formats are: bzip2, gzip and xz.
$ sudo docker build github.com/creack/docker-firefox
@@ -301,8 +335,9 @@ schema.
Create a new image from a container's changes
- -a, --author="" Author (eg. "John Hannibal Smith <hannibal@a-team.com>"
+ -a, --author="" Author (e.g., "John Hannibal Smith <hannibal@a-team.com>")
-m, --message="" Commit message
+ -p, --pause=true Pause container during commit
It can be useful to commit a container's file changes or settings into a
new image. This allows you debug a container by running an interactive
@@ -310,6 +345,11 @@ shell, or to export a working dataset to another server. Generally, it
is better to use Dockerfiles to manage your images in a documented and
maintainable way.
+By default, the container being committed and its processes will be paused
+while the image is committed. This reduces the likelihood of
+encountering data corruption during the process of creating the commit.
+If this behavior is undesired, set the 'p' option to false.
+
### Commit an existing container
$ sudo docker ps
@@ -324,7 +364,7 @@ maintainable way.
## cp
-Copy files/folders from the containers filesystem to the host
+Copy files/folders from a container's filesystem to the host
path. Paths are relative to the root of the filesystem.
Usage: docker cp CONTAINER:PATH HOSTPATH
@@ -441,7 +481,7 @@ To see how the `docker:latest` image was built:
List images
-a, --all=false Show all images (by default filter out the intermediate image layers)
- -f, --filter=[]: Provide filter values (i.e. 'dangling=true')
+ -f, --filter=[] Provide filter values (i.e. 'dangling=true')
--no-trunc=false Don't truncate output
-q, --quiet=false Only show numeric IDs
@@ -483,8 +523,8 @@ by default.
### Filtering
-The filtering flag (-f or --filter) format is of "key=value". If there are more
-than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`)
+The filtering flag (`-f` or `--filter`) format is of "key=value". If there are more
+than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
Current filters:
* dangling (boolean - true or false)
@@ -527,11 +567,10 @@ NOTE: Docker will warn you if any containers exist that are using these untagged
Create an empty filesystem image and import the contents of the tarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz) into it, then optionally tag it.
-URLs must start with `http` and point to a single
-file archive (.tar, .tar.gz, .tgz, .bzip, .tar.xz, or .txz) containing a
-root filesystem. If you would like to import from a local directory or
-archive, you can use the `-` parameter to take the
-data from *stdin*.
+URLs must start with `http` and point to a single file archive (.tar,
+.tar.gz, .tgz, .bzip, .tar.xz, or .txz) containing a root filesystem. If
+you would like to import from a local directory or archive, you can use
+the `-` parameter to take the data from `STDIN`.
### Examples
@@ -543,7 +582,7 @@ This will create a new untagged image.
**Import from a local file:**
-Import to docker via pipe and *stdin*.
+Import to docker via pipe and `STDIN`.
$ cat exampleimage.tgz | sudo docker import - exampleimagelocal:new
@@ -558,32 +597,39 @@ tar, then the ownerships might not get preserved.
## info
+
Usage: docker info
Display system-wide information
For example:
- $ sudo docker info
- Containers: 292
- Images: 194
+ $ sudo docker -D info
+ Containers: 16
+ Images: 2138
+ Storage Driver: btrfs
+ Execution Driver: native-0.1
+ Kernel Version: 3.12.0-1-amd64
Debug mode (server): false
- Debug mode (client): false
- Fds: 22
- Goroutines: 67
- LXC Version: 0.9.0
- EventsListeners: 115
- Kernel Version: 3.8.0-33-generic
- WARNING: No swap limit support
-
-When sending issue reports, please use `docker version` and `docker info` to
+ Debug mode (client): true
+ Fds: 16
+ Goroutines: 104
+ EventsListeners: 0
+ Init Path: /usr/bin/docker
+ Sockets: [unix:///var/run/docker.sock tcp://0.0.0.0:4243]
+ Username: svendowideit
+ Registry: [https://index.docker.io/v1/]
+
+The global `-D` option tells all `docker` comands to output debug information.
+
+When sending issue reports, please use `docker version` and `docker -D info` to
ensure we know how your setup is configured.
## inspect
Usage: docker inspect CONTAINER|IMAGE [CONTAINER|IMAGE...]
- Return low-level information on a container/image
+ Return low-level information on a container or image
-f, --format="" Format the output using the given go template.
@@ -637,11 +683,11 @@ contains complex json object, so to grab it as JSON, you use
Usage: docker kill [OPTIONS] CONTAINER [CONTAINER...]
- Kill a running container (send SIGKILL, or specified signal)
+ Kill a running container using SIGKILL or a specified signal
-s, --signal="KILL" Signal to send to the container
-The main process inside the container will be sent SIGKILL, or any
+The main process inside the container will be sent `SIGKILL`, or any
signal specified with option `--signal`.
## load
@@ -674,7 +720,7 @@ Restores both images and tags.
Usage: docker login [OPTIONS] [SERVER]
- Register or Login to a docker registry server, if no server is specified "https://index.docker.io/v1/" is the default.
+ Register or log in to a Docker registry server, if no server is specified "https://index.docker.io/v1/" is the default.
-e, --email="" Email
-p, --password="" Password
@@ -694,19 +740,21 @@ specify this by adding the server name.
-f, --follow=false Follow log output
-t, --timestamps=false Show timestamps
+ --tail="all" Output the specified number of lines at the end of logs (defaults to all logs)
-The `docker logs` command batch-retrieves all logs
-present at the time of execution.
+The `docker logs` command batch-retrieves logs present at the time of execution.
-The ``docker logs --follow`` command will first return all logs from the
-beginning and then continue streaming new output from the container's stdout
-and stderr.
+The `docker logs --follow` command will continue streaming the new output from
+the container's `STDOUT` and `STDERR`.
+
+Passing a negative number or a non-integer to `--tail` is invalid and the
+value is set to `all` in that case. This behavior may change in the future.
## port
Usage: docker port CONTAINER PRIVATE_PORT
- Lookup the public-facing port which is NAT-ed to PRIVATE_PORT
+ Lookup the public-facing port that is NAT-ed to PRIVATE_PORT
## ps
@@ -735,7 +783,7 @@ Running `docker ps` showing 2 linked containers.
## pull
- Usage: docker pull [REGISTRY_PATH/]NAME[:TAG]
+ Usage: docker pull NAME[:TAG]
Pull an image or a repository from the registry
@@ -778,7 +826,7 @@ registry or to a self-hosted one.
Restart a running container
- -t, --time=10 Number of seconds to try to stop for before killing the container. Once killed it will then be restarted. Default=10
+ -t, --time=10 Number of seconds to try to stop for before killing the container. Once killed it will then be restarted. Default is 10 seconds.
## rm
@@ -788,7 +836,7 @@ registry or to a self-hosted one.
-f, --force=false Force removal of running container
-l, --link=false Remove the specified link and not the underlying container
- -v, --volumes=false Remove the volumes associated to the container
+ -v, --volumes=false Remove the volumes associated with the container
### Known Issues (rm)
@@ -824,7 +872,7 @@ delete them. Any running containers will not be deleted.
Remove one or more images
- -f, --force=false Force
+ -f, --force=false Force removal of the image
--no-prune=false Do not delete untagged parents
### Removing tagged images
@@ -864,6 +912,7 @@ removed before the image is removed.
-a, --attach=[] Attach to stdin, stdout or stderr.
-c, --cpu-shares=0 CPU shares (relative weight)
--cidfile="" Write the container ID to the file
+ --cpuset="" CPUs in which to allow execution (0-3, 0,1)
-d, --detach=false Detached mode: Run container in the background, print new container id
--dns=[] Set custom dns servers
--dns-search=[] Set custom dns search domains
@@ -881,17 +930,17 @@ removed before the image is removed.
'bridge': creates a new network stack for the container on the docker bridge
'none': no networking for this container
'container:<name|id>': reuses another container network stack
- 'host': use the host network stack inside the container
+ 'host': use the host network stack inside the container. Note: the host mode gives the container full access to local system services such as D-bus and is therefore considered insecure.
+ -P, --publish-all=false Publish all exposed ports to the host interfaces
-p, --publish=[] Publish a container's port to the host
format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort
(use 'docker port' to see the actual mapping)
- -P, --publish-all=false Publish all exposed ports to the host interfaces
--privileged=false Give extended privileges to this container
--rm=false Automatically remove the container when it exits (incompatible with -d)
- --sig-proxy=true Proxify all received signal to the process (even in non-tty mode)
+ --sig-proxy=true Proxify received signals to the process (even in non-tty mode). SIGCHLD is not proxied.
-t, --tty=false Allocate a pseudo-tty
-u, --user="" Username or UID
- -v, --volume=[] Bind mount a volume (e.g. from the host: -v /host:/container, from docker: -v /container)
+ -v, --volume=[] Bind mount a volume (e.g., from the host: -v /host:/container, from docker: -v /container)
--volumes-from=[] Mount volumes from the specified container(s)
-w, --workdir="" Working directory inside the container
@@ -1034,7 +1083,7 @@ This will create and run a new container with the container name being
The `--link` flag will link the container named `/redis` into the newly
created container with the alias `redis`. The new container can access the
-network and environment of the redis container via environment variables.
+network and environment of the `redis` container via environment variables.
The `--name` flag will assign the name `console` to the newly created
container.
@@ -1047,19 +1096,19 @@ optionally suffixed with `:ro` or `:rw` to mount the volumes in read-only
or read-write mode, respectively. By default, the volumes are mounted in
the same mode (read write or read only) as the reference container.
-The `-a` flag tells `docker run` to bind to the container's stdin, stdout or
-stderr. This makes it possible to manipulate the output and input as needed.
+The `-a` flag tells `docker run` to bind to the container's `STDIN`, `STDOUT` or
+`STDERR`. This makes it possible to manipulate the output and input as needed.
$ echo "test" | sudo docker run -i -a stdin ubuntu cat -
This pipes data into a container and prints the container's ID by attaching
-only to the container'sstdin.
+only to the container's `STDIN`.
$ sudo docker run -a stderr ubuntu echo test
-This isn't going to print anything unless there's an error because We've
-only attached to the stderr of the container. The container's logs still
- store what's been written to stderr and stdout.
+This isn't going to print anything unless there's an error because we've
+only attached to the `STDERR` of the container. The container's logs
+still store what's been written to `STDERR` and `STDOUT`.
$ cat somefile | sudo docker run -i -a stdin mybuilder dobuild
@@ -1104,7 +1153,7 @@ application change:
Usage: docker save IMAGE
- Save an image to a tar archive (streamed to stdout by default)
+ Save an image to a tar archive (streamed to STDOUT by default)
-o, --output="" Write to an file, instead of STDOUT
@@ -1129,11 +1178,11 @@ Search [Docker Hub](https://hub.docker.com) for images
Usage: docker search TERM
- Search the docker index for images
+ Search the Docker Hub for images
- --no-trunc=false Don't truncate output
- -s, --stars=0 Only displays with at least xxx stars
- --automated=false Only show automated builds
+ --automated=false Only show automated builds
+ --no-trunc=false Don't truncate output
+ -s, --stars=0 Only displays with at least x stars
See [*Find Public Images on Docker Hub*](
/userguide/dockerrepos/#find-public-images-on-docker-hub) for
@@ -1145,8 +1194,8 @@ more details on finding shared images from the command line.
Restart a stopped container
- -a, --attach=false Attach container's stdout/stderr and forward all signals to the process
- -i, --interactive=false Attach container's stdin
+ -a, --attach=false Attach container's STDOUT and STDERR and forward all signals to the process
+ -i, --interactive=false Attach container's STDIN
When run on a container that has already been started,
takes no action and succeeds unconditionally.
@@ -1155,9 +1204,9 @@ takes no action and succeeds unconditionally.
Usage: docker stop [OPTIONS] CONTAINER [CONTAINER...]
- Stop a running container (Send SIGTERM, and then SIGKILL after grace period)
+ Stop a running container by sending SIGTERM and then SIGKILL after a grace period
- -t, --time=10 Number of seconds to wait for the container to stop before killing it.
+ -t, --time=10 Number of seconds to wait for the container to stop before killing it. Default is 10 seconds.
The main process inside the container will receive SIGTERM, and after a
grace period, SIGKILL
@@ -1178,13 +1227,13 @@ them to [*Share Images via Repositories*](
Usage: docker top CONTAINER [ps OPTIONS]
- Lookup the running processes of a container
+ Display the running processes of a container
## version
Usage: docker version
- Show the docker version information.
+ Show the Docker version information.
Show the Docker version, API version, Git commit, and Go version of
both Docker client and daemon.
@@ -1194,3 +1243,4 @@ both Docker client and daemon.
Usage: docker wait CONTAINER [CONTAINER...]
Block until a container stops, then print its exit code.
+
diff --git a/docs/sources/reference/run.md b/docs/sources/reference/run.md
index 5cb050c025..a539ab0d18 100644
--- a/docs/sources/reference/run.md
+++ b/docs/sources/reference/run.md
@@ -5,13 +5,13 @@ page_keywords: docker, run, configure, runtime
# Docker Run Reference
**Docker runs processes in isolated containers**. When an operator
-executes `docker run`, she starts a process with its
-own file system, its own networking, and its own isolated process tree.
-The [*Image*](/terms/image/#image-def) which starts the process may
-define defaults related to the binary to run, the networking to expose,
-and more, but `docker run` gives final control to
-the operator who starts the container from the image. That's the main
-reason [*run*](/reference/commandline/cli/#cli-run) has more options than any
+executes `docker run`, she starts a process with its own file system,
+its own networking, and its own isolated process tree. The
+[*Image*](/terms/image/#image-def) which starts the process may define
+defaults related to the binary to run, the networking to expose, and
+more, but `docker run` gives final control to the operator who starts
+the container from the image. That's the main reason
+[*run*](/reference/commandline/cli/#cli-run) has more options than any
other `docker` command.
## General Form
@@ -36,10 +36,10 @@ The list of `[OPTIONS]` breaks down into two groups:
2. Setting shared between operators and developers, where operators can
override defaults developers set in images at build time.
-Together, the `docker run [OPTIONS]` give complete
-control over runtime behavior to the operator, allowing them to override
-all defaults set by the developer during `docker build`
-and nearly all the defaults set by the Docker runtime itself.
+Together, the `docker run [OPTIONS]` give complete control over runtime
+behavior to the operator, allowing them to override all defaults set by
+the developer during `docker build` and nearly all the defaults set by
+the Docker runtime itself.
## Operator Exclusive Options
@@ -54,10 +54,8 @@ following options.
- [PID Equivalent](#pid-equivalent)
- [Network Settings](#network-settings)
- [Clean Up (--rm)](#clean-up-rm)
- - [Runtime Constraints on CPU and
- Memory](#runtime-constraints-on-cpu-and-memory)
- - [Runtime Privilege and LXC
- Configuration](#runtime-privilege-and-lxc-configuration)
+ - [Runtime Constraints on CPU and Memory](#runtime-constraints-on-cpu-and-memory)
+ - [Runtime Privilege and LXC Configuration](#runtime-privilege-and-lxc-configuration)
## Detached vs Foreground
@@ -78,32 +76,32 @@ container in the detached mode, then you cannot use the `--rm` option.
### Foreground
-In foreground mode (the default when `-d` is not specified), `docker run`
-can start the process in the container and attach the console to the process's
-standard input, output, and standard error. It can even pretend to be a TTY
-(this is what most command line executables expect) and pass along signals. All
-of that is configurable:
+In foreground mode (the default when `-d` is not specified), `docker
+run` can start the process in the container and attach the console to
+the process's standard input, output, and standard error. It can even
+pretend to be a TTY (this is what most command line executables expect)
+and pass along signals. All of that is configurable:
- -a=[] : Attach to ``stdin``, ``stdout`` and/or ``stderr``
+ -a=[] : Attach to `STDIN`, `STDOUT` and/or `STDERR`
-t=false : Allocate a pseudo-tty
--sig-proxy=true: Proxify all received signal to the process (even in non-tty mode)
-i=false : Keep STDIN open even if not attached
-If you do not specify `-a` then Docker will [attach everything (stdin,stdout,stderr)](
-https://github.com/dotcloud/docker/blob/
-75a7f4d90cde0295bcfb7213004abce8d4779b75/commands.go#L1797). You can specify to which
-of the three standard streams (`stdin`, `stdout`, `stderr`) you'd like to connect
-instead, as in:
+If you do not specify `-a` then Docker will [attach all standard
+streams]( https://github.com/dotcloud/docker/blob/
+75a7f4d90cde0295bcfb7213004abce8d4779b75/commands.go#L1797). You can
+specify to which of the three standard streams (`STDIN`, `STDOUT`,
+`STDERR`) you'd like to connect instead, as in:
$ docker run -a stdin -a stdout -i -t ubuntu /bin/bash
-For interactive processes (like a shell) you will typically want a tty as well as
-persistent standard input (`stdin`), so you'll use `-i -t` together in most
-interactive cases.
+For interactive processes (like a shell) you will typically want a tty
+as well as persistent standard input (`STDIN`), so you'll use `-i -t`
+together in most interactive cases.
## Container Identification
-### Name (–name)
+### Name (–-name)
The operator can identify a container in three ways:
@@ -113,19 +111,18 @@ The operator can identify a container in three ways:
- Name ("evil_ptolemy")
The UUID identifiers come from the Docker daemon, and if you do not
-assign a name to the container with `--name` then
-the daemon will also generate a random string name too. The name can
-become a handy way to add meaning to a container since you can use this
-name when defining
-[*links*](/userguide/dockerlinks/#working-with-links-names)
-(or any other place you need to identify a container). This works for
-both background and foreground Docker containers.
+assign a name to the container with `--name` then the daemon will also
+generate a random string name too. The name can become a handy way to
+add meaning to a container since you can use this name when defining
+[*links*](/userguide/dockerlinks/#working-with-links-names) (or any
+other place you need to identify a container). This works for both
+background and foreground Docker containers.
-### PID Equivalent
+### PID Equivalent
-And finally, to help with automation, you can have Docker write the
+Finally, to help with automation, you can have Docker write the
container ID out to a file of your choosing. This is similar to how some
-programs might write out their process ID to a file (you`ve seen them as
+programs might write out their process ID to a file (you've seen them as
PID files):
--cidfile="": Write the container ID to the file
@@ -141,14 +138,14 @@ PID files):
By default, all containers have networking enabled and they can make any
outgoing connections. The operator can completely disable networking
-with `docker run --net none` which disables all incoming and
-outgoing networking. In cases like this, you would perform I/O through
-files or STDIN/STDOUT only.
+with `docker run --net none` which disables all incoming and outgoing
+networking. In cases like this, you would perform I/O through files or
+`STDIN` and `STDOUT` only.
Your container will use the same DNS servers as the host by default, but
you can override this with `--dns`.
-Supported networking modes are:
+Supported networking modes are:
* none - no networking in the container
* bridge - (default) connect the container to the bridge via veth interfaces
@@ -156,41 +153,46 @@ Supported networking modes are:
* container - use another container's network stack
#### Mode: none
-With the networking mode set to `none` a container will not have a access to
-any external routes. The container will still have a `loopback` interface
-enabled in the container but it does not have any routes to external traffic.
+
+With the networking mode set to `none` a container will not have a
+access to any external routes. The container will still have a
+`loopback` interface enabled in the container but it does not have any
+routes to external traffic.
#### Mode: bridge
-With the networking mode set to `bridge` a container will use docker's default
-networking setup. A bridge is setup on the host, commonly named `docker0`,
-and a pair of veth interfaces will be created for the container. One side of
-the veth pair will remain on the host attached to the bridge while the other
-side of the pair will be placed inside the container's namespaces in addition
-to the `loopback` interface. An IP address will be allocated for containers
-on the bridge's network and trafic will be routed though this bridge to the
-container.
+
+With the networking mode set to `bridge` a container will use docker's
+default networking setup. A bridge is setup on the host, commonly named
+`docker0`, and a pair of `veth` interfaces will be created for the
+container. One side of the `veth` pair will remain on the host attached
+to the bridge while the other side of the pair will be placed inside the
+container's namespaces in addition to the `loopback` interface. An IP
+address will be allocated for containers on the bridge's network and
+traffic will be routed though this bridge to the container.
#### Mode: host
+
With the networking mode set to `host` a container will share the host's
-network stack and all interfaces from the host will be available to the
-container. The container's hostname will match the hostname on the host
-system. Publishing ports and linking to other containers will not work
-when sharing the host's network stack.
+network stack and all interfaces from the host will be available to the
+container. The container's hostname will match the hostname on the host
+system. Publishing ports and linking to other containers will not work
+when sharing the host's network stack.
#### Mode: container
-With the networking mode set to `container` a container will share the
-network stack of another container. The other container's name must be
+
+With the networking mode set to `container` a container will share the
+network stack of another container. The other container's name must be
provided in the format of `--net container:<name|id>`.
-Example running a redis container with redis binding to localhost then
-running the redis-cli and connecting to the redis server over the
-localhost interface.
+Example running a Redis container with Redis binding to `localhost` then
+running the `redis-cli` command and connecting to the Redis server over the
+`localhost` interface.
$ docker run -d --name redis example/redis --bind 127.0.0.1
$ # use the redis container's network stack to access localhost
$ docker run --rm -ti --net container:redis example/redis-cli -h 127.0.0.1
-## Clean Up (–rm)
+## Clean Up (–-rm)
By default a container's file system persists even after the container
exits. This makes debugging a lot easier (since you can inspect the
@@ -211,15 +213,14 @@ container:
-c=0 : CPU shares (relative weight)
The operator can constrain the memory available to a container easily
-with `docker run -m`. If the host supports swap
-memory, then the `-m` memory setting can be larger
-than physical RAM.
+with `docker run -m`. If the host supports swap memory, then the `-m`
+memory setting can be larger than physical RAM.
Similarly the operator can increase the priority of this container with
-the `-c` option. By default, all containers run at
-the same priority and get the same proportion of CPU cycles, but you can
-tell the kernel to give more shares of CPU time to one or more
-containers when you start them via Docker.
+the `-c` option. By default, all containers run at the same priority and
+get the same proportion of CPU cycles, but you can tell the kernel to
+give more shares of CPU time to one or more containers when you start
+them via Docker.
## Runtime Privilege and LXC Configuration
@@ -239,7 +240,7 @@ to access to all devices on the host as well as set some configuration
in AppArmor to allow the container nearly all the same access to the
host as processes running outside containers on the host. Additional
information about running with `--privileged` is available on the
-[Docker Blog](http://blog.docker.io/2013/09/docker-can-now-run-within-docker/).
+[Docker Blog](http://blog.docker.com/2013/09/docker-can-now-run-within-docker/).
If the Docker daemon was started using the `lxc` exec-driver
(`docker -d --exec-driver=lxc`) then the operator can also specify LXC options
@@ -277,19 +278,20 @@ commandline:
$ docker run [OPTIONS] IMAGE[:TAG] [COMMAND] [ARG...]
-This command is optional because the person who created the `IMAGE` may have
-already provided a default `COMMAND` using the Dockerfile `CMD`. As the
-operator (the person running a container from the image), you can override that
-`CMD` just by specifying a new `COMMAND`.
+This command is optional because the person who created the `IMAGE` may
+have already provided a default `COMMAND` using the Dockerfile `CMD`
+instruction. As the operator (the person running a container from the
+image), you can override that `CMD` instruction just by specifying a new
+`COMMAND`.
-If the image also specifies an `ENTRYPOINT` then the `CMD` or `COMMAND` get
-appended as arguments to the `ENTRYPOINT`.
+If the image also specifies an `ENTRYPOINT` then the `CMD` or `COMMAND`
+get appended as arguments to the `ENTRYPOINT`.
## ENTRYPOINT (Default Command to Execute at Runtime)
--entrypoint="": Overwrite the default entrypoint set by the image
-The ENTRYPOINT of an image is similar to a `COMMAND` because it
+The `ENTRYPOINT` of an image is similar to a `COMMAND` because it
specifies what executable to run when the container starts, but it is
(purposely) more difficult to override. The `ENTRYPOINT` gives a
container its default nature or behavior, so that when you set an
@@ -310,10 +312,10 @@ or two examples of how to pass more parameters to that ENTRYPOINT:
## EXPOSE (Incoming Ports)
-The Dockerfile doesn't give much control over networking, only providing the
-`EXPOSE` instruction to give a hint to the operator about what incoming ports
-might provide services. The following options work with or override the
-Dockerfile's exposed defaults:
+The Dockerfile doesn't give much control over networking, only providing
+the `EXPOSE` instruction to give a hint to the operator about what
+incoming ports might provide services. The following options work with
+or override the Dockerfile's exposed defaults:
--expose=[]: Expose a port from the container
without publishing it to your host
@@ -324,34 +326,34 @@ Dockerfile's exposed defaults:
(use 'docker port' to see the actual mapping)
--link="" : Add link to another container (name:alias)
-As mentioned previously, `EXPOSE` (and `--expose`) make a port available **in**
-a container for incoming connections. The port number on the inside of the
-container (where the service listens) does not need to be the same number as the
-port exposed on the outside of the container (where clients connect), so inside
-the container you might have an HTTP service listening on port 80 (and so you
-`EXPOSE 80` in the Dockerfile), but outside the container the port might be
-42800.
+As mentioned previously, `EXPOSE` (and `--expose`) make a port available
+**in** a container for incoming connections. The port number on the
+inside of the container (where the service listens) does not need to be
+the same number as the port exposed on the outside of the container
+(where clients connect), so inside the container you might have an HTTP
+service listening on port 80 (and so you `EXPOSE 80` in the Dockerfile),
+but outside the container the port might be 42800.
-To help a new client container reach the server container's internal port
-operator `--expose`'d by the operator or `EXPOSE`'d by the developer, the
-operator has three choices: start the server container with `-P` or `-p,` or
-start the client container with `--link`.
+To help a new client container reach the server container's internal
+port operator `--expose`'d by the operator or `EXPOSE`'d by the
+developer, the operator has three choices: start the server container
+with `-P` or `-p,` or start the client container with `--link`.
If the operator uses `-P` or `-p` then Docker will make the exposed port
-accessible on the host and the ports will be available to any client that
-can reach the host. To find the map between the host ports and the exposed
-ports, use `docker port`)
+accessible on the host and the ports will be available to any client
+that can reach the host. To find the map between the host ports and the
+exposed ports, use `docker port`)
-If the operator uses `--link` when starting the new client container, then the
-client container can access the exposed port via a private networking interface.
-Docker will set some environment variables in the client container to help
-indicate which interface and port to use.
+If the operator uses `--link` when starting the new client container,
+then the client container can access the exposed port via a private
+networking interface. Docker will set some environment variables in the
+client container to help indicate which interface and port to use.
## ENV (Environment Variables)
-The operator can **set any environment variable** in the container by using one
-or more `-e` flags, even overriding those already defined by the developer with
-a Dockefile `ENV`:
+The operator can **set any environment variable** in the container by
+using one or more `-e` flags, even overriding those already defined by
+the developer with a Dockerfile `ENV`:
$ docker run -e "deep=purple" --rm ubuntu /bin/bash -c export
declare -x HOME="/"
@@ -420,18 +422,19 @@ mechanism to communicate with a linked container by its alias:
If "container-dir" is missing, then docker creates a new volume.
--volumes-from="": Mount all volumes from the given container(s)
-The volumes commands are complex enough to have their own documentation in
-section [*Share Directories via Volumes*](/userguide/dockervolumes/#volume-def).
-A developer can define one or more `VOLUME's associated with an image, but only the
-operator can give access from one container to another (or from a container to a
+The volumes commands are complex enough to have their own documentation
+in section [*Share Directories via
+Volumes*](/userguide/dockervolumes/#volume-def). A developer can define
+one or more `VOLUME`'s associated with an image, but only the operator
+can give access from one container to another (or from a container to a
volume mounted on the host).
## USER
-The default user within a container is `root` (id = 0), but if the developer
-created additional users, those are accessible too. The developer can set a
-default user to run the first process with the `Dockerfile USER` command,
-but the operator can override it:
+The default user within a container is `root` (id = 0), but if the
+developer created additional users, those are accessible too. The
+developer can set a default user to run the first process with the
+Dockerfile `USER` instruction, but the operator can override it:
-u="": Username or UID