1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Fixes to the 1.19 version

updating with changes to this instant
Signed-off-by: Mary Anthony <mary@docker.com>
This commit is contained in:
Mary Anthony 2015-05-28 13:35:47 -07:00
parent 3bda841e3e
commit 30901609a8

View file

@ -10,11 +10,11 @@ page_keywords: API, Docker, rcli, REST, documentation
- The daemon listens on `unix:///var/run/docker.sock` but you can
[Bind Docker to another host/port or a Unix socket](
/articles/basics/#bind-docker-to-another-hostport-or-a-unix-socket).
- 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`.
- When the client API version is newer than the daemon's an HTTP
`400 Bad Request` error message is returned.
- The API tends to be REST. However, for some complex commands, like `attach`
or `pull`, the HTTP connection is hijacked to transport `stdout`,
`stdin` and `stderr`.
- When the client API version is newer than the daemon's, these calls return an HTTP
`400 Bad Request` error message.
# 2. Endpoints
@ -90,10 +90,10 @@ Query Parameters:
non-running ones.
- **size** 1/True/true or 0/False/false, Show the containers
sizes
- **filters** - a json encoded value of the filters (a map[string][]string) to process on the containers list. Available filters:
- exited=&lt;int&gt; -- containers with exit code of &lt;int&gt;
- status=(restarting|running|paused|exited)
- label=`key` or `key=value` of a container label
- **filters** - a JSON encoded value of the filters (a `map[string][]string`) to process on the containers list. Available filters:
- `exited=<int>`; -- containers with exit code of `<int>` ;
- `status=`(`restarting`|`running`|`paused`|`exited`)
- `label=key` or `key=value` of a container label
Status Codes:
@ -186,54 +186,53 @@ Create a container
Json Parameters:
- **Hostname** - A string value containing the desired hostname to use for the
- **Hostname** - A string value containing the hostname to use for the
container.
- **Domainname** - A string value containing the desired domain name to use
- **Domainname** - A string value containing the domain name to use
for the container.
- **User** - A string value containing the user to use inside the container.
- **User** - A string value specifying the user inside the container.
- **Memory** - Memory limit in bytes.
- **MemorySwap**- Total memory limit (memory + swap); set `-1` to disable swap,
always use this with `memory`, and make the value larger than `memory`.
- **CpuShares** - An integer value containing the CPU Shares for container
- **MemorySwap**- Total memory limit (memory + swap); set `-1` to disable swap
You must use this with `memory` and make the swap value larger than `memory`.
- **CpuShares** - An integer value containing the container's CPU Shares
(ie. the relative weight vs other containers).
- **CpuPeriod** - The length of a CPU period (in microseconds).
- **Cpuset** - The same as CpusetCpus, but deprecated, please don't use.
- **CpusetCpus** - String value containing the cgroups CpusetCpus to use.
- **CpuPeriod** - The length of a CPU period in microseconds.
- **Cpuset** - Deprecated please don't use. Use `CpusetCpus` instead.
- **CpusetCpus** - String value containing the `cgroups CpusetCpus` to use.
- **CpusetMems** - Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.
- **BlkioWeight** - Block IO weight (relative weight) accepts a weight value between 10 and 1000.
- **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
- **AttachStdin** - Boolean value, attaches to stdin.
- **AttachStdout** - Boolean value, attaches to stdout.
- **AttachStderr** - Boolean value, attaches to stderr.
- **Tty** - Boolean value, Attach standard streams to a tty, including stdin if it is not closed.
- **AttachStdin** - Boolean value, attaches to `stdin`.
- **AttachStdout** - Boolean value, attaches to `stdout`.
- **AttachStderr** - Boolean value, attaches to `stderr`.
- **Tty** - Boolean value, Attach standard streams to a `tty`, including `stdin` if it is not closed.
- **OpenStdin** - Boolean value, opens stdin,
- **StdinOnce** - Boolean value, close stdin after the 1 attached client disconnects.
- **StdinOnce** - Boolean value, close `stdin` after the 1 attached client disconnects.
- **Env** - A list of environment variables in the form of `VAR=value`
- **Labels** - Adds a map of labels that to a container. To specify a map: `{"key":"value"[,"key2":"value2"]}`
- **Labels** - Adds a map of labels to a container. To specify a map: `{"key":"value"[,"key2":"value2"]}`
- **Cmd** - Command to run specified as a string or an array of strings.
- **Entrypoint** - Set the entrypoint for the container a a string or an array
of strings
- **Image** - String value containing the image name to use for the container
- **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
container to empty objects.
- **WorkingDir** - A string value containing the working dir for commands to
- **WorkingDir** - A string specifying the working directory for commands to
run in.
- **NetworkDisabled** - Boolean value, when true disables networking for the
container
- **ExposedPorts** - An object mapping ports to an empty object in the form of:
`"ExposedPorts": { "<port>/<tcp|udp>: {}" }`
- **HostConfig**
- **Binds** A list of volume bindings for this container. Each volume
binding is a string of the form `container_path` (to create a new
volume for the container), `host_path:container_path` (to bind-mount
a host path into the container), or `host_path:container_path:ro`
(to make the bind-mount read-only inside the container).
- **Binds** A list of volume bindings for this container. Each volume binding is a string in one of these forms:
+ `container_path` to create a new volume for the container
+ `host_path:container_path` to bind-mount a host path into the container
+ `host_path:container_path:ro` to make the bind-mount read-only inside the container.
- **Links** - A list of links for the container. Each link entry should be
in the form of `container_name:alias`.
- **LxcConf** - LXC specific configurations. These configurations will only
- **LxcConf** - LXC specific configurations. These configurations only
work when using the `lxc` execution driver.
- **PortBindings** - A map of exposed container ports and the host port they
should map to. It should be specified in the form
should map to. A JSON object in the form
`{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
Take note that `port` is specified as a string and not an integer value.
- **PublishAllPorts** - Allocates a random host port for all of a container's
@ -242,9 +241,9 @@ Json Parameters:
a boolean value.
- **ReadonlyRootfs** - Mount the container's root filesystem as read only.
Specified as a boolean value.
- **Dns** - A list of dns servers for the container to use.
- **Dns** - A list of DNS servers for the container to use.
- **DnsSearch** - A list of DNS search domains
- **ExtraHosts** - A list of hostnames/IP mappings to be added to the
- **ExtraHosts** - A list of hostnames/IP mappings to add to the
container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`.
- **VolumesFrom** - A list of volumes to inherit from another container.
Specified in the form `<container name>[:<ro|rw>]`
@ -260,19 +259,19 @@ Json Parameters:
is added before each restart to prevent flooding the server.
- **NetworkMode** - Sets the networking mode for the container. Supported
values are: `bridge`, `host`, and `container:<name|id>`
- **Devices** - A list of devices to add to the container specified in the
- **Devices** - A list of devices to add to the container specified as a JSON object in the
form
`{ "PathOnHost": "/dev/deviceName", "PathInContainer": "/dev/deviceName", "CgroupPermissions": "mrw"}`
- **Ulimits** - A list of ulimits to be set in the container, specified as
- **Ulimits** - A list of ulimits to set in the container, specified as
`{ "Name": <name>, "Soft": <soft limit>, "Hard": <hard limit> }`, for example:
`Ulimits: { "Name": "nofile", "Soft": 1024, "Hard", 2048 }}`
- **SecurityOpt**: A list of string values to customize labels for MLS
systems, such as SELinux.
- **LogConfig** - Log configuration for the container, specified as
- **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`.
`json-file` logging driver.
- **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.
- **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:
@ -472,7 +471,7 @@ Status Codes:
`GET /containers/(id)/logs`
Get stdout and stderr logs from the container ``id``
Get `stdout` and `stderr` logs from the container ``id``
> **Note**:
> This endpoint works only for containers with `json-file` logging driver.
@ -492,14 +491,14 @@ Get stdout and stderr logs from the container ``id``
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
- **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`.
- **since** UNIX timestamp (integer) to filter logs. Specifying a timestamp
will only output log-entries since that timestamp. Default: 0 (unfiltered)
- **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
every log line. Default `false`.
- **tail** Output specified number of lines at the end of logs: `all` or `<number>`. Default all.
Status Codes:
@ -659,7 +658,7 @@ This endpoint returns a live stream of a container's resource usage statistics.
Query Parameters:
- **stream** 1/True/true or 0/False/false, pull stats once then disconnect. Default true
- **stream** 1/True/true or 0/False/false, pull stats once then disconnect. Default `true`.
Status Codes:
@ -671,7 +670,7 @@ Status Codes:
`POST /containers/(id)/resize?h=<height>&w=<width>`
Resize the TTY for container with `id`. The container must be restarted for the resize to take effect.
Resize the TTY for container with `id`. You must restart the container for the resize to take effect.
**Example request**:
@ -733,17 +732,16 @@ Start the container `id`
Json Parameters:
- **Binds** A list of volume bindings for this container. Each volume
binding is a string of the form `container_path` (to create a new
volume for the container), `host_path:container_path` (to bind-mount
a host path into the container), or `host_path:container_path:ro`
(to make the bind-mount read-only inside the container).
- **Binds** A list of volume bindings for this container. Each volume binding is a string in one of these forms:
+ `container_path` to create a new volume for the container
+ `host_path:container_path` to bind-mount a host path into the container
+ `host_path:container_path:ro` to make the bind-mount read-only inside the container.
- **Links** - A list of links for the container. Each link entry should be of
of the form `container_name:alias`.
- **LxcConf** - LXC specific configurations. These configurations will only
- **LxcConf** - LXC specific configurations. These configurations only
work when using the `lxc` execution driver.
- **PortBindings** - A map of exposed container ports and the host port they
should map to. It should be specified in the form
should map to. A JSON object in the form
`{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
Take note that `port` is specified as a string and not an integer value.
- **PublishAllPorts** - Allocates a random host port for all of a container's
@ -753,8 +751,8 @@ Json Parameters:
- **ReadonlyRootfs** - Mount the container's root filesystem as read only.
Specified as a boolean value.
- **Dns** - A list of dns servers for the container to use.
- **DnsSearch** - A list of DNS search domains
- **ExtraHosts** - A list of hostnames/IP mappings to be added to the
- **DnsSearch** - A list of DNS search domains.
- **ExtraHosts** - A list of hostnames/IP mappings to add to the
container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`.
- **VolumesFrom** - A list of volumes to inherit from another container.
Specified in the form `<container name>[:<ro|rw>]`
@ -770,10 +768,10 @@ Json Parameters:
is added before each restart to prevent flooding the server.
- **NetworkMode** - Sets the networking mode for the container. Supported
values are: `bridge`, `host`, and `container:<name|id>`
- **Devices** - A list of devices to add to the container specified in the
- **Devices** - A list of devices to add to the container specified as a JSON object in the
form
`{ "PathOnHost": "/dev/deviceName", "PathInContainer": "/dev/deviceName", "CgroupPermissions": "mrw"}`
- **Ulimits** - A list of ulimits to be set in the container, specified as
- **Ulimits** - A list of ulimits to set in the container, specified as
`{ "Name": <name>, "Soft": <soft limit>, "Hard": <hard limit> }`, for example:
`Ulimits: { "Name": "nofile", "Soft": 1024, "Hard", 2048 }}`
- **SecurityOpt**: A list of string values to customize labels for MLS
@ -782,7 +780,7 @@ Json Parameters:
`{ "Type": "<driver_name>", "Config": {"key1": "val1"}}`.
Available types: `json-file`, `syslog`, `journald`, `none`.
`json-file` logging driver.
- **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.
- **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.
Status Codes:
@ -856,8 +854,8 @@ Kill the container `id`
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.
- **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:
@ -951,15 +949,15 @@ Attach to the container `id`
Query Parameters:
- **logs** 1/True/true or 0/False/false, return logs. Default false
- **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
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:
@ -974,30 +972,30 @@ Status Codes:
When using the TTY setting is enabled in
[`POST /containers/create`
](/reference/api/docker_remote_api_v1.9/#create-a-container "POST /containers/create"),
the stream is the raw data from the process PTY and client's stdin.
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.
`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).
The header contains the information which the stream writes (`stdout` or
`stderr`). It also contains the size of the associated frame encoded in the
last four bytes (`uint32`).
It is encoded on the first 8 bytes like this:
It is encoded on the first eight 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
- 0: `stdin` (is written on `stdout`)
- 1: `stdout`
- 2: `stderr`
`SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of
the uint32 size encoded as big endian.
`SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of
the `uint32` size encoded as big endian.
**PAYLOAD**
@ -1007,11 +1005,11 @@ Status Codes:
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 bytes
4. Read the extracted size and output it on the correct output
5. Goto 1
1. Read eight bytes.
2. Choose `stdout` or `stderr` depending on the first byte.
3. Extract the frame size from the last four bytes.
4. Read the extracted size and output it on the correct output.
5. Goto 1.
### Attach to a container (websocket)
@ -1031,15 +1029,15 @@ Implements websocket protocol handshake according to [RFC 6455](http://tools.iet
Query Parameters:
- **logs** 1/True/true or 0/False/false, return logs. Default false
- **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
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:
@ -1088,9 +1086,9 @@ Remove the container `id` from the filesystem
Query Parameters:
- **v** 1/True/true or 0/False/false, Remove the volumes
associated to the container. Default false
associated to the container. Default `false`.
- **force** - 1/True/true or 0/False/false, Kill then remove the container.
Default false
Default `false`.
Status Codes:
@ -1210,9 +1208,9 @@ references on the command line.
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:
- dangling=true
- label=`key` or `key=value` of an image label
- **filters** a JSON encoded value of the filters (a map[string][]string) to process on the images list. Available filters:
- `dangling=true`
- `label=key` or `key=value` of an image label
### Build image from a Dockerfile
@ -1235,43 +1233,43 @@ Build an image from a Dockerfile
{"stream": "..."}
{"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}}
The input stream must be a tar archive compressed with one of the
following algorithms: identity (no compression), gzip, bzip2, xz.
The input stream must be a `tar` archive compressed with one of the
following algorithms: `identity` (no compression), `gzip`, `bzip2`, `xz`.
The archive must include a build instructions file, typically called
`Dockerfile` at the root of the archive. The `dockerfile` parameter may be
used to specify a different build instructions file by having its value be
`Dockerfile` at the archive's root. The `dockerfile` parameter may be
used to specify a different build instructions file. To do this, its value must be
the path to the alternate build instructions file to use.
The archive may include any number of other files,
which will be accessible in the build context (See the [*ADD build
which are accessible in the build context (See the [*ADD build
command*](/reference/builder/#dockerbuilder)).
The build will also be canceled if the client drops the connection by quitting
The build is canceled if the client drops the connection by quitting
or being killed.
Query Parameters:
- **dockerfile** - path within the build context to the Dockerfile. This is
- **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
- **t** A repository name (and optionally a tag) to apply to
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`.
- **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
- **rm** - remove intermediate containers after a successful build (default behavior)
- **forcerm** - always remove intermediate containers (includes rm)
- **memory** - set memory limit for build
- **memswap** - Total memory (memory + swap), `-1` to disable swap
- **cpushares** - CPU shares (relative weight)
- **cpusetcpus** - CPUs in which to allow execution, e.g., `0-3`, `0,1`
- **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.
- **rm** - Remove intermediate containers after a successful build (default behavior).
- **forcerm** - Always remove intermediate containers (includes `rm`).
- **memory** - Set memory limit for build.
- **memswap** - Total memory (memory + swap), `-1` to disable swap.
- **cpushares** - CPU shares (relative weight).
- **cpusetcpus** - CPUs in which to allow execution (e.g., `0-3`, `0,1`).
Request Headers:
- **Content-type** should be set to `"application/tar"`.
- **Content-type** Set to `"application/tar"`.
- **X-Registry-Config** base64-encoded ConfigFile object
Status Codes:
@ -1283,7 +1281,7 @@ Status Codes:
`POST /images/create`
Create an image, either by pulling it from the registry or by importing it
Create an image either by pulling it from the registry or by importing it
**Example request**:
@ -1305,12 +1303,12 @@ Create an image, either by pulling it from the registry or by importing it
Query Parameters:
- **fromImage** name of the image to pull
- **fromSrc** source to import. The value may be a URL from which the image
- **fromImage** Name of the image to pull.
- **fromSrc** Source to import. The value may be a URL from which the image
can be retrieved or `-` to read the image from the request body.
- **repo** repository
- **tag** tag
- **registry** the registry to pull from
- **repo** Repository name.
- **tag** Tag.
- **registry** The registry to pull from.
Request Headers:
@ -1430,9 +1428,9 @@ Push the image `name` on the registry
{"error": "Invalid..."}
...
If you wish to push an image on to a private registry, that image must already have been tagged
into a repository which references that registry host name and port. This repository name should
then be used in the URL. This mirrors the flow of the CLI.
If you wish to push an image on to a private registry, that image must already have a tag
into a repository which references that registry `hostname` and `port`. This repository name should
then be used in the URL. This duplicates the command line's flow.
**Example request**:
@ -1441,11 +1439,11 @@ Push the image `name` on the registry
Query Parameters:
- **tag** the tag to associate with the image on the registry, optional
- **tag** The tag to associate with the image on the registry. This is optional.
Request Headers:
- **X-Registry-Auth** include a base64-encoded AuthConfig
- **X-Registry-Auth** Include a base64-encoded AuthConfig.
object.
Status Codes:
@ -1788,11 +1786,11 @@ Status Codes:
Get container events from docker, either in real time via streaming, or via
polling (using since).
Docker containers will report the following events:
Docker containers report the following events:
create, destroy, die, exec_create, exec_start, export, kill, oom, pause, restart, start, stop, unpause
and Docker images will report:
and Docker images report:
untag, delete
@ -1812,12 +1810,12 @@ and Docker images will report:
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:
- event=&lt;string&gt; -- event to filter
- image=&lt;string&gt; -- image to filter
- container=&lt;string&gt; -- container to filter
- **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:
- `event=<string>`; -- event to filter
- `image=<string>`; -- image to filter
- `container=<string>`; -- container to filter
Status Codes:
@ -1861,7 +1859,7 @@ Status Codes:
Get a tarball containing all images and metadata for one or more repositories.
For each value of the `names` parameter: if it is a specific name and tag (e.g.
ubuntu:latest), then only that image (and its parents) are returned; if it is
`ubuntu:latest`), then only that image (and its parents) are returned; if it is
an image ID, similarly only that image (and its parents) are returned and there
would be no names referenced in the 'repositories' file for this image ID.
@ -1887,7 +1885,7 @@ Status Codes:
`POST /images/load`
Load a set of images and tags into the docker repository.
Load a set of images and tags into a Docker repository.
See the [image tarball format](#image-tarball-format) for more details.
**Example request**
@ -1908,16 +1906,16 @@ Status Codes:
### Image tarball format
An image tarball contains one directory per image layer (named using its long ID),
each containing three files:
each containing these files:
1. `VERSION`: currently `1.0` - the file format version
2. `json`: detailed layer information, similar to `docker inspect layer_id`
3. `layer.tar`: A tarfile containing the filesystem changes in this layer
- `VERSION`: currently `1.0` - the file format version
- `json`: detailed layer information, similar to `docker inspect layer_id`
- `layer.tar`: A tarfile containing the filesystem changes in this layer
The `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories
The `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories
for storing attribute changes and deletions.
If the tarball defines a repository, there will also be a `repositories` file at
If the tarball defines a repository, the tarball should also include a `repositories` file at
the root that contains a list of repository and tag names mapped to layer IDs.
```
@ -1959,10 +1957,10 @@ Sets up an exec instance in a running container `id`
Json Parameters:
- **AttachStdin** - Boolean value, attaches to stdin of the exec command.
- **AttachStdout** - Boolean value, attaches to stdout of the exec command.
- **AttachStderr** - Boolean value, attaches to stderr of the exec command.
- **Tty** - Boolean value to allocate a pseudo-TTY
- **AttachStdin** - Boolean value, attaches to `stdin` of the `exec` command.
- **AttachStdout** - Boolean value, attaches to `stdout` of the `exec` command.
- **AttachStderr** - Boolean value, attaches to `stderr` of the `exec` command.
- **Tty** - Boolean value to allocate a pseudo-TTY.
- **Cmd** - Command to run specified as a string or an array of strings.
@ -1975,7 +1973,7 @@ Status Codes:
`POST /exec/(id)/start`
Starts a previously set up exec instance `id`. If `detach` is true, this API
Starts a previously set up `exec` instance `id`. If `detach` is true, this API
returns after starting the `exec` command. Otherwise, this API sets up an
interactive session with the `exec` command.
@ -1998,8 +1996,8 @@ interactive session with the `exec` command.
Json Parameters:
- **Detach** - Detach from the exec command
- **Tty** - Boolean value to allocate a pseudo-TTY
- **Detach** - Detach from the `exec` command.
- **Tty** - Boolean value to allocate a pseudo-TTY.
Status Codes:
@ -2013,8 +2011,8 @@ Status Codes:
`POST /exec/(id)/resize`
Resizes the tty session used by the exec command `id`.
This API is valid only if `tty` was specified as part of creating and starting the exec command.
Resizes the `tty` session used by the `exec` command `id`.
This API is valid only if `tty` was specified as part of creating and starting the `exec` command.
**Example request**:
@ -2028,7 +2026,7 @@ This API is valid only if `tty` was specified as part of creating and starting t
Query Parameters:
- **h** height of tty session
- **h** height of `tty` session
- **w** width
Status Codes:
@ -2040,7 +2038,7 @@ Status Codes:
`GET /exec/(id)/json`
Return low-level information about the exec command `id`.
Return low-level information about the `exec` command `id`.
**Example request**:
@ -2150,22 +2148,21 @@ As an example, the `docker run` command line makes the following API calls:
- Create the container
- If the status code is 404, it means the image doesn't exist:
- Try to pull it
- Then retry to create the container
- Try to pull it.
- Then, retry to create the container.
- Start the container
- Start the container.
- If you are not in detached mode:
- Attach to the container, using logs=1 (to have stdout and
stderr from the container's start) and stream=1
- Attach to the container, using `logs=1` (to have `stdout` and
`stderr` from the container's start) and `stream=1`
- If in detached mode or only stdin is attached:
- Display the container's id
- 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.
In this version of the API, `/attach`, uses hijacking to transport `stdin`,
`stdout`, and `stderr` on the same socket.
To hint potential proxies about connection hijacking, Docker client sends
connection upgrade headers similarly to websocket.
@ -2173,15 +2170,14 @@ connection upgrade headers similarly to websocket.
Upgrade: tcp
Connection: Upgrade
When Docker daemon detects the `Upgrade` header, it will switch its status code
from **200 OK** to **101 UPGRADED** and resend the same headers.
When Docker daemon detects the `Upgrade` header, it switches its status code
from **200 OK** to **101 UPGRADED** and resends the same headers.
This might change in the future.
## 3.3 CORS Requests
To set cross origin requests to the remote api please give values to
"--api-cors-header" when running docker in daemon mode. Set * will allow all,
`--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all,
default or blank means CORS disabled
$ docker -d -H="192.168.1.9:2375" --api-cors-header="http://foo.bar"