Download OpenAPI specification:Download
The Engine API is an HTTP API served by Docker Engine. It is the API the Docker client uses to communicate with the Engine, so everything the Docker client can do can be done with the API.
Most of the client's commands map directly to API endpoints (e.g. docker ps
is GET /containers/json
). The notable exception is running containers, which consists of several API calls.
The API uses standard HTTP status codes to indicate the success or failure of the API call. The body of the response will be JSON in the following format:
{
"message": "page not found"
}
The API is usually changed in each release of Docker, so API calls are versioned to ensure that clients don't break.
For Docker Engine 1.13, the API version is 1.25. To lock to this version, you prefix the URL with /v1.25
. For example, calling /info
is the same as calling /v1.25/info
.
Engine releases in the near future should support this version of the API, so your client will continue to work even if it is talking to a newer Engine.
In previous versions of Docker, it was possible to access the API without providing a version. This behaviour is now deprecated will be removed in a future version of Docker.
The API uses an open schema model, which means server may add extra properties to responses. Likewise, the server will ignore any extra query parameters and request body properties. When you write clients, you need to ignore additional properties in responses to ensure they do not break when talking to newer Docker daemons.
Authentication for registries is handled client side. The client has to send authentication details to various endpoints that need to communicate with registries, such as POST /images/(name)/push
. These are sent as X-Registry-Auth
header as a Base64 encoded (JSON) string with the following structure:
{
"username": "string",
"password": "string",
"email": "string",
"serveraddress": "string"
}
The serveraddress
is a domain/IP without a protocol. Throughout this structure, double quotes are required.
If you have already got an identity token from the /auth
endpoint, you can just pass this instead of credentials:
{
"identitytoken": "9cbaf023786cd7..."
}
all | boolean Default: false Return all containers. By default, only running containers are shown |
limit | integer Return this number of most recently created containers, including non-running ones. |
size | boolean Default: false Return the size of container as fields |
filters | string Filters to process on the container list, encoded as JSON (a Available filters:
|
[- {
- "Id": "8dfafdbc3a40",
- "Names": [
- "/boring_feynman"
], - "Image": "ubuntu:latest",
- "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82",
- "Command": "echo 1",
- "Created": 1367854155,
- "State": "Exited",
- "Status": "Exit 0",
- "Ports": [
- {
- "PrivatePort": 2222,
- "PublicPort": 3333,
- "Type": "tcp"
}
], - "Labels": {
- "com.example.vendor": "Acme",
- "com.example.license": "GPL",
- "com.example.version": "1.0"
}, - "SizeRw": 12288,
- "SizeRootFs": 0,
- "HostConfig": {
- "NetworkMode": "default"
}, - "NetworkSettings": {
- "Networks": {
- "bridge": {
- "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812",
- "EndpointID": "2cdc4edb1ded3631c81f57966563e5c8525b81121bb3706a9a9a3ae102711f3f",
- "Gateway": "172.17.0.1",
- "IPAddress": "172.17.0.2",
- "IPPrefixLen": 16,
- "IPv6Gateway": "",
- "GlobalIPv6Address": "",
- "GlobalIPv6PrefixLen": 0,
- "MacAddress": "02:42:ac:11:00:02"
}
}
}, - "Mounts": [
- {
- "Name": "fac362...80535",
- "Source": "/data",
- "Destination": "/data",
- "Driver": "local",
- "Mode": "ro,Z",
- "RW": false,
- "Propagation": ""
}
]
}, - {
- "Id": "9cd87474be90",
- "Names": [
- "/coolName"
], - "Image": "ubuntu:latest",
- "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82",
- "Command": "echo 222222",
- "Created": 1367854155,
- "State": "Exited",
- "Status": "Exit 0",
- "Ports": [ ],
- "Labels": { },
- "SizeRw": 12288,
- "SizeRootFs": 0,
- "HostConfig": {
- "NetworkMode": "default"
}, - "NetworkSettings": {
- "Networks": {
- "bridge": {
- "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812",
- "EndpointID": "88eaed7b37b38c2a3f0c4bc796494fdf51b270c2d22656412a2ca5d559a64d7a",
- "Gateway": "172.17.0.1",
- "IPAddress": "172.17.0.8",
- "IPPrefixLen": 16,
- "IPv6Gateway": "",
- "GlobalIPv6Address": "",
- "GlobalIPv6PrefixLen": 0,
- "MacAddress": "02:42:ac:11:00:08"
}
}
}, - "Mounts": [ ]
}, - {
- "Id": "3176a2479c92",
- "Names": [
- "/sleepy_dog"
], - "Image": "ubuntu:latest",
- "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82",
- "Command": "echo 3333333333333333",
- "Created": 1367854154,
- "State": "Exited",
- "Status": "Exit 0",
- "Ports": [ ],
- "Labels": { },
- "SizeRw": 12288,
- "SizeRootFs": 0,
- "HostConfig": {
- "NetworkMode": "default"
}, - "NetworkSettings": {
- "Networks": {
- "bridge": {
- "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812",
- "EndpointID": "8b27c041c30326d59cd6e6f510d4f8d1d570a228466f956edf7815508f78e30d",
- "Gateway": "172.17.0.1",
- "IPAddress": "172.17.0.6",
- "IPPrefixLen": 16,
- "IPv6Gateway": "",
- "GlobalIPv6Address": "",
- "GlobalIPv6PrefixLen": 0,
- "MacAddress": "02:42:ac:11:00:06"
}
}
}, - "Mounts": [ ]
}, - {
- "Id": "4cb07b47f9fb",
- "Names": [
- "/running_cat"
], - "Image": "ubuntu:latest",
- "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82",
- "Command": "echo 444444444444444444444444444444444",
- "Created": 1367854152,
- "State": "Exited",
- "Status": "Exit 0",
- "Ports": [ ],
- "Labels": { },
- "SizeRw": 12288,
- "SizeRootFs": 0,
- "HostConfig": {
- "NetworkMode": "default"
}, - "NetworkSettings": {
- "Networks": {
- "bridge": {
- "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812",
- "EndpointID": "d91c7b2f0644403d7ef3095985ea0e2370325cd2332ff3a3225c4247328e66e9",
- "Gateway": "172.17.0.1",
- "IPAddress": "172.17.0.5",
- "IPPrefixLen": 16,
- "IPv6Gateway": "",
- "GlobalIPv6Address": "",
- "GlobalIPv6PrefixLen": 0,
- "MacAddress": "02:42:ac:11:00:05"
}
}
}, - "Mounts": [ ]
}
]
name | string/?[a-zA-Z0-9_-]+ Assign the specified name to the container. Must match |
Container to create
Hostname | string The hostname to use for the container, as a valid RFC 1123 hostname. |
Domainname | string The domain name to use for the container. |
User | string The user that commands are run as inside the container. |
AttachStdin | boolean Default: false Whether to attach to |
AttachStdout | boolean Default: true Whether to attach to |
AttachStderr | boolean Default: true Whether to attach to |
object An object mapping ports to an empty object in the form:
| |
Tty | boolean Default: false Attach standard streams to a TTY, including |
OpenStdin | boolean Default: false Open |
StdinOnce | boolean Default: false Close |
Env | Array of strings A list of environment variables to set inside the container in the form |
Array of strings or string Command to run specified as a string or an array of strings. | |
object A test to perform to check that the container is healthy. | |
ArgsEscaped | boolean Command is already escaped (Windows only) |
Image | string The name of the image to use when creating the container |
object An object mapping mount point paths inside the container to empty objects. | |
WorkingDir | string The working directory for commands to run in. |
Array of strings or string The entry point for the container as a string or an array of strings. If the array consists of exactly one empty string ( | |
NetworkDisabled | boolean Disable networking for the container. |
MacAddress | string MAC address of the container. |
OnBuild | Array of strings
|
object User-defined key/value metadata. | |
StopSignal | string Default: "SIGTERM" Signal to stop a container as a string or unsigned integer. |
StopTimeout | integer Default: 10 Timeout to stop a container in seconds. |
Shell | Array of strings Shell for when |
object (HostConfig) Container configuration that depends on the host we are running on | |
object This container's networking configuration. |
{- "Hostname": "",
- "Domainname": "",
- "User": "",
- "AttachStdin": false,
- "AttachStdout": true,
- "AttachStderr": true,
- "Tty": false,
- "OpenStdin": false,
- "StdinOnce": false,
- "Env": [
- "FOO=bar",
- "BAZ=quux"
], - "Cmd": [
- "date"
], - "Entrypoint": "",
- "Image": "ubuntu",
- "Labels": {
- "com.example.vendor": "Acme",
- "com.example.license": "GPL",
- "com.example.version": "1.0"
}, - "Volumes": {
- "/volumes/data": { }
}, - "WorkingDir": "",
- "NetworkDisabled": false,
- "MacAddress": "12:34:56:78:9a:bc",
- "ExposedPorts": {
- "22/tcp": { }
}, - "StopSignal": "SIGTERM",
- "StopTimeout": 10,
- "HostConfig": {
- "Binds": [
- "/tmp:/tmp"
], - "Links": [
- "redis3:redis"
], - "Memory": 0,
- "MemorySwap": 0,
- "MemoryReservation": 0,
- "KernelMemory": 0,
- "NanoCpus": 500000,
- "CpuPercent": 80,
- "CpuShares": 512,
- "CpuPeriod": 100000,
- "CpuRealtimePeriod": 1000000,
- "CpuRealtimeRuntime": 10000,
- "CpuQuota": 50000,
- "CpusetCpus": "0,1",
- "CpusetMems": "0,1",
- "MaximumIOps": 0,
- "MaximumIOBps": 0,
- "BlkioWeight": 300,
- "BlkioWeightDevice": [
- { }
], - "BlkioDeviceReadBps": [
- { }
], - "BlkioDeviceReadIOps": [
- { }
], - "BlkioDeviceWriteBps": [
- { }
], - "BlkioDeviceWriteIOps": [
- { }
], - "MemorySwappiness": 60,
- "OomKillDisable": false,
- "OomScoreAdj": 500,
- "PidMode": "",
- "PidsLimit": -1,
- "PortBindings": {
- "22/tcp": [
- {
- "HostPort": "11022"
}
]
}, - "PublishAllPorts": false,
- "Privileged": false,
- "ReadonlyRootfs": false,
- "Dns": [
- "8.8.8.8"
], - "DnsOptions": [
- ""
], - "DnsSearch": [
- ""
], - "VolumesFrom": [
- "parent",
- "other:ro"
], - "CapAdd": [
- "NET_ADMIN"
], - "CapDrop": [
- "MKNOD"
], - "GroupAdd": [
- "newgroup"
], - "RestartPolicy": {
- "Name": "",
- "MaximumRetryCount": 0
}, - "AutoRemove": true,
- "NetworkMode": "bridge",
- "Devices": [ ],
- "Ulimits": [
- { }
], - "LogConfig": {
- "Type": "json-file",
- "Config": { }
}, - "SecurityOpt": [ ],
- "StorageOpt": { },
- "CgroupParent": "",
- "VolumeDriver": "",
- "ShmSize": 67108864
}, - "NetworkingConfig": {
- "EndpointsConfig": {
- "isolated_nw": {
- "IPAMConfig": {
- "IPv4Address": "172.20.30.33",
- "IPv6Address": "2001:db8:abcd::3033",
- "LinkLocalIPs": [
- "169.254.34.68",
- "fe80::3468"
]
}, - "Links": [
- "container_1",
- "container_2"
], - "Aliases": [
- "server_x",
- "server_y"
]
}
}
}
}
{- "Id": "e90e34656806",
- "Warnings": [ ]
}
Return low-level information about a container.
id required | string ID or name of the container |
size | boolean Default: false Return the size of container as fields |
{- "AppArmorProfile": "",
- "Args": [
- "-c",
- "exit 9"
], - "Config": {
- "AttachStderr": true,
- "AttachStdin": false,
- "AttachStdout": true,
- "Cmd": [
- "/bin/sh",
- "-c",
- "exit 9"
], - "Domainname": "",
- "Env": [
- "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
], - "Hostname": "ba033ac44011",
- "Image": "ubuntu",
- "Labels": {
- "com.example.vendor": "Acme",
- "com.example.license": "GPL",
- "com.example.version": "1.0"
}, - "MacAddress": "",
- "NetworkDisabled": false,
- "OpenStdin": false,
- "StdinOnce": false,
- "Tty": false,
- "User": "",
- "Volumes": {
- "/volumes/data": { }
}, - "WorkingDir": "",
- "StopSignal": "SIGTERM",
- "StopTimeout": 10
}, - "Created": "2015-01-06T15:47:31.485331387Z",
- "Driver": "overlay2",
- "HostConfig": {
- "MaximumIOps": 0,
- "MaximumIOBps": 0,
- "BlkioWeight": 0,
- "BlkioWeightDevice": [
- { }
], - "BlkioDeviceReadBps": [
- { }
], - "BlkioDeviceWriteBps": [
- { }
], - "BlkioDeviceReadIOps": [
- { }
], - "BlkioDeviceWriteIOps": [
- { }
], - "ContainerIDFile": "",
- "CpusetCpus": "",
- "CpusetMems": "",
- "CpuPercent": 80,
- "CpuShares": 0,
- "CpuPeriod": 100000,
- "CpuRealtimePeriod": 1000000,
- "CpuRealtimeRuntime": 10000,
- "Devices": [ ],
- "IpcMode": "",
- "Memory": 0,
- "MemorySwap": 0,
- "MemoryReservation": 0,
- "KernelMemory": 0,
- "OomKillDisable": false,
- "OomScoreAdj": 500,
- "NetworkMode": "bridge",
- "PidMode": "",
- "PortBindings": { },
- "Privileged": false,
- "ReadonlyRootfs": false,
- "PublishAllPorts": false,
- "RestartPolicy": {
- "MaximumRetryCount": 2,
- "Name": "on-failure"
}, - "LogConfig": {
- "Type": "json-file"
}, - "Sysctls": {
- "net.ipv4.ip_forward": "1"
}, - "Ulimits": [
- { }
], - "VolumeDriver": "",
- "ShmSize": 67108864
}, - "HostnamePath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname",
- "HostsPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts",
- "LogPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log",
- "Id": "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39",
- "Image": "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2",
- "MountLabel": "",
- "Name": "/boring_euclid",
- "NetworkSettings": {
- "Bridge": "",
- "SandboxID": "",
- "HairpinMode": false,
- "LinkLocalIPv6Address": "",
- "LinkLocalIPv6PrefixLen": 0,
- "SandboxKey": "",
- "SecondaryIPAddresses": null,
- "SecondaryIPv6Addresses": null,
- "EndpointID": "",
- "Gateway": "",
- "GlobalIPv6Address": "",
- "GlobalIPv6PrefixLen": 0,
- "IPAddress": "",
- "IPPrefixLen": 0,
- "IPv6Gateway": "",
- "MacAddress": "",
- "Networks": {
- "bridge": {
- "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812",
- "EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d",
- "Gateway": "172.17.0.1",
- "IPAddress": "172.17.0.2",
- "IPPrefixLen": 16,
- "IPv6Gateway": "",
- "GlobalIPv6Address": "",
- "GlobalIPv6PrefixLen": 0,
- "MacAddress": "02:42:ac:12:00:02"
}
}
}, - "Path": "/bin/sh",
- "ProcessLabel": "",
- "ResolvConfPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf",
- "RestartCount": 1,
- "State": {
- "Error": "",
- "ExitCode": 9,
- "FinishedAt": "2015-01-06T15:47:32.080254511Z",
- "OOMKilled": false,
- "Dead": false,
- "Paused": false,
- "Pid": 0,
- "Restarting": false,
- "Running": true,
- "StartedAt": "2015-01-06T15:47:32.072697474Z",
- "Status": "running"
}, - "Mounts": [
- {
- "Name": "fac362...80535",
- "Source": "/data",
- "Destination": "/data",
- "Driver": "local",
- "Mode": "ro,Z",
- "RW": false,
- "Propagation": ""
}
]
}
On Unix systems, this is done by running the ps
command. This endpoint is not supported on Windows.
id required | string ID or name of the container |
ps_args | string Default: "-ef" The arguments to pass to |
{- "Titles": [
- "UID",
- "PID",
- "PPID",
- "C",
- "STIME",
- "TTY",
- "TIME",
- "CMD"
], - "Processes": [
- [
- "root",
- "13642",
- "882",
- "0",
- "17:03",
- "pts/0",
- "00:00:00",
- "/bin/bash"
], - [
- "root",
- "13735",
- "13642",
- "0",
- "17:06",
- "pts/0",
- "00:00:00",
- "sleep 10"
]
]
}
Get stdout
and stderr
logs from a container.
Note: This endpoint works only for containers with the json-file
or journald
logging driver.
id required | string ID or name of the container |
follow | boolean Default: false Return the logs as a stream. This will return a |
stdout | boolean Default: false Return logs from |
stderr | boolean Default: false Return logs from |
since | integer Default: 0 Only return logs since this time, as a UNIX timestamp |
timestamps | boolean Default: false Add timestamps to every log line |
tail | string Default: "all" Only return this number of log lines from the end of the logs. Specify as an integer or |
"string"
Returns which files in a container's filesystem have been added, deleted, or modified. The Kind
of modification can be one of:
0
: Modified1
: Added2
: Deletedid required | string ID or name of the container |
[- {
- "Path": "/dev",
- "Kind": 0
}, - {
- "Path": "/dev/kmsg",
- "Kind": 1
}, - {
- "Path": "/test",
- "Kind": 1
}
]
This endpoint returns a live stream of a container’s resource usage statistics.
The precpu_stats
is the CPU statistic of last read, which is used for calculating the CPU usage percentage. It is not the same as the cpu_stats
field.
id required | string ID or name of the container |
stream | boolean Default: true Stream the output. If false, the stats will be output once and then it will disconnect. |
{- "read": "2015-01-08T22:57:31.547920715Z",
- "pids_stats": {
- "current": 3
}, - "networks": {
- "eth0": {
- "rx_bytes": 5338,
- "rx_dropped": 0,
- "rx_errors": 0,
- "rx_packets": 36,
- "tx_bytes": 648,
- "tx_dropped": 0,
- "tx_errors": 0,
- "tx_packets": 8
}, - "eth5": {
- "rx_bytes": 4641,
- "rx_dropped": 0,
- "rx_errors": 0,
- "rx_packets": 26,
- "tx_bytes": 690,
- "tx_dropped": 0,
- "tx_errors": 0,
- "tx_packets": 9
}
}, - "memory_stats": {
- "stats": {
- "total_pgmajfault": 0,
- "cache": 0,
- "mapped_file": 0,
- "total_inactive_file": 0,
- "pgpgout": 414,
- "rss": 6537216,
- "total_mapped_file": 0,
- "writeback": 0,
- "unevictable": 0,
- "pgpgin": 477,
- "total_unevictable": 0,
- "pgmajfault": 0,
- "total_rss": 6537216,
- "total_rss_huge": 6291456,
- "total_writeback": 0,
- "total_inactive_anon": 0,
- "rss_huge": 6291456,
- "hierarchical_memory_limit": 67108864,
- "total_pgfault": 964,
- "total_active_file": 0,
- "active_anon": 6537216,
- "total_active_anon": 6537216,
- "total_pgpgout": 414,
- "total_cache": 0,
- "inactive_anon": 0,
- "active_file": 0,
- "pgfault": 964,
- "inactive_file": 0,
- "total_pgpgin": 477
}, - "max_usage": 6651904,
- "usage": 6537216,
- "failcnt": 0,
- "limit": 67108864
}, - "blkio_stats": { },
- "cpu_stats": {
- "cpu_usage": {
- "percpu_usage": [
- 8646879,
- 24472255,
- 36438778,
- 30657443
], - "usage_in_usermode": 50000000,
- "total_usage": 100215355,
- "usage_in_kernelmode": 30000000
}, - "system_cpu_usage": 739306590000000,
- "throttling_data": {
- "periods": 0,
- "throttled_periods": 0,
- "throttled_time": 0
}
}, - "precpu_stats": {
- "cpu_usage": {
- "percpu_usage": [
- 8646879,
- 24350896,
- 36438778,
- 30657443
], - "usage_in_usermode": 50000000,
- "total_usage": 100093996,
- "usage_in_kernelmode": 30000000
}, - "system_cpu_usage": 9492140000000,
- "throttling_data": {
- "periods": 0,
- "throttled_periods": 0,
- "throttled_time": 0
}
}
}
Resize the TTY for a container. You must restart the container for the resize to take effect.
id required | string ID or name of the container |
h required | integer Height of the tty session in characters |
w required | integer Width of the tty session in characters |
id required | string ID or name of the container |
detachKeys | string Override the key sequence for detaching a container. Format is a single character |
{- "message": "Something went wrong."
}
Send a POSIX signal to a container, defaulting to killing to the container.
id required | string ID or name of the container |
signal | string Default: "SIGKILL" Signal to send to the container as an integer or string (e.g. |
{- "message": "No such container: c2ada9df5af8"
}
Change various configuration options of a container without having to recreate it.
id required | string ID or name of the container |
CpuShares | integer An integer value representing this container's relative CPU weight versus other containers. |
Memory | integer Default: 0 Memory limit in bytes. |
CgroupParent | string Path to |
BlkioWeight | integer [ 0 .. 1000 ] Block IO weight (relative weight). |
Array of objects Block IO weight (relative device weight) in the form | |
Array of objects (ThrottleDevice) Limit read rate (bytes per second) from a device, in the form | |
Array of objects (ThrottleDevice) Limit write rate (bytes per second) to a device, in the form | |
Array of objects (ThrottleDevice) Limit read rate (IO per second) from a device, in the form | |
Array of objects (ThrottleDevice) Limit write rate (IO per second) to a device, in the form | |
CpuPeriod | integer <int64> The length of a CPU period in microseconds. |
CpuQuota | integer <int64> Microseconds of CPU time that the container can get in a CPU period. |
CpuRealtimePeriod | integer <int64> The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks. |
CpuRealtimeRuntime | integer <int64> The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks. |
CpusetCpus | string CPUs in which to allow execution (e.g., |
CpusetMems | string Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. |
Array of objects (DeviceMapping) A list of devices to add to the container. | |
DiskQuota | integer <int64> Disk limit (in bytes). |
KernelMemory | integer <int64> Kernel memory limit in bytes. |
MemoryReservation | integer <int64> Memory soft limit in bytes. |
MemorySwap | integer <int64> Total memory limit (memory + swap). Set as |
MemorySwappiness | integer <int64> [ 0 .. 100 ] Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. |
NanoCpus | integer <int64> CPU quota in units of 10-9 CPUs. |
OomKillDisable | boolean Disable OOM Killer for the container. |
PidsLimit | integer <int64> Tune a container's pids limit. Set -1 for unlimited. |
Array of objects A list of resource limits to set in the container. For example: | |
CpuCount | integer <int64> The number of usable CPUs (Windows only). On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is |
CpuPercent | integer <int64> The usable percentage of the available CPUs (Windows only). On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is |
IOMaximumIOps | integer <int64> Maximum IOps for the container system drive (Windows only) |
IOMaximumBandwidth | integer <int64> Maximum IO in bytes per second for the container system drive (Windows only) |
object (RestartPolicy) Default: {} The behavior to apply when the container exits. The default is not to restart. An ever increasing delay (double the previous delay, starting at 100ms) is added before each restart to prevent flooding the server. |
{- "BlkioWeight": 300,
- "CpuShares": 512,
- "CpuPeriod": 100000,
- "CpuQuota": 50000,
- "CpuRealtimePeriod": 1000000,
- "CpuRealtimeRuntime": 10000,
- "CpusetCpus": "0,1",
- "CpusetMems": "0",
- "Memory": 314572800,
- "MemorySwap": 514288000,
- "MemoryReservation": 209715200,
- "KernelMemory": 52428800,
- "RestartPolicy": {
- "MaximumRetryCount": 4,
- "Name": "on-failure"
}
}
{- "Warnings": [
- "string"
]
}
Use the cgroups freezer to suspend all processes in a container.
Traditionally, when suspending a process the SIGSTOP
signal is used, which is observable by the process being suspended. With the cgroups freezer the process is unaware, and unable to capture, that it is being suspended, and subsequently resumed.
id required | string ID or name of the container |
{- "message": "No such container: c2ada9df5af8"
}
Attach to a container to read its output or send it input. You can attach to the same container multiple times and you can reattach to containers that have been detached.
Either the stream
or logs
parameter must be true
for this endpoint to do anything.
See the documentation for the docker attach
command for more details.
This endpoint hijacks the HTTP connection to transport stdin
, stdout
, and stderr
on the same socket.
This is the response from the daemon for an attach request:
HTTP/1.1 200 OK
Content-Type: application/vnd.docker.raw-stream
[STREAM]
After the headers and two new lines, the TCP connection can now be used for raw, bidirectional communication between the client and server.
To hint potential proxies about connection hijacking, the Docker client can also optionally send connection upgrade headers.
For example, the client sends this request to upgrade the connection:
POST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1
Upgrade: tcp
Connection: Upgrade
The Docker daemon will respond with a 101 UPGRADED
response, and will similarly follow with the raw stream:
HTTP/1.1 101 UPGRADED
Content-Type: application/vnd.docker.raw-stream
Connection: Upgrade
Upgrade: tcp
[STREAM]
When the TTY setting is disabled in POST /containers/create
, the stream over the hijacked connected is multiplexed to separate out stdout
and stderr
. The stream consists of a series of frames, each containing a header and a payload.
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 eight bytes like this:
header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}
STREAM_TYPE
can be:
stdin
(is written on stdout
)stdout
stderr
SIZE1, SIZE2, SIZE3, SIZE4
are the four bytes of the uint32
size encoded as big endian.
Following the header is the payload, which is the specified number of bytes of STREAM_TYPE
.
The simplest way to implement this protocol is the following:
stdout
or stderr
depending on the first byte.When the TTY setting is enabled in POST /containers/create
, the stream is not multiplexed. The data exchanged over the hijacked connection is simply the raw data from the process PTY and client's stdin
.
id required | string ID or name of the container |
detachKeys | string Override the key sequence for detaching a container.Format is a single character |
logs | boolean Default: false Replay previous logs from the container. This is useful for attaching to a container that has started and you want to output everything since the container started. If |
stream | boolean Default: false Stream attached streams from the time the request was made onwards |
stdin | boolean Default: false Attach to |
stdout | boolean Default: false Attach to |
stderr | boolean Default: false Attach to |
id required | string ID or name of the container |
detachKeys | string Override the key sequence for detaching a container.Format is a single character |
logs | boolean Default: false Return logs |
stream | boolean Default: false Return stream |
{- "message": "Something went wrong."
}
id required | string ID or name of the container |
v | boolean Default: false Remove anonymous volumes associated with the container. |
force | boolean Default: false If the container is running, kill it before removing it. |
{- "message": "Something went wrong."
}
A response header X-Docker-Container-Path-Stat
is return containing a base64 - encoded JSON object with some filesystem header information about the path.
id required | string ID or name of the container |
path required | string Resource in the container’s filesystem to archive. |
{- "message": "Something went wrong."
}
Get an tar archive of a resource in the filesystem of container id.
id required | string ID or name of the container |
path required | string Resource in the container’s filesystem to archive. |
Upload a tar archive to be extracted to a path in the filesystem of container id.
path
parameter is asserted to be a directory. If it exists as a file, 400 error
will be returned with message "not a directory".
id required | string ID or name of the container |
path required | string Path to a directory in the container to extract the archive’s contents into. |
noOverwriteDirNonDir | string If “1”, “true”, or “True” then it will be an error if unpacking the given content would cause an existing directory to be replaced with a non-directory and vice versa. |
The input stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz.
{- "message": "not a directory"
}
Returns a list of images on the server. Note that it uses a different, smaller representation of an image than inspecting a single image.
all | boolean Default: false Show all images. Only images from a final layer (no children) are shown by default. |
filters | string A JSON encoded value of the filters (a Available filters:
|
digests | boolean Default: false Show digest information as a |
[- {
- "Id": "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8",
- "ParentId": "",
- "RepoTags": [
- "ubuntu:12.04",
- "ubuntu:precise"
], - "RepoDigests": [
- "ubuntu@sha256:992069aee4016783df6345315302fa59681aae51a8eeb2f889dea59290f21787"
], - "Created": 1474925151,
- "Size": 103579269,
- "VirtualSize": 103579269,
- "SharedSize": 0,
- "Labels": { },
- "Containers": 2
}, - {
- "Id": "sha256:3e314f95dcace0f5e4fd37b10862fe8398e3c60ed36600bc0ca5fda78b087175",
- "ParentId": "",
- "RepoTags": [
- "ubuntu:12.10",
- "ubuntu:quantal"
], - "RepoDigests": [
- "ubuntu@sha256:002fba3e3255af10be97ea26e476692a7ebed0bb074a9ab960b2e7a1526b15d7",
- "ubuntu@sha256:68ea0200f0b90df725d99d823905b04cf844f6039ef60c60bf3e019915017bd3"
], - "Created": 1403128455,
- "Size": 172064416,
- "VirtualSize": 172064416,
- "SharedSize": 0,
- "Labels": { },
- "Containers": 5
}
]
Build an image from a tar archive with a Dockerfile
in it.
The Dockerfile
specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the dockerfile
parameter. See the Dockerfile
reference for more information.
The Docker daemon performs a preliminary validation of the Dockerfile
before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output.
The build is canceled if the client drops the connection by quitting or being killed.
dockerfile | string Default: "Dockerfile" Path within the build context to the |
t | string A name and optional tag to apply to the image in the |
remote | string A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single text file, the file’s contents are placed into a file called |
q | boolean Default: false Suppress verbose build output. |
nocache | boolean Default: false Do not use the cache when building the image. |
cachefrom | string JSON array of images used for build cache resolution. |
pull | string Attempt to pull the image even if an older image exists locally. |
rm | boolean Default: true Remove intermediate containers after a successful build. |
forcerm | boolean Default: false Always remove intermediate containers, even upon failure. |
memory | integer Set memory limit for build. |
memswap | integer Total memory (memory + swap). Set as |
cpushares | integer CPU shares (relative weight). |
cpusetcpus | string CPUs in which to allow execution (e.g., |
cpuperiod | integer The length of a CPU period in microseconds. |
cpuquota | integer Microseconds of CPU time that the container can get in a CPU period. |
buildargs | integer JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for commands run via the |
shmsize | integer Size of |
squash | boolean Squash the resulting images layers into a single layer. (Experimental release only.) |
labels | string Arbitrary key/value labels to set on the image, as a JSON map of string pairs. |
networkmode | string Sets the networking mode for the run commands during build. Supported standard values are: |
Content-type | string Default: application/tar Value: "application/tar" |
X-Registry-Config | string This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to. The key is a registry URL, and the value is an auth configuration object, as described in the authentication section. For example:
Only the registry domain name (and port if not the default 443) are required. However, for legacy reasons, the Docker Hub registry must be specified with both a |
A tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz.
{- "message": "Something went wrong."
}
Create an image by either pulling it from a registry or importing it.
fromImage | string Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed. |
fromSrc | string Source to import. The value may be a URL from which the image can be retrieved or |
repo | string Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image. |
tag | string Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled. |
X-Registry-Auth | string A base64-encoded auth configuration. See the authentication section for details. |
Image content if the value -
has been specified in fromSrc query parameter
{- "message": "Something went wrong."
}
Return low-level information about an image.
name required | string Image name or id |
{- "Id": "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c",
- "Container": "cb91e48a60d01f1e27028b4fc6819f4f290b3cf12496c8176ec714d0d390984a",
- "Comment": "",
- "Os": "linux",
- "Architecture": "amd64",
- "Parent": "sha256:91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c",
- "ContainerConfig": {
- "Tty": false,
- "Hostname": "e611e15f9c9d",
- "Domainname": "",
- "AttachStdout": false,
- "PublishService": "",
- "AttachStdin": false,
- "OpenStdin": false,
- "StdinOnce": false,
- "NetworkDisabled": false,
- "OnBuild": [ ],
- "Image": "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c",
- "User": "",
- "WorkingDir": "",
- "MacAddress": "",
- "AttachStderr": false,
- "Labels": {
- "com.example.license": "GPL",
- "com.example.version": "1.0",
- "com.example.vendor": "Acme"
}, - "Env": [
- "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
], - "Cmd": [
- "/bin/sh",
- "-c",
- "#(nop) LABEL com.example.vendor=Acme com.example.license=GPL com.example.version=1.0"
]
}, - "DockerVersion": "1.9.0-dev",
- "VirtualSize": 188359297,
- "Size": 0,
- "Author": "",
- "Created": "2015-09-10T08:30:53.26995814Z",
- "GraphDriver": {
- "Name": "aufs"
}, - "RepoDigests": [
- "localhost:5000/test/busybox/example@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf"
], - "RepoTags": [
- "example:1.0",
- "example:latest",
- "example:stable"
], - "Config": {
- "Image": "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c",
- "NetworkDisabled": false,
- "OnBuild": [ ],
- "StdinOnce": false,
- "PublishService": "",
- "AttachStdin": false,
- "OpenStdin": false,
- "Domainname": "",
- "AttachStdout": false,
- "Tty": false,
- "Hostname": "e611e15f9c9d",
- "Cmd": [
- "/bin/bash"
], - "Env": [
- "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
], - "Labels": {
- "com.example.vendor": "Acme",
- "com.example.version": "1.0",
- "com.example.license": "GPL"
}, - "MacAddress": "",
- "AttachStderr": false,
- "WorkingDir": "",
- "User": ""
}, - "RootFS": {
- "Type": "layers",
- "Layers": [
- "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6",
- "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef"
]
}
}
Return parent layers of an image.
name required | string Image name or ID |
[- {
- "Id": "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710",
- "Created": 1398108230,
- "CreatedBy": "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /",
- "Tags": [
- "ubuntu:lucid",
- "ubuntu:10.04"
], - "Size": 182964289,
- "Comment": ""
}, - {
- "Id": "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8",
- "Created": 1398108222,
- "CreatedBy": "/bin/sh -c #(nop) MAINTAINER Tianon Gravi <admwiggin@gmail.com> - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/",
- "Tags": [ ],
- "Size": 0,
- "Comment": ""
}, - {
- "Id": "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158",
- "Created": 1371157430,
- "CreatedBy": "",
- "Tags": [
- "scratch12:latest",
- "scratch:latest"
], - "Size": 0,
- "Comment": "Imported from -"
}
]
Push an image to a registry.
If you wish to push an image on to a private registry, that image must already have a tag which references the registry. For example, registry.example.com/myimage:latest
.
The push is cancelled if the HTTP connection is closed.
name required | string Name of the image to push. For example, The name should be provided without tag; if a tag is provided, it
is ignored. For example, Use the |
tag | string Tag of the image to push. For example, |
X-Registry-Auth required | string A base64-encoded auth configuration. See the authentication section for details. |
{- "message": "Something went wrong."
}
Tag an image so that it becomes part of a repository.
name required | string Image name or ID to tag. |
repo | string The repository to tag in. For example, |
tag | string The name of the new tag. |
{- "message": "Something went wrong."
}
Remove an image, along with any untagged parent images that were referenced by that image.
Images can't be removed if they have descendant images, are being used by a running container or are being used by a build.
name required | string Image name or ID |
force | boolean Default: false Remove the image even if it is being used by stopped containers or has other tags |
noprune | boolean Default: false Do not delete untagged parent images |
[- {
- "Untagged": "3e2f21a89f"
}, - {
- "Deleted": "3e2f21a89f"
}, - {
- "Deleted": "53b4f83ac9"
}
]
Search for an image on Docker Hub.
term required | string Term to search |
limit | integer Maximum number of results to return |
filters | string A JSON encoded value of the filters (a
|
[- {
- "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
}
]
filters | string Filters to process on the prune list, encoded as JSON (a Available filters:
|
{- "ImagesDeleted": [
- {
- "Untagged": "string",
- "Deleted": "string"
}
], - "SpaceReclaimed": 0
}
container | string The ID or name of the container to commit |
repo | string Repository name for the created image |
tag | string Tag name for the create image |
comment | string Commit message |
author | string Author of the image (e.g., |
pause | boolean Default: true Whether to pause the container before committing |
changes | string
|
The container configuration
Hostname | string The hostname to use for the container, as a valid RFC 1123 hostname. |
Domainname | string The domain name to use for the container. |
User | string The user that commands are run as inside the container. |
AttachStdin | boolean Default: false Whether to attach to |
AttachStdout | boolean Default: true Whether to attach to |
AttachStderr | boolean Default: true Whether to attach to |
object An object mapping ports to an empty object in the form:
| |
Tty | boolean Default: false Attach standard streams to a TTY, including |
OpenStdin | boolean Default: false Open |
StdinOnce | boolean Default: false Close |
Env | Array of strings A list of environment variables to set inside the container in the form |
Array of strings or string Command to run specified as a string or an array of strings. | |
object A test to perform to check that the container is healthy. | |
ArgsEscaped | boolean Command is already escaped (Windows only) |
Image | string The name of the image to use when creating the container |
object An object mapping mount point paths inside the container to empty objects. | |
WorkingDir | string The working directory for commands to run in. |
Array of strings or string The entry point for the container as a string or an array of strings. If the array consists of exactly one empty string ( | |
NetworkDisabled | boolean Disable networking for the container. |
MacAddress | string MAC address of the container. |
OnBuild | Array of strings
|
object User-defined key/value metadata. | |
StopSignal | string Default: "SIGTERM" Signal to stop a container as a string or unsigned integer. |
StopTimeout | integer Default: 10 Timeout to stop a container in seconds. |
Shell | Array of strings Shell for when |
{- "Hostname": "string",
- "Domainname": "string",
- "User": "string",
- "AttachStdin": false,
- "AttachStdout": true,
- "AttachStderr": true,
- "ExposedPorts": {
- "property1": { },
- "property2": { }
}, - "Tty": false,
- "OpenStdin": false,
- "StdinOnce": false,
- "Env": [
- "string"
], - "Cmd": [
- null
], - "Healthcheck": {
- "Test": [
- "string"
], - "Interval": 0,
- "Timeout": 0,
- "Retries": 0
}, - "ArgsEscaped": true,
- "Image": "string",
- "Volumes": {
- "additionalProperties": { }
}, - "WorkingDir": "string",
- "Entrypoint": [
- null
], - "NetworkDisabled": true,
- "MacAddress": "string",
- "OnBuild": [
- "string"
], - "Labels": {
- "property1": "string",
- "property2": "string"
}, - "StopSignal": "SIGTERM",
- "StopTimeout": 10,
- "Shell": [
- "string"
]
}
{- "Id": "string"
}
Get a tarball containing all images and metadata for a repository.
If name
is a specific name and tag (e.g. ubuntu:latest
), then only that image (and its parents) are returned. If name
is an image ID, similarly only that image (and its parents) are returned, but with the exclusion of the repositories
file in the tarball, as there were no image names referenced.
An image tarball contains one directory per image layer (named using its long ID), each containing these files:
VERSION
: currently 1.0
- the file format versionjson
: detailed layer information, similar to docker inspect layer_id
layer.tar
: A tarfile containing the filesystem changes in this layerThe layer.tar
file contains aufs
style .wh..wh.aufs
files and directories for storing attribute changes and deletions.
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.
{
"hello-world": {
"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"
}
}
name required | string Image name or ID |
Get a tarball containing all images and metadata for several image 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 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.
For details on the format, see the export image endpoint.
names | Array of strings Image names to filter by |
Load a set of images and tags into a repository.
For details on the format, see the export image endpoint.
quiet | boolean Default: false Suppress progress details during load. |
Tar archive containing images
{- "message": "Something went wrong."
}
Networks are user-defined networks that containers can be attached to. See the networking documentation for more information.
filters | string JSON encoded value of the filters (a
|
[- {
- "Name": "bridge",
- "Id": "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566",
- "Created": "2016-10-19T06:21:00.416543526Z",
- "Scope": "local",
- "Driver": "bridge",
- "EnableIPv6": false,
- "Internal": false,
- "IPAM": {
- "Driver": "default",
- "Config": [
- {
- "Subnet": "172.17.0.0/16"
}
]
}, - "Containers": {
- "39b69226f9d79f5634485fb236a23b2fe4e96a0a94128390a7fbbcc167065867": {
- "EndpointID": "ed2419a97c1d9954d05b46e462e7002ea552f216e9b136b80a7db8d98b442eda",
- "MacAddress": "02:42:ac:11:00:02",
- "IPv4Address": "172.17.0.2/16",
- "IPv6Address": ""
}
}, - "Options": {
- "com.docker.network.bridge.default_bridge": "true",
- "com.docker.network.bridge.enable_icc": "true",
- "com.docker.network.bridge.enable_ip_masquerade": "true",
- "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
- "com.docker.network.bridge.name": "docker0",
- "com.docker.network.driver.mtu": "1500"
}
}, - {
- "Name": "none",
- "Id": "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794",
- "Created": "0001-01-01T00:00:00Z",
- "Scope": "local",
- "Driver": "null",
- "EnableIPv6": false,
- "Internal": false,
- "IPAM": {
- "Driver": "default",
- "Config": [ ]
}, - "Containers": { },
- "Options": { }
}, - {
- "Name": "host",
- "Id": "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e",
- "Created": "0001-01-01T00:00:00Z",
- "Scope": "local",
- "Driver": "host",
- "EnableIPv6": false,
- "Internal": false,
- "IPAM": {
- "Driver": "default",
- "Config": [ ]
}, - "Containers": { },
- "Options": { }
}
]
{- "Name": "net01",
- "Id": "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99",
- "Created": "2016-10-19T04:33:30.360899459Z",
- "Scope": "local",
- "Driver": "bridge",
- "EnableIPv6": false,
- "IPAM": {
- "Driver": "default",
- "Config": [
- {
- "Subnet": "172.19.0.0/16",
- "Gateway": "172.19.0.1"
}
], - "Options": {
- "foo": "bar"
}
}, - "Internal": false,
- "Containers": {
- "19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c": {
- "Name": "test",
- "EndpointID": "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a",
- "MacAddress": "02:42:ac:13:00:02",
- "IPv4Address": "172.19.0.2/16",
- "IPv6Address": ""
}
}, - "Options": {
- "com.docker.network.bridge.default_bridge": "true",
- "com.docker.network.bridge.enable_icc": "true",
- "com.docker.network.bridge.enable_ip_masquerade": "true",
- "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
- "com.docker.network.bridge.name": "docker0",
- "com.docker.network.driver.mtu": "1500"
}, - "Labels": {
- "com.example.some-label": "some-value",
- "com.example.some-other-label": "some-other-value"
}
}
Network configuration
Name required | string The network's name. |
CheckDuplicate | boolean Check for networks with duplicate names. |
Driver | string Default: "bridge" Name of the network driver plugin to use. |
Internal | boolean Restrict external access to the network. |
object (IPAM) | |
EnableIPv6 | boolean Enable IPv6 on the network. |
object Network specific options to be used by the drivers. | |
object User-defined key/value metadata. |
{- "Name": "isolated_nw",
- "CheckDuplicate": false,
- "Driver": "bridge",
- "EnableIPv6": true,
- "IPAM": {
- "Driver": "default",
- "Config": [
- {
- "Subnet": "172.20.0.0/16",
- "IPRange": "172.20.10.0/24",
- "Gateway": "172.20.10.11"
}, - {
- "Subnet": "2001:db8:abcd::/64",
- "Gateway": "2001:db8:abcd::1011"
}
], - "Options": {
- "foo": "bar"
}
}, - "Internal": true,
- "Options": {
- "com.docker.network.bridge.default_bridge": "true",
- "com.docker.network.bridge.enable_icc": "true",
- "com.docker.network.bridge.enable_ip_masquerade": "true",
- "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
- "com.docker.network.bridge.name": "docker0",
- "com.docker.network.driver.mtu": "1500"
}, - "Labels": {
- "com.example.some-label": "some-value",
- "com.example.some-other-label": "some-other-value"
}
}
{- "Id": "22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30",
- "Warning": ""
}
id required | string Network ID or name |
Container | string The ID or name of the container to connect to the network. |
object (EndpointSettings) Configuration for a network endpoint. |
{- "message": "Something went wrong."
}
id required | string Network ID or name |
Container | string The ID or name of the container to disconnect from the network. |
Force | boolean Force the container to disconnect from the network. |
{- "Container": "string",
- "Force": true
}
{- "message": "Something went wrong."
}
filters | string <json> JSON encoded value of the filters (a
|
{- "Volumes": [
- {
- "Name": "tardis",
- "Driver": "local",
- "Mountpoint": "/var/lib/docker/volumes/tardis",
- "Labels": {
- "com.example.some-label": "some-value",
- "com.example.some-other-label": "some-other-value"
}, - "Scope": "local",
- "Options": {
- "device": "tmpfs",
- "o": "size=100m,uid=1000",
- "type": "tmpfs"
}
}
], - "Warnings": [ ]
}
Volume configuration
Name | string The new volume's name. If not specified, Docker generates a name. |
Driver | string Default: "local" Name of the volume driver to use. |
object A mapping of driver options and values. These options are passed directly to the driver and are driver specific. | |
object User-defined key/value metadata. |
{- "Name": "tardis",
- "Labels": {
- "com.example.some-label": "some-value",
- "com.example.some-other-label": "some-other-value"
}, - "Driver": "custom"
}
{- "Name": "tardis",
- "Driver": "custom",
- "Mountpoint": "/var/lib/docker/volumes/tardis",
- "Status": {
- "hello": "world"
}, - "Labels": {
- "com.example.some-label": "some-value",
- "com.example.some-other-label": "some-other-value"
}, - "Scope": "local"
}
{- "Name": "tardis",
- "Driver": "custom",
- "Mountpoint": "/var/lib/docker/volumes/tardis",
- "Status": {
- "hello": "world"
}, - "Labels": {
- "com.example.some-label": "some-value",
- "com.example.some-other-label": "some-other-value"
}, - "Scope": "local"
}
Run new commands inside running containers. See the command-line reference for more information.
To exec a command in a container, you first need to create an exec instance, then start it. These two API endpoints are wrapped up in a single command-line command, docker exec
.
Run a command inside a running container.
id required | string ID or name of container |
Exec configuration
AttachStdin | boolean Attach to |
AttachStdout | boolean Attach to |
AttachStderr | boolean Attach to |
DetachKeys | string Override the key sequence for detaching a container. Format is a single character |
Tty | boolean Allocate a pseudo-TTY. |
Env | Array of strings A list of environment variables in the form |
Cmd | Array of strings Command to run, as a string or array of strings. |
Privileged | boolean Default: false Runs the exec process with extended privileges. |
User | string The user, and optionally, group to run the exec process inside the container. Format is one of: |
{- "AttachStdin": false,
- "AttachStdout": true,
- "AttachStderr": true,
- "DetachKeys": "ctrl-p,ctrl-q",
- "Tty": false,
- "Cmd": [
- "date"
], - "Env": [
- "FOO=bar",
- "BAZ=quux"
]
}
{- "Id": "string"
}
Starts a previously set up exec instance. If detach is true, this endpoint returns immediately after starting the command. Otherwise, it sets up an interactive session with the command.
id required | string Exec instance ID |
Detach | boolean Detach from the command. |
Tty | boolean Allocate a pseudo-TTY. |
{- "Detach": false,
- "Tty": false
}
Resize the TTY session used by an exec instance. This endpoint only works if tty
was specified as part of creating and starting the exec instance.
id required | string Exec instance ID |
h required | integer Height of the TTY session in characters |
w required | integer Width of the TTY session in characters |
{- "message": "Something went wrong."
}
Return low-level information about an exec instance.
id required | string Exec instance ID |
{- "CanRemove": false,
- "ContainerID": "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126",
- "DetachKeys": "",
- "ExitCode": 2,
- "ID": "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b",
- "OpenStderr": true,
- "OpenStdin": true,
- "OpenStdout": true,
- "ProcessConfig": {
- "arguments": [
- "-c",
- "exit 2"
], - "entrypoint": "sh",
- "privileged": false,
- "tty": true,
- "user": "1000"
}, - "Running": false,
- "Pid": 42000
}
filters | string A JSON encoded value of the filters (a
|
[- {
- "ID": "ktnbjxoalbkvbvedmg1urrz8h",
- "Version": {
- "Index": 11
}, - "CreatedAt": "2016-11-05T01:20:17.327670065Z",
- "UpdatedAt": "2016-11-05T01:20:17.327670065Z",
- "Spec": {
- "Name": "app-dev.crt"
}
}
]
Name | string User-defined name of the secret. |
object User-defined key/value metadata. | |
Data | Array of strings Base64-url-safe-encoded secret data |
{- "Name": "app-key.crt",
- "Labels": {
- "property1": "string",
- "property2": "string",
- "foo": "bar"
}, - "Data": "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg=="
}
{- "ID": "ktnbjxoalbkvbvedmg1urrz8h"
}
{- "ID": "string",
- "Version": {
- "Index": 0
}, - "CreatedAt": "string",
- "UpdatedAt": "string",
- "Spec": {
- "Name": "string",
- "Labels": {
- "property1": "string",
- "property2": "string"
}, - "TaskTemplate": {
- "ContainerSpec": {
- "Image": "string",
- "Command": [
- "string"
], - "Args": [
- "string"
], - "Env": [
- "string"
], - "Dir": "string",
- "User": "string",
- "Labels": {
- "property1": "string",
- "property2": "string"
}, - "TTY": true,
- "Mounts": [
- {
- "Target": "string",
- "Source": null,
- "Type": "bind",
- "ReadOnly": true,
- "BindOptions": {
- "Propagation": "private"
}, - "VolumeOptions": {
- "NoCopy": false,
- "Labels": {
- "property1": "string",
- "property2": "string"
}, - "DriverConfig": {
- "Name": "string",
- "Options": {
- "property1": "string",
- "property2": "string"
}
}
}, - "TmpfsOptions": {
- "SizeBytes": 0,
- "Mode": 0
}
}
], - "StopGracePeriod": 0,
- "DNSConfig": {
- "Nameservers": [
- "string"
], - "Search": [
- "string"
], - "Options": [
- "string"
]
}
}, - "Resources": {
- "Limits": {
- "NanoCPUs": 0,
- "MemoryBytes": 0
}, - "Reservations": {
- "NanoCPUs": 0,
- "MemoryBytes": 0
}
}, - "RestartPolicy": {
- "Condition": "none",
- "Delay": 0,
- "MaxAttempts": 0,
- "Window": 0
}, - "Placement": {
- "Constraints": [
- "string"
]
}, - "ForceUpdate": 0,
- "Networks": [
- {
- "Target": "string",
- "Aliases": [
- "string"
]
}
], - "LogDriver": {
- "Name": "string",
- "Options": {
- "property1": "string",
- "property2": "string"
}
}
}, - "Mode": {
- "Replicated": {
- "Replicas": 0
}, - "Global": { }
}, - "UpdateConfig": {
- "Parallelism": 0,
- "Delay": 0,
- "FailureAction": "continue",
- "Monitor": 0,
- "MaxFailureRatio": 0
}, - "Networks": [
- {
- "Target": "string",
- "Aliases": [
- "string"
]
}
], - "EndpointSpec": {
- "Mode": "vip",
- "Ports": [
- {
- "Name": "string",
- "Protocol": "tcp",
- "TargetPort": 0,
- "PublishedPort": 0
}
]
}
}
}
Engines can be clustered together in a swarm. See the swarm mode documentation for more information.
{- "CreatedAt": "2016-08-15T16:00:20.349727406Z",
- "Spec": {
- "Dispatcher": {
- "HeartbeatPeriod": 5000000000
}, - "Orchestration": {
- "TaskHistoryRetentionLimit": 10
}, - "CAConfig": {
- "NodeCertExpiry": 7776000000000000
}, - "Raft": {
- "LogEntriesForSlowFollowers": 500,
- "HeartbeatTick": 1,
- "SnapshotInterval": 10000,
- "ElectionTick": 3
}, - "TaskDefaults": { },
- "EncryptionConfig": {
- "AutoLockManagers": false
}, - "Name": "default"
}, - "JoinTokens": {
- "Worker": "SWMTKN-1-1h8aps2yszaiqmz2l3oc5392pgk8e49qhx2aj3nyv0ui0hez2a-6qmn92w6bu3jdvnglku58u11a",
- "Manager": "SWMTKN-1-1h8aps2yszaiqmz2l3oc5392pgk8e49qhx2aj3nyv0ui0hez2a-8llk83c4wm9lwioey2s316r9l"
}, - "ID": "70ilmkj2f6sp2137c753w2nmt",
- "UpdatedAt": "2016-08-15T16:32:09.623207604Z",
- "Version": {
- "Index": 51
}
}
ListenAddr | string Listen address used for inter-manager communication, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP). This can either be an address/port combination in the form |
AdvertiseAddr | string Externally reachable address advertised to other nodes. This can either be an address/port combination in the form |
ForceNewCluster | boolean Force creation of a new swarm. |
object (SwarmSpec) User modifiable swarm configuration. |
{- "ListenAddr": "0.0.0.0:2377",
- "AdvertiseAddr": "192.168.1.1:2377",
- "ForceNewCluster": false,
- "Spec": {
- "Orchestration": { },
- "Raft": { },
- "Dispatcher": { },
- "CAConfig": { },
- "EncryptionConfig": {
- "AutoLockManagers": false
}
}
}
"7v2t30z9blmxuhnyo6s4cpenp"
ListenAddr | string Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP). |
AdvertiseAddr | string Externally reachable address advertised to other nodes. This can either be an address/port combination in the form |
RemoteAddrs | string Addresses of manager nodes already participating in the swarm. |
JoinToken | string Secret token for joining this swarm. |
{- "ListenAddr": "0.0.0.0:2377",
- "AdvertiseAddr": "192.168.1.1:2377",
- "RemoteAddrs": [
- "node1:2377"
], - "JoinToken": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2"
}
{- "message": "Something went wrong."
}
version required | integer <int64> The version number of the swarm object being updated. This is required to avoid conflicting writes. |
rotateWorkerToken | boolean Default: false Rotate the worker join token. |
rotateManagerToken | boolean Default: false Rotate the manager join token. |
rotateManagerUnlockKey | boolean Default: false Rotate the manager unlock key. |
Name | string Name of the swarm. |
object User-defined key/value metadata. | |
object Orchestration configuration. | |
object Raft configuration. | |
object Dispatcher configuration. | |
object CA configuration. | |
object Parameters related to encryption-at-rest. | |
object Defaults for creating tasks in this cluster. |
{- "Name": "default",
- "Orchestration": {
- "TaskHistoryRetentionLimit": 10
}, - "Raft": {
- "SnapshotInterval": 10000,
- "LogEntriesForSlowFollowers": 500,
- "HeartbeatTick": 1,
- "ElectionTick": 3
}, - "Dispatcher": {
- "HeartbeatPeriod": 5000000000
}, - "CAConfig": {
- "NodeCertExpiry": 7776000000000000
}, - "JoinTokens": {
- "Worker": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx",
- "Manager": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2"
}, - "EncryptionConfig": {
- "AutoLockManagers": false
}
}
{- "message": "Something went wrong."
}
UnlockKey | string The swarm's unlock key. |
{- "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8"
}
{- "message": "Something went wrong."
}
Nodes are instances of the Engine participating in a swarm. Swarm mode must be enabled for these endpoints to work.
filters | string Filters to process on the nodes list, encoded as JSON (a Available filters:
|
[- {
- "ID": "24ifsmvkjbyhk",
- "Version": {
- "Index": 8
}, - "CreatedAt": "2016-06-07T20:31:11.853781916Z",
- "UpdatedAt": "2016-06-07T20:31:11.999868824Z",
- "Spec": {
- "Name": "my-node",
- "Role": "manager",
- "Availability": "active",
- "Labels": {
- "foo": "bar"
}
}, - "Description": {
- "Hostname": "bf3067039e47",
- "Platform": {
- "Architecture": "x86_64",
- "OS": "linux"
}, - "Resources": {
- "NanoCPUs": 4000000000,
- "MemoryBytes": 8272408576
}, - "Engine": {
- "EngineVersion": "1.13.0",
- "Labels": {
- "foo": "bar"
}, - "Plugins": [
- {
- "Type": "Volume",
- "Name": "local"
}, - {
- "Type": "Network",
- "Name": "bridge"
}, - {
- "Type": "Network",
- "Name": "null"
}, - {
- "Type": "Network",
- "Name": "overlay"
}
]
}
}, - "Status": {
- "State": "ready",
- "Addr": "172.17.0.2"
}, - "ManagerStatus": {
- "Leader": true,
- "Reachability": "reachable",
- "Addr": "172.17.0.2:2377"
}
}
]
{- "ID": "24ifsmvkjbyhk",
- "Version": {
- "Index": 8
}, - "CreatedAt": "2016-06-07T20:31:11.853781916Z",
- "UpdatedAt": "2016-06-07T20:31:11.999868824Z",
- "Spec": {
- "Name": "my-node",
- "Role": "manager",
- "Availability": "active",
- "Labels": {
- "foo": "bar"
}
}, - "Description": {
- "Hostname": "bf3067039e47",
- "Platform": {
- "Architecture": "x86_64",
- "OS": "linux"
}, - "Resources": {
- "NanoCPUs": 4000000000,
- "MemoryBytes": 8272408576
}, - "Engine": {
- "EngineVersion": "1.13.0",
- "Labels": {
- "foo": "bar"
}, - "Plugins": [
- {
- "Type": "Volume",
- "Name": "local"
}, - {
- "Type": "Network",
- "Name": "bridge"
}, - {
- "Type": "Network",
- "Name": "null"
}, - {
- "Type": "Network",
- "Name": "overlay"
}
]
}
}, - "Status": {
- "State": "ready",
- "Addr": "172.17.0.2"
}, - "ManagerStatus": {
- "Leader": true,
- "Reachability": "reachable",
- "Addr": "172.17.0.2:2377"
}
}
id required | string The ID of the node |
version required | integer <int64> The version number of the node object being updated. This is required to avoid conflicting writes. |
Name | string Name for the node. |
object User-defined key/value metadata. | |
Role | string Enum: "worker" "manager" Role of the node. |
Availability | string Enum: "active" "pause" "drain" Availability of the node. |
{- "Availability": "active",
- "Name": "node-name",
- "Role": "manager",
- "Labels": {
- "foo": "bar"
}
}
{- "message": "Something went wrong."
}
Services are the definitions of tasks to run on a swarm. Swarm mode must be enabled for these endpoints to work.
filters | string A JSON encoded value of the filters (a
|
[- {
- "ID": "9mnpnzenvg8p8tdbtq4wvbkcz",
- "Version": {
- "Index": 19
}, - "CreatedAt": "2016-06-07T21:05:51.880065305Z",
- "UpdatedAt": "2016-06-07T21:07:29.962229872Z",
- "Spec": {
- "Name": "hopeful_cori",
- "TaskTemplate": {
- "ContainerSpec": {
- "Image": "redis"
}, - "Resources": {
- "Limits": { },
- "Reservations": { }
}, - "RestartPolicy": {
- "Condition": "any",
- "MaxAttempts": 0
}, - "Placement": { },
- "ForceUpdate": 0
}, - "Mode": {
- "Replicated": {
- "Replicas": 1
}
}, - "UpdateConfig": {
- "Parallelism": 1,
- "FailureAction": "pause",
- "Monitor": 15000000000,
- "MaxFailureRatio": 0.15
}, - "EndpointSpec": {
- "Mode": "vip",
- "Ports": [
- {
- "Protocol": "tcp",
- "TargetPort": 6379,
- "PublishedPort": 30001
}
]
}
}, - "Endpoint": {
- "Spec": {
- "Mode": "vip",
- "Ports": [
- {
- "Protocol": "tcp",
- "TargetPort": 6379,
- "PublishedPort": 30001
}
]
}, - "Ports": [
- {
- "Protocol": "tcp",
- "TargetPort": 6379,
- "PublishedPort": 30001
}
], - "VirtualIPs": [
- {
- "NetworkID": "4qvuz4ko70xaltuqbt8956gd1",
- "Addr": "10.255.0.2/16"
}, - {
- "NetworkID": "4qvuz4ko70xaltuqbt8956gd1",
- "Addr": "10.255.0.3/16"
}
]
}
}
]
X-Registry-Auth | string A base64-encoded auth configuration for pulling from private registries. See the authentication section for details. |
Name | string Name of the service. |
object User-defined key/value metadata. | |
object (TaskSpec) User modifiable task configuration. | |
object Scheduling mode for the service. | |
object Specification for the update strategy of the service. | |
Array of objects Array of network names or IDs to attach the service to. | |
object (EndpointSpec) Properties that can be configured to access and load balance a service. |
{- "Name": "web",
- "Labels": {
- "property1": "string",
- "property2": "string",
- "foo": "bar"
}, - "TaskTemplate": {
- "ContainerSpec": {
- "Image": "nginx:alpine",
- "Command": [
- "string"
], - "Args": [
- "string"
], - "Env": [
- "string"
], - "Dir": "string",
- "User": "33",
- "Labels": {
- "property1": "string",
- "property2": "string"
}, - "TTY": true,
- "Mounts": [
- {
- "Target": "/usr/share/nginx/html",
- "Source": "web-data",
- "Type": "volume",
- "ReadOnly": true,
- "BindOptions": {
- "Propagation": "private"
}, - "VolumeOptions": {
- "NoCopy": false,
- "Labels": {
- "property1": "string",
- "property2": "string",
- "com.example.something": "something-value"
}, - "DriverConfig": {
- "Name": "string",
- "Options": {
- "property1": "string",
- "property2": "string"
}
}
}, - "TmpfsOptions": {
- "SizeBytes": 0,
- "Mode": 0
}
}
], - "StopGracePeriod": 0,
- "DNSConfig": {
- "Nameservers": [
- "8.8.8.8"
], - "Search": [
- "example.org"
], - "Options": [
- "timeout:3"
]
}
}, - "Resources": {
- "Limits": {
- "NanoCPUs": 0,
- "MemoryBytes": 104857600
}, - "Reservations": {
- "NanoCPUs": 0,
- "MemoryBytes": 0
}
}, - "RestartPolicy": {
- "Condition": "on-failure",
- "Delay": 10000000000,
- "MaxAttempts": 10,
- "Window": 0
}, - "Placement": {
- "Constraints": [
- "string"
]
}, - "ForceUpdate": 0,
- "Networks": [
- {
- "Target": "string",
- "Aliases": [
- "string"
]
}
], - "LogDriver": {
- "Name": "json-file",
- "Options": {
- "property1": "string",
- "property2": "string",
- "max-file": "3",
- "max-size": "10M"
}
}
}, - "Mode": {
- "Replicated": {
- "Replicas": 4
}, - "Global": { }
}, - "UpdateConfig": {
- "Parallelism": 2,
- "Delay": 30000000000,
- "FailureAction": "pause",
- "Monitor": 0,
- "MaxFailureRatio": 0
}, - "Networks": [
- {
- "Target": "string",
- "Aliases": [
- "string"
]
}
], - "EndpointSpec": {
- "Mode": "vip",
- "Ports": [
- {
- "Name": "string",
- "Protocol": "tcp",
- "TargetPort": 80,
- "PublishedPort": 8080
}
]
}
}
{- "ID": "ak7w3gjqoa3kuz8xcpnyy0pvl",
- "Warning": "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found"
}
{- "ID": "9mnpnzenvg8p8tdbtq4wvbkcz",
- "Version": {
- "Index": 19
}, - "CreatedAt": "2016-06-07T21:05:51.880065305Z",
- "UpdatedAt": "2016-06-07T21:07:29.962229872Z",
- "Spec": {
- "Name": "hopeful_cori",
- "TaskTemplate": {
- "ContainerSpec": {
- "Image": "redis"
}, - "Resources": {
- "Limits": { },
- "Reservations": { }
}, - "RestartPolicy": {
- "Condition": "any",
- "MaxAttempts": 0
}, - "Placement": { },
- "ForceUpdate": 0
}, - "Mode": {
- "Replicated": {
- "Replicas": 1
}
}, - "UpdateConfig": {
- "Parallelism": 1,
- "FailureAction": "pause",
- "Monitor": 15000000000,
- "MaxFailureRatio": 0.15
}, - "EndpointSpec": {
- "Mode": "vip",
- "Ports": [
- {
- "Protocol": "tcp",
- "TargetPort": 6379,
- "PublishedPort": 30001
}
]
}
}, - "Endpoint": {
- "Spec": {
- "Mode": "vip",
- "Ports": [
- {
- "Protocol": "tcp",
- "TargetPort": 6379,
- "PublishedPort": 30001
}
]
}, - "Ports": [
- {
- "Protocol": "tcp",
- "TargetPort": 6379,
- "PublishedPort": 30001
}
], - "VirtualIPs": [
- {
- "NetworkID": "4qvuz4ko70xaltuqbt8956gd1",
- "Addr": "10.255.0.2/16"
}, - {
- "NetworkID": "4qvuz4ko70xaltuqbt8956gd1",
- "Addr": "10.255.0.3/16"
}
]
}
}
id required | string ID or name of service. |
version required | integer The version number of the service object being updated. This is required to avoid conflicting writes. |
registryAuthFrom | string Default: "spec" If the X-Registry-Auth header is not specified, this parameter indicates where to find registry authorization credentials. The valid values are |
X-Registry-Auth | string A base64-encoded auth configuration for pulling from private registries. See the authentication section for details. |
Name | string Name of the service. |
object User-defined key/value metadata. | |
object (TaskSpec) User modifiable task configuration. | |
object Scheduling mode for the service. | |
object Specification for the update strategy of the service. | |
Array of objects Array of network names or IDs to attach the service to. | |
object (EndpointSpec) Properties that can be configured to access and load balance a service. |
{- "Name": "top",
- "Labels": {
- "property1": "string",
- "property2": "string"
}, - "TaskTemplate": {
- "ContainerSpec": {
- "Image": "busybox",
- "Command": [
- "string"
], - "Args": [
- "top"
], - "Env": [
- "string"
], - "Dir": "string",
- "User": "string",
- "Labels": {
- "property1": "string",
- "property2": "string"
}, - "TTY": true,
- "Mounts": [
- {
- "Target": "string",
- "Source": null,
- "Type": "bind",
- "ReadOnly": true,
- "BindOptions": {
- "Propagation": "private"
}, - "VolumeOptions": {
- "NoCopy": false,
- "Labels": {
- "property1": "string",
- "property2": "string"
}, - "DriverConfig": {
- "Name": "string",
- "Options": {
- "property1": "string",
- "property2": "string"
}
}
}, - "TmpfsOptions": {
- "SizeBytes": 0,
- "Mode": 0
}
}
], - "StopGracePeriod": 0,
- "DNSConfig": {
- "Nameservers": [
- "string"
], - "Search": [
- "string"
], - "Options": [
- "string"
]
}
}, - "Resources": {
- "Limits": {
- "NanoCPUs": 0,
- "MemoryBytes": 0
}, - "Reservations": {
- "NanoCPUs": 0,
- "MemoryBytes": 0
}
}, - "RestartPolicy": {
- "Condition": "any",
- "Delay": 0,
- "MaxAttempts": 0,
- "Window": 0
}, - "Placement": {
- "Constraints": [
- "string"
]
}, - "ForceUpdate": 0,
- "Networks": [
- {
- "Target": "string",
- "Aliases": [
- "string"
]
}
], - "LogDriver": {
- "Name": "string",
- "Options": {
- "property1": "string",
- "property2": "string"
}
}
}, - "Mode": {
- "Replicated": {
- "Replicas": 1
}, - "Global": { }
}, - "UpdateConfig": {
- "Parallelism": 1,
- "Delay": 0,
- "FailureAction": "continue",
- "Monitor": 15000000000,
- "MaxFailureRatio": 0.15
}, - "Networks": [
- {
- "Target": "string",
- "Aliases": [
- "string"
]
}
], - "EndpointSpec": {
- "Mode": "vip",
- "Ports": [
- {
- "Name": "string",
- "Protocol": "tcp",
- "TargetPort": 0,
- "PublishedPort": 0
}
]
}
}
{- "Untagged": "string",
- "Deleted": "string"
}
Get stdout
and stderr
logs from a service.
Note: This endpoint works only for services with the json-file
or journald
logging drivers.
id required | string ID or name of the container |
details | boolean Default: false Show extra details provided to logs. |
follow | boolean Default: false Return the logs as a stream. This will return a |
stdout | boolean Default: false Return logs from |
stderr | boolean Default: false Return logs from |
since | integer Default: 0 Only return logs since this time, as a UNIX timestamp |
timestamps | boolean Default: false Add timestamps to every log line |
tail | string Default: "all" Only return this number of log lines from the end of the logs. Specify as an integer or |
A task is a container running on a swarm. It is the atomic scheduling unit of swarm. Swarm mode must be enabled for these endpoints to work.
filters | string A JSON encoded value of the filters (a
|
[- {
- "ID": "0kzzo1i0y4jz6027t0k7aezc7",
- "Version": {
- "Index": 71
}, - "CreatedAt": "2016-06-07T21:07:31.171892745Z",
- "UpdatedAt": "2016-06-07T21:07:31.376370513Z",
- "Spec": {
- "ContainerSpec": {
- "Image": "redis"
}, - "Resources": {
- "Limits": { },
- "Reservations": { }
}, - "RestartPolicy": {
- "Condition": "any",
- "MaxAttempts": 0
}, - "Placement": { }
}, - "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz",
- "Slot": 1,
- "NodeID": "60gvrl6tm78dmak4yl7srz94v",
- "Status": {
- "Timestamp": "2016-06-07T21:07:31.290032978Z",
- "State": "running",
- "Message": "started",
- "ContainerStatus": {
- "ContainerID": "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035",
- "PID": 677
}
}, - "DesiredState": "running",
- "NetworksAttachments": [
- {
- "Network": {
- "ID": "4qvuz4ko70xaltuqbt8956gd1",
- "Version": {
- "Index": 18
}, - "CreatedAt": "2016-06-07T20:31:11.912919752Z",
- "UpdatedAt": "2016-06-07T21:07:29.955277358Z",
- "Spec": {
- "Name": "ingress",
- "Labels": {
- "com.docker.swarm.internal": "true"
}, - "DriverConfiguration": { },
- "IPAMOptions": {
- "Driver": { },
- "Configs": [
- {
- "Subnet": "10.255.0.0/16",
- "Gateway": "10.255.0.1"
}
]
}
}, - "DriverState": {
- "Name": "overlay",
- "Options": {
- "com.docker.network.driver.overlay.vxlanid_list": "256"
}
}, - "IPAMOptions": {
- "Driver": {
- "Name": "default"
}, - "Configs": [
- {
- "Subnet": "10.255.0.0/16",
- "Gateway": "10.255.0.1"
}
]
}
}, - "Addresses": [
- "10.255.0.10/16"
]
}
]
}, - {
- "ID": "1yljwbmlr8er2waf8orvqpwms",
- "Version": {
- "Index": 30
}, - "CreatedAt": "2016-06-07T21:07:30.019104782Z",
- "UpdatedAt": "2016-06-07T21:07:30.231958098Z",
- "Name": "hopeful_cori",
- "Spec": {
- "ContainerSpec": {
- "Image": "redis"
}, - "Resources": {
- "Limits": { },
- "Reservations": { }
}, - "RestartPolicy": {
- "Condition": "any",
- "MaxAttempts": 0
}, - "Placement": { }
}, - "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz",
- "Slot": 1,
- "NodeID": "60gvrl6tm78dmak4yl7srz94v",
- "Status": {
- "Timestamp": "2016-06-07T21:07:30.202183143Z",
- "State": "shutdown",
- "Message": "shutdown",
- "ContainerStatus": {
- "ContainerID": "1cf8d63d18e79668b0004a4be4c6ee58cddfad2dae29506d8781581d0688a213"
}
}, - "DesiredState": "shutdown",
- "NetworksAttachments": [
- {
- "Network": {
- "ID": "4qvuz4ko70xaltuqbt8956gd1",
- "Version": {
- "Index": 18
}, - "CreatedAt": "2016-06-07T20:31:11.912919752Z",
- "UpdatedAt": "2016-06-07T21:07:29.955277358Z",
- "Spec": {
- "Name": "ingress",
- "Labels": {
- "com.docker.swarm.internal": "true"
}, - "DriverConfiguration": { },
- "IPAMOptions": {
- "Driver": { },
- "Configs": [
- {
- "Subnet": "10.255.0.0/16",
- "Gateway": "10.255.0.1"
}
]
}
}, - "DriverState": {
- "Name": "overlay",
- "Options": {
- "com.docker.network.driver.overlay.vxlanid_list": "256"
}
}, - "IPAMOptions": {
- "Driver": {
- "Name": "default"
}, - "Configs": [
- {
- "Subnet": "10.255.0.0/16",
- "Gateway": "10.255.0.1"
}
]
}
}, - "Addresses": [
- "10.255.0.5/16"
]
}
]
}
]
{- "ID": "0kzzo1i0y4jz6027t0k7aezc7",
- "Version": {
- "Index": 71
}, - "CreatedAt": "2016-06-07T21:07:31.171892745Z",
- "UpdatedAt": "2016-06-07T21:07:31.376370513Z",
- "Spec": {
- "ContainerSpec": {
- "Image": "redis"
}, - "Resources": {
- "Limits": { },
- "Reservations": { }
}, - "RestartPolicy": {
- "Condition": "any",
- "MaxAttempts": 0
}, - "Placement": { }
}, - "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz",
- "Slot": 1,
- "NodeID": "60gvrl6tm78dmak4yl7srz94v",
- "Status": {
- "Timestamp": "2016-06-07T21:07:31.290032978Z",
- "State": "running",
- "Message": "started",
- "ContainerStatus": {
- "ContainerID": "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035",
- "PID": 677
}
}, - "DesiredState": "running",
- "NetworksAttachments": [
- {
- "Network": {
- "ID": "4qvuz4ko70xaltuqbt8956gd1",
- "Version": {
- "Index": 18
}, - "CreatedAt": "2016-06-07T20:31:11.912919752Z",
- "UpdatedAt": "2016-06-07T21:07:29.955277358Z",
- "Spec": {
- "Name": "ingress",
- "Labels": {
- "com.docker.swarm.internal": "true"
}, - "DriverConfiguration": { },
- "IPAMOptions": {
- "Driver": { },
- "Configs": [
- {
- "Subnet": "10.255.0.0/16",
- "Gateway": "10.255.0.1"
}
]
}
}, - "DriverState": {
- "Name": "overlay",
- "Options": {
- "com.docker.network.driver.overlay.vxlanid_list": "256"
}
}, - "IPAMOptions": {
- "Driver": {
- "Name": "default"
}, - "Configs": [
- {
- "Subnet": "10.255.0.0/16",
- "Gateway": "10.255.0.1"
}
]
}
}, - "Addresses": [
- "10.255.0.10/16"
]
}
]
}
[- {
- "Id": "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078",
- "Name": "tiborvass/sample-volume-plugin",
- "Tag": "latest",
- "Active": true,
- "Settings": {
- "Env": [
- "DEBUG=0"
], - "Args": null,
- "Devices": null
}, - "Config": {
- "Description": "A sample volume plugin for Docker",
- "Interface": {
- "Types": [
- "docker.volumedriver/1.0"
], - "Socket": "plugins.sock"
}, - "Entrypoint": [
- "/usr/bin/sample-volume-plugin",
- "/data"
], - "WorkDir": "",
- "User": { },
- "Network": {
- "Type": ""
}, - "Linux": {
- "Capabilities": null,
- "AllowAllDevices": false,
- "Devices": null
}, - "Mounts": null,
- "PropagatedMount": "/data",
- "Env": [
- {
- "Name": "DEBUG",
- "Description": "If set, prints debug messages",
- "Settable": null,
- "Value": "0"
}
], - "Args": {
- "Name": "args",
- "Description": "command line arguments",
- "Settable": null,
- "Value": [ ]
}
}
}
]
name required | string The name of the plugin. The |
[- {
- "Name": "network",
- "Description": "",
- "Value": [
- "host"
]
}, - {
- "Name": "mount",
- "Description": "",
- "Value": [
- "/data"
]
}, - {
- "Name": "device",
- "Description": "",
- "Value": [
- "/dev/cpu_dma_latency"
]
}
]
Pulls and installs a plugin. After the plugin is installed, it can be enabled using the POST /plugins/{name}/enable
endpoint.
remote required | string Remote reference for plugin to install. The |
name | string Local name for the pulled plugin. The |
X-Registry-Auth | string A base64-encoded auth configuration to use when pulling a plugin from a registry. See the authentication section for details. |
Name | string |
Description | string |
Value | Array of strings |
[- {
- "Name": "network",
- "Description": "",
- "Value": [
- "host"
]
}, - {
- "Name": "mount",
- "Description": "",
- "Value": [
- "/data"
]
}, - {
- "Name": "device",
- "Description": "",
- "Value": [
- "/dev/cpu_dma_latency"
]
}
]
{- "message": "Something went wrong."
}
name required | string The name of the plugin. The |
{- "Id": "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078",
- "Name": "tiborvass/sample-volume-plugin",
- "Tag": "latest",
- "Active": true,
- "Settings": {
- "Env": [
- "DEBUG=0"
], - "Args": null,
- "Devices": null
}, - "Config": {
- "Description": "A sample volume plugin for Docker",
- "Interface": {
- "Types": [
- "docker.volumedriver/1.0"
], - "Socket": "plugins.sock"
}, - "Entrypoint": [
- "/usr/bin/sample-volume-plugin",
- "/data"
], - "WorkDir": "",
- "User": { },
- "Network": {
- "Type": ""
}, - "Linux": {
- "Capabilities": null,
- "AllowAllDevices": false,
- "Devices": null
}, - "Mounts": null,
- "PropagatedMount": "/data",
- "Env": [
- {
- "Name": "DEBUG",
- "Description": "If set, prints debug messages",
- "Settable": null,
- "Value": "0"
}
], - "Args": {
- "Name": "args",
- "Description": "command line arguments",
- "Settable": null,
- "Value": [ ]
}
}
}
name required | string The name of the plugin. The |
force | boolean Default: false Disable the plugin before removing. This may result in issues if the plugin is in use by a container. |
{- "Id": "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078",
- "Name": "tiborvass/sample-volume-plugin",
- "Tag": "latest",
- "Active": true,
- "Settings": {
- "Env": [
- "DEBUG=0"
], - "Args": null,
- "Devices": null
}, - "Config": {
- "Description": "A sample volume plugin for Docker",
- "Interface": {
- "Types": [
- "docker.volumedriver/1.0"
], - "Socket": "plugins.sock"
}, - "Entrypoint": [
- "/usr/bin/sample-volume-plugin",
- "/data"
], - "WorkDir": "",
- "User": { },
- "Network": {
- "Type": ""
}, - "Linux": {
- "Capabilities": null,
- "AllowAllDevices": false,
- "Devices": null
}, - "Mounts": null,
- "PropagatedMount": "/data",
- "Env": [
- {
- "Name": "DEBUG",
- "Description": "If set, prints debug messages",
- "Settable": null,
- "Value": "0"
}
], - "Args": {
- "Name": "args",
- "Description": "command line arguments",
- "Settable": null,
- "Value": [ ]
}
}
}
name required | string The name of the plugin. The |
Path to tar containing plugin rootfs and manifest
{- "message": "Something went wrong."
}
name required | string The name of the plugin. The |
[- "DEBUG=1"
]
{- "message": "Something went wrong."
}
Validate credentials for a registry and, if available, get an identity token for accessing the registry without password.
Authentication to check
username | string |
password | string |
string | |
serveraddress | string |
{- "username": "hannibal",
- "password": "xxxx",
}
{- "Status": "Login Succeeded",
- "IdentityToken": "9cbaf023786cd7..."
}
{- "Architecture": "x86_64",
- "ClusterStore": "etcd://localhost:2379",
- "CgroupDriver": "cgroupfs",
- "Containers": 11,
- "ContainersRunning": 7,
- "ContainersStopped": 3,
- "ContainersPaused": 1,
- "CpuCfsPeriod": true,
- "CpuCfsQuota": true,
- "Debug": false,
- "DockerRootDir": "/var/lib/docker",
- "Driver": "btrfs",
- "DriverStatus": [
- [
- ""
]
], - "ExperimentalBuild": false,
- "ID": "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS",
- "IPv4Forwarding": true,
- "Images": 16,
- "InitPath": "/usr/bin/docker",
- "InitSha1": "",
- "KernelMemory": true,
- "KernelVersion": "3.12.0-1-amd64",
- "Labels": [
- "storage=ssd"
], - "MemTotal": 2099236864,
- "MemoryLimit": true,
- "NCPU": 1,
- "NEventsListener": 0,
- "NFd": 11,
- "NGoroutines": 21,
- "Name": "prod-server-42",
- "NoProxy": "9.81.1.160",
- "OomKillDisable": true,
- "OSType": "linux",
- "OperatingSystem": "Boot2Docker",
- "Plugins": {
- "Volume": [
- "local"
], - "Network": [
- "null",
- "host",
- "bridge"
]
}, - "RegistryConfig": {
- "IndexConfigs": {
- "docker.io": {
- "Name": "docker.io",
- "Official": true,
- "Secure": true
}
}, - "InsecureRegistryCIDRs": [
- "127.0.0.0/8"
]
}, - "SecurityOptions": [
- {
- "Key": "Name",
- "Value": "seccomp"
}, - {
- "Key": "Profile",
- "Value": "default"
}, - {
- "Key": "Name",
- "Value": "apparmor"
}, - {
- "Key": "Name",
- "Value": "selinux"
}, - {
- "Key": "Name",
- "Value": "userns"
}
], - "ServerVersion": "1.9.0",
- "SwapLimit": false,
- "SystemStatus": [
- [
- "State",
- "Healthy"
]
], - "SystemTime": "2015-03-10T11:11:23.730591467-07:00"
}
Returns the version of Docker that is running and various information about the system that Docker is running on.
{- "Version": "1.13.0",
- "Os": "linux",
- "KernelVersion": "3.19.0-23-generic",
- "GoVersion": "go1.6.3",
- "GitCommit": "deadbee",
- "Arch": "amd64",
- "ApiVersion": "1.25",
- "MinAPIVersion": "1.12",
- "BuildTime": "2016-06-14T07:09:13.444803460+00:00",
- "Experimental": true
}
Stream real-time events from the server.
Various objects within Docker report events when something happens to them.
Containers report these events: attach, commit, copy, create, destroy, detach, die, exec_create, exec_detach, exec_start, export, kill, oom, pause, rename, resize, restart, start, stop, top, unpause, update
Images report these events: delete, import, load, pull, push, save, tag, untag
Volumes report these events: create, mount, unmount, destroy
Networks report these events: create, connect, disconnect, destroy
The Docker daemon reports these events: reload
since | string Show events created since this timestamp then stream new events. |
until | string Show events created until this timestamp then stop streaming. |
filters | string A JSON encoded value of filters (a
|
{- "Type": "container",
- "Action": "create",
- "Actor": {
- "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
- "Attributes": {
- "com.example.some-label": "some-label-value",
- "image": "alpine",
- "name": "my-container"
}
}, - "time": 1461943101
}
{- "LayersSize": 1092588,
- "Images": [
- {
- "Id": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749",
- "ParentId": "",
- "RepoTags": [
- "busybox:latest"
], - "RepoDigests": [
- "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6"
], - "Created": 1466724217,
- "Size": 1092588,
- "SharedSize": 0,
- "VirtualSize": 1092588,
- "Labels": { },
- "Containers": 1
}
], - "Containers": [
- {
- "Id": "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148",
- "Names": [
- "/top"
], - "Image": "busybox",
- "ImageID": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749",
- "Command": "top",
- "Created": 1472592424,
- "Ports": [ ],
- "SizeRootFs": 1092588,
- "Labels": { },
- "State": "exited",
- "Status": "Exited (0) 56 minutes ago",
- "HostConfig": {
- "NetworkMode": "default"
}, - "NetworkSettings": {
- "Networks": {
- "bridge": {
- "IPAMConfig": null,
- "Links": null,
- "Aliases": null,
- "NetworkID": "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92",
- "EndpointID": "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a",
- "Gateway": "172.18.0.1",
- "IPAddress": "172.18.0.2",
- "IPPrefixLen": 16,
- "IPv6Gateway": "",
- "GlobalIPv6Address": "",
- "GlobalIPv6PrefixLen": 0,
- "MacAddress": "02:42:ac:12:00:02"
}
}
}, - "Mounts": [ ]
}
], - "Volumes": [
- {
- "Name": "my-volume",
- "Driver": "local",
- "Mountpoint": "",
- "Labels": null,
- "Scope": "",
- "Options": null,
- "UsageData": {
- "Size": 0,
- "RefCount": 0
}
}
]
}