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, so API calls are versioned to
ensure that clients don't break. To lock to a specific version of the API,
you prefix the URL with its version, for example, call /v1.30/info
to use
the v1.30 version of the /info
endpoint. If the API version specified in
the URL is not supported by the daemon, a HTTP 400 Bad Request
error message
is returned.
If you omit the version-prefix, the current version of the API (v1.48) is used.
For example, calling /info
is the same as calling /v1.48/info
. Using the
API without a version-prefix is deprecated and will be removed in a future release.
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.
The API uses an open schema model, which means the 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 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 base64url 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..."
}
Returns a list of containers. For details on the format, see the inspect endpoint.
Note that it uses a different, smaller representation of a container than inspecting a single container. For example, the list of linked containers is not propagated .
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": "aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf",
- "Names": [
- "/funny_chatelet"
], - "Image": "docker.io/library/ubuntu:latest",
- "ImageID": "sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782",
- "ImageManifestDescriptor": {
- "mediaType": "application/vnd.oci.image.manifest.v1+json",
- "digest": "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96",
- "size": 424,
- "annotations": {
- "com.docker.official-images.bashbrew.arch": "amd64",
- "org.opencontainers.image.base.digest": "sha256:0d0ef5c914d3ea700147da1bd050c59edb8bb12ca312f3800b29d7c8087eabd8",
- "org.opencontainers.image.base.name": "scratch",
- "org.opencontainers.image.created": "2025-01-27T00:00:00Z",
- "org.opencontainers.image.revision": "9fabb4bad5138435b01857e2fe9363e2dc5f6a79",
- "org.opencontainers.image.version": "24.04"
}, - "data": null,
- "platform": {
- "architecture": "arm",
- "os": "windows",
- "os.version": "10.0.19041.1165",
- "os.features": [
- "win32k"
], - "variant": "v7"
}, - "artifactType": null
}, - "Command": "/bin/bash",
- "Created": "1739811096",
- "Ports": [
- {
- "PrivatePort": 8080,
- "PublicPort": 80,
- "Type": "tcp"
}
], - "SizeRw": "122880",
- "SizeRootFs": "1653948416",
- "Labels": {
- "com.example.vendor": "Acme",
- "com.example.license": "GPL",
- "com.example.version": "1.0"
}, - "State": "running",
- "Status": "Up 4 days",
- "HostConfig": {
- "NetworkMode": "mynetwork",
- "Annotations": {
- "io.kubernetes.docker.type": "container",
- "io.kubernetes.sandbox.id": "3befe639bed0fd6afdd65fd1fa84506756f59360ec4adc270b0fdac9be22b4d3"
}
}, - "NetworkSettings": {
- "Networks": {
- "property1": {
- "IPAMConfig": {
- "IPv4Address": "172.20.30.33",
- "IPv6Address": "2001:db8:abcd::3033",
- "LinkLocalIPs": [
- "169.254.34.68",
- "fe80::3468"
]
}, - "Links": [
- "container_1",
- "container_2"
], - "MacAddress": "02:42:ac:11:00:04",
- "Aliases": [
- "server_x",
- "server_y"
], - "DriverOpts": {
- "com.example.some-label": "some-value",
- "com.example.some-other-label": "some-other-value"
}, - "GwPriority": [
- 10
], - "NetworkID": "08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a",
- "EndpointID": "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b",
- "Gateway": "172.17.0.1",
- "IPAddress": "172.17.0.4",
- "IPPrefixLen": 16,
- "IPv6Gateway": "2001:db8:2::100",
- "GlobalIPv6Address": "2001:db8::5689",
- "GlobalIPv6PrefixLen": 64,
- "DNSNames": [
- "foobar",
- "server_x",
- "server_y",
- "my.ctr"
]
}, - "property2": {
- "IPAMConfig": {
- "IPv4Address": "172.20.30.33",
- "IPv6Address": "2001:db8:abcd::3033",
- "LinkLocalIPs": [
- "169.254.34.68",
- "fe80::3468"
]
}, - "Links": [
- "container_1",
- "container_2"
], - "MacAddress": "02:42:ac:11:00:04",
- "Aliases": [
- "server_x",
- "server_y"
], - "DriverOpts": {
- "com.example.some-label": "some-value",
- "com.example.some-other-label": "some-other-value"
}, - "GwPriority": [
- 10
], - "NetworkID": "08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a",
- "EndpointID": "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b",
- "Gateway": "172.17.0.1",
- "IPAddress": "172.17.0.4",
- "IPPrefixLen": 16,
- "IPv6Gateway": "2001:db8:2::100",
- "GlobalIPv6Address": "2001:db8::5689",
- "GlobalIPv6PrefixLen": 64,
- "DNSNames": [
- "foobar",
- "server_x",
- "server_y",
- "my.ctr"
]
}
}
}, - "Mounts": [
- {
- "Type": "volume",
- "Name": "myvolume",
- "Source": "/var/lib/docker/volumes/myvolume/_data",
- "Destination": "/usr/share/nginx/html/",
- "Driver": "local",
- "Mode": "z",
- "RW": true,
- "Propagation": ""
}
]
}
]
name | string^/?[a-zA-Z0-9][a-zA-Z0-9_.-]+$ Assign the specified name to the container. Must match
|
platform | string Default: "" Platform in the format When specified, the daemon checks if the requested image is present
in the local image cache with the given OS and Architecture, and
otherwise returns a If the option is not set, the host's native OS and Architecture are
used to look up the image in the image cache. However, if no platform
is passed and the given image does exist in the local image cache,
but its OS or architecture does not match, the container is created
with the available image, and a warning is added to the
|
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 Commands run as this user inside the container. If omitted, commands run as the user specified in the image the container was started from. Can be either user-name or UID, and optional group-name or GID,
separated by a colon ( |
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 or null 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 |
Cmd | Array of strings Command to run specified as a string or an array of strings. |
object (HealthConfig) A test to perform to check that the container is healthy. | |
ArgsEscaped | boolean or null Default: false Command is already escaped (Windows only) |
Image | string The name (or reference) of the image to use when creating the container, or which was used when the container was created. |
object An object mapping mount point paths inside the container to empty objects. | |
WorkingDir | string The working directory for commands to run in. |
Entrypoint | Array of strings 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 or null Disable networking for the container. |
MacAddress | string or null MAC address of the container. Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. |
OnBuild | Array of strings or null
|
object User-defined key/value metadata. | |
StopSignal | string or null Signal to stop a container as a string or unsigned integer. |
StopTimeout | integer or null Default: 10 Timeout to stop a container in seconds. |
Shell | Array of strings or null Shell for when |
object (HostConfig) Container configuration that depends on the host we are running on | |
object (NetworkingConfig) NetworkingConfig represents the container's networking configuration for
each of its interfaces.
It is used for the networking configs specified in the |
{- "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,
- "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": [
- { }
], - "DeviceRequests": [
- {
- "Driver": "nvidia",
- "Count": -1,
- "DeviceIDs"": [
- "0",
- "1",
- "GPU-fef8089b-4820-abfc-e83e-94318197576e"
], - "Capabilities": [
- [
- "gpu",
- "nvidia",
- "compute"
]
], - "Options": {
- "property1": "string",
- "property2": "string"
}
}
], - "MemorySwappiness": 60,
- "OomKillDisable": false,
- "OomScoreAdj": 500,
- "PidMode": "",
- "PidsLimit": 0,
- "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"
]
}, - "database_nw": { }
}
}
}
{- "Id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
- "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 |
{- "Id": "aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf",
- "Created": "2025-02-17T17:43:39.64001363Z",
- "Path": "/bin/sh",
- "Args": [
- "-c",
- "exit 9"
], - "State": {
- "Status": "running",
- "Running": true,
- "Paused": false,
- "Restarting": false,
- "OOMKilled": false,
- "Dead": false,
- "Pid": 1234,
- "ExitCode": 0,
- "Error": "string",
- "StartedAt": "2020-01-06T09:06:59.461876391Z",
- "FinishedAt": "2020-01-06T09:07:59.461876391Z",
- "Health": {
- "Status": "healthy",
- "FailingStreak": 0,
- "Log": [
- {
- "Start": "2020-01-04T10:44:24.496525531Z",
- "End": "2020-01-04T10:45:21.364524523Z",
- "ExitCode": 0,
- "Output": "string"
}
]
}
}, - "Image": "sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782",
- "ResolvConfPath": "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/resolv.conf",
- "HostnamePath": "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/hostname",
- "HostsPath": "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/hosts",
- "LogPath": "/var/lib/docker/containers/5b7c7e2b992aa426584ce6c47452756066be0e503a08b4516a433a54d2f69e59/5b7c7e2b992aa426584ce6c47452756066be0e503a08b4516a433a54d2f69e59-json.log",
- "Name": "/funny_chatelet",
- "RestartCount": 0,
- "Driver": "overlayfs",
- "Platform": "linux",
- "ImageManifestDescriptor": {
- "mediaType": "application/vnd.oci.image.manifest.v1+json",
- "digest": "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96",
- "size": 424,
- "annotations": {
- "com.docker.official-images.bashbrew.arch": "amd64",
- "org.opencontainers.image.base.digest": "sha256:0d0ef5c914d3ea700147da1bd050c59edb8bb12ca312f3800b29d7c8087eabd8",
- "org.opencontainers.image.base.name": "scratch",
- "org.opencontainers.image.created": "2025-01-27T00:00:00Z",
- "org.opencontainers.image.revision": "9fabb4bad5138435b01857e2fe9363e2dc5f6a79",
- "org.opencontainers.image.version": "24.04"
}, - "data": null,
- "platform": {
- "architecture": "arm",
- "os": "windows",
- "os.version": "10.0.19041.1165",
- "os.features": [
- "win32k"
], - "variant": "v7"
}, - "artifactType": null
}, - "MountLabel": "",
- "ProcessLabel": "",
- "AppArmorProfile": "",
- "ExecIDs": [
- "b35395de42bc8abd327f9dd65d913b9ba28c74d2f0734eeeae84fa1c616a0fca",
- "3fc1232e5cd20c8de182ed81178503dc6437f4e7ef12b52cc5e8de020652f1c4"
], - "HostConfig": {
- "CpuShares": 0,
- "Memory": 0,
- "CgroupParent": "string",
- "BlkioWeight": 1000,
- "BlkioWeightDevice": [
- {
- "Path": "string",
- "Weight": 0
}
], - "BlkioDeviceReadBps": [
- {
- "Path": "string",
- "Rate": 0
}
], - "BlkioDeviceWriteBps": [
- {
- "Path": "string",
- "Rate": 0
}
], - "BlkioDeviceReadIOps": [
- {
- "Path": "string",
- "Rate": 0
}
], - "BlkioDeviceWriteIOps": [
- {
- "Path": "string",
- "Rate": 0
}
], - "CpuPeriod": 0,
- "CpuQuota": 0,
- "CpuRealtimePeriod": 0,
- "CpuRealtimeRuntime": 0,
- "CpusetCpus": "0-3",
- "CpusetMems": "string",
- "Devices": [
- {
- "PathOnHost": "/dev/deviceName",
- "PathInContainer": "/dev/deviceName",
- "CgroupPermissions": "mrw"
}
], - "DeviceCgroupRules": [
- "c 13:* rwm"
], - "DeviceRequests": [
- {
- "Driver": "nvidia",
- "Count": -1,
- "DeviceIDs": [
- "0",
- "1",
- "GPU-fef8089b-4820-abfc-e83e-94318197576e"
], - "Capabilities": [
- [
- "gpu",
- "nvidia",
- "compute"
]
], - "Options": {
- "property1": "string",
- "property2": "string"
}
}
], - "KernelMemoryTCP": 0,
- "MemoryReservation": 0,
- "MemorySwap": 0,
- "MemorySwappiness": 100,
- "NanoCpus": 0,
- "OomKillDisable": true,
- "Init": true,
- "PidsLimit": 0,
- "Ulimits": [
- {
- "Name": "string",
- "Soft": 0,
- "Hard": 0
}
], - "CpuCount": 0,
- "CpuPercent": 0,
- "IOMaximumIOps": 0,
- "IOMaximumBandwidth": 0,
- "Binds": [
- "string"
], - "ContainerIDFile": "",
- "LogConfig": {
- "Type": "local",
- "Config": {
- "max-file": "5",
- "max-size": "10m"
}
}, - "NetworkMode": "string",
- "PortBindings": {
- "443/tcp": [
- {
- "HostIp": "127.0.0.1",
- "HostPort": "4443"
}
], - "80/tcp": [
- {
- "HostIp": "0.0.0.0",
- "HostPort": "80"
}, - {
- "HostIp": "0.0.0.0",
- "HostPort": "8080"
}
], - "80/udp": [
- {
- "HostIp": "0.0.0.0",
- "HostPort": "80"
}
], - "53/udp": [
- {
- "HostIp": "0.0.0.0",
- "HostPort": "53"
}
], - "2377/tcp": null
}, - "RestartPolicy": {
- "Name": "",
- "MaximumRetryCount": 0
}, - "AutoRemove": true,
- "VolumeDriver": "string",
- "VolumesFrom": [
- "string"
], - "Mounts": [
- {
- "Target": "string",
- "Source": "string",
- "Type": "bind",
- "ReadOnly": true,
- "Consistency": "string",
- "BindOptions": {
- "Propagation": "private",
- "NonRecursive": false,
- "CreateMountpoint": false,
- "ReadOnlyNonRecursive": false,
- "ReadOnlyForceRecursive": false
}, - "VolumeOptions": {
- "NoCopy": false,
- "Labels": {
- "property1": "string",
- "property2": "string"
}, - "DriverConfig": {
- "Name": "string",
- "Options": {
- "property1": "string",
- "property2": "string"
}
}, - "Subpath": "dir-inside-volume/subdirectory"
}, - "ImageOptions": {
- "Subpath": "dir-inside-image/subdirectory"
}, - "TmpfsOptions": {
- "SizeBytes": 0,
- "Mode": 0,
- "Options": [
- [
- "noexec"
]
]
}
}
], - "ConsoleSize": [
- 80,
- 64
], - "Annotations": {
- "property1": "string",
- "property2": "string"
}, - "CapAdd": [
- "string"
], - "CapDrop": [
- "string"
], - "CgroupnsMode": "private",
- "Dns": [
- "string"
], - "DnsOptions": [
- "string"
], - "DnsSearch": [
- "string"
], - "ExtraHosts": [
- "string"
], - "GroupAdd": [
- "string"
], - "IpcMode": "string",
- "Cgroup": "string",
- "Links": [
- "string"
], - "OomScoreAdj": 500,
- "PidMode": "string",
- "Privileged": true,
- "PublishAllPorts": true,
- "ReadonlyRootfs": true,
- "SecurityOpt": [
- "string"
], - "StorageOpt": {
- "property1": "string",
- "property2": "string"
}, - "Tmpfs": {
- "property1": "string",
- "property2": "string"
}, - "UTSMode": "string",
- "UsernsMode": "string",
- "ShmSize": 0,
- "Sysctls": {
- "net.ipv4.ip_forward": "1"
}, - "Runtime": "string",
- "Isolation": "default",
- "MaskedPaths": [
- "/proc/asound",
- "/proc/acpi",
- "/proc/kcore",
- "/proc/keys",
- "/proc/latency_stats",
- "/proc/timer_list",
- "/proc/timer_stats",
- "/proc/sched_debug",
- "/proc/scsi",
- "/sys/firmware",
- "/sys/devices/virtual/powercap"
], - "ReadonlyPaths": [
- "/proc/bus",
- "/proc/fs",
- "/proc/irq",
- "/proc/sys",
- "/proc/sysrq-trigger"
]
}, - "GraphDriver": {
- "Name": "overlay2",
- "Data": {
- "MergedDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/merged",
- "UpperDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/diff",
- "WorkDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/work"
}
}, - "SizeRw": "122880",
- "SizeRootFs": "1653948416",
- "Mounts": [
- {
- "Type": "volume",
- "Name": "myvolume",
- "Source": "/var/lib/docker/volumes/myvolume/_data",
- "Destination": "/usr/share/nginx/html/",
- "Driver": "local",
- "Mode": "z",
- "RW": true,
- "Propagation": ""
}
], - "Config": {
- "Hostname": "439f4e91bd1d",
- "Domainname": "string",
- "User": "123:456",
- "AttachStdin": false,
- "AttachStdout": true,
- "AttachStderr": true,
- "ExposedPorts": {
- "80/tcp": { },
- "443/tcp": { }
}, - "Tty": false,
- "OpenStdin": false,
- "StdinOnce": false,
- "Env": [
- "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
], - "Cmd": [
- "/bin/sh"
], - "Healthcheck": {
- "Test": [
- "string"
], - "Interval": 0,
- "Timeout": 0,
- "Retries": 0,
- "StartPeriod": 0,
- "StartInterval": 0
}, - "ArgsEscaped": false,
- "Image": "example-image:1.0",
- "Volumes": {
- "property1": { },
- "property2": { }
}, - "WorkingDir": "/public/",
- "Entrypoint": [ ],
- "NetworkDisabled": true,
- "MacAddress": "string",
- "OnBuild": [ ],
- "Labels": {
- "com.example.some-label": "some-value",
- "com.example.some-other-label": "some-other-value"
}, - "StopSignal": "SIGTERM",
- "StopTimeout": 10,
- "Shell": [
- "/bin/sh",
- "-c"
]
}, - "NetworkSettings": {
- "Bridge": "docker0",
- "SandboxID": "9d12daf2c33f5959c8bf90aa513e4f65b561738661003029ec84830cd503a0c3",
- "HairpinMode": false,
- "LinkLocalIPv6Address": "",
- "LinkLocalIPv6PrefixLen": "",
- "Ports": {
- "443/tcp": [
- {
- "HostIp": "127.0.0.1",
- "HostPort": "4443"
}
], - "80/tcp": [
- {
- "HostIp": "0.0.0.0",
- "HostPort": "80"
}, - {
- "HostIp": "0.0.0.0",
- "HostPort": "8080"
}
], - "80/udp": [
- {
- "HostIp": "0.0.0.0",
- "HostPort": "80"
}
], - "53/udp": [
- {
- "HostIp": "0.0.0.0",
- "HostPort": "53"
}
], - "2377/tcp": null
}, - "SandboxKey": "/var/run/docker/netns/8ab54b426c38",
- "SecondaryIPAddresses": [
- {
- "Addr": "string",
- "PrefixLen": 0
}
], - "SecondaryIPv6Addresses": [
- {
- "Addr": "string",
- "PrefixLen": 0
}
], - "EndpointID": "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b",
- "Gateway": "172.17.0.1",
- "GlobalIPv6Address": "2001:db8::5689",
- "GlobalIPv6PrefixLen": 64,
- "IPAddress": "172.17.0.4",
- "IPPrefixLen": 16,
- "IPv6Gateway": "2001:db8:2::100",
- "MacAddress": "02:42:ac:11:00:04",
- "Networks": {
- "property1": {
- "IPAMConfig": {
- "IPv4Address": "172.20.30.33",
- "IPv6Address": "2001:db8:abcd::3033",
- "LinkLocalIPs": [
- "169.254.34.68",
- "fe80::3468"
]
}, - "Links": [
- "container_1",
- "container_2"
], - "MacAddress": "02:42:ac:11:00:04",
- "Aliases": [
- "server_x",
- "server_y"
], - "DriverOpts": {
- "com.example.some-label": "some-value",
- "com.example.some-other-label": "some-other-value"
}, - "GwPriority": [
- 10
], - "NetworkID": "08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a",
- "EndpointID": "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b",
- "Gateway": "172.17.0.1",
- "IPAddress": "172.17.0.4",
- "IPPrefixLen": 16,
- "IPv6Gateway": "2001:db8:2::100",
- "GlobalIPv6Address": "2001:db8::5689",
- "GlobalIPv6PrefixLen": 64,
- "DNSNames": [
- "foobar",
- "server_x",
- "server_y",
- "my.ctr"
]
}, - "property2": {
- "IPAMConfig": {
- "IPv4Address": "172.20.30.33",
- "IPv6Address": "2001:db8:abcd::3033",
- "LinkLocalIPs": [
- "169.254.34.68",
- "fe80::3468"
]
}, - "Links": [
- "container_1",
- "container_2"
], - "MacAddress": "02:42:ac:11:00:04",
- "Aliases": [
- "server_x",
- "server_y"
], - "DriverOpts": {
- "com.example.some-label": "some-value",
- "com.example.some-other-label": "some-other-value"
}, - "GwPriority": [
- 10
], - "NetworkID": "08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a",
- "EndpointID": "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b",
- "Gateway": "172.17.0.1",
- "IPAddress": "172.17.0.4",
- "IPPrefixLen": 16,
- "IPv6Gateway": "2001:db8:2::100",
- "GlobalIPv6Address": "2001:db8::5689",
- "GlobalIPv6PrefixLen": 64,
- "DNSNames": [
- "foobar",
- "server_x",
- "server_y",
- "my.ctr"
]
}
}
}
}
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": {
- "Titles": [
- "UID",
- "PID",
- "PPID",
- "C",
- "STIME",
- "TTY",
- "TIME",
- "CMD"
]
}, - "Processes": {
- "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 Keep connection after returning logs. |
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 |
until | integer Default: 0 Only return logs before 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 |
Returns which files in a container's filesystem have been added, deleted,
or modified. The Kind
of modification can be one of:
0
: Modified ("C")1
: Added ("A")2
: Deleted ("D")id 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 the previous read, and is
used to calculate the CPU usage percentage. It is not an exact copy
of the cpu_stats
field.
If either precpu_stats.online_cpus
or cpu_stats.online_cpus
is
nil then for compatibility with older daemons the length of the
corresponding cpu_usage.percpu_usage
array should be used.
On a cgroup v2 host, the following fields are not set
blkio_stats
: all fields other than io_service_bytes_recursive
cpu_stats
: cpu_usage.percpu_usage
memory_stats
: max_usage
and failcnt
Also, memory_stats.stats
fields are incompatible with cgroup v1.To calculate the values shown by the stats
command of the docker cli tool
the following formulas can be used:
memory_stats.usage - memory_stats.stats.cache
memory_stats.limit
(used_memory / available_memory) * 100.0
cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage
cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage
length(cpu_stats.cpu_usage.percpu_usage)
or cpu_stats.online_cpus
(cpu_delta / system_cpu_delta) * number_cpus * 100.0
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. |
one-shot | boolean Default: false Only get a single stat instead of waiting for 2 cycles. Must be used
with |
{- "name": "boring_wozniak",
- "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
- "read": "2025-01-16T13:55:22.165243637Z",
- "preread": "2025-01-16T13:55:21.160452595Z",
- "pids_stats": {
- "current": 5,
- "limit": 18446744073709552000
}, - "blkio_stats": {
- "io_service_bytes_recursive": [
- {
- "major": 254,
- "minor": 0,
- "op": "read",
- "value": 7593984
}, - {
- "major": 254,
- "minor": 0,
- "op": "write",
- "value": 100
}
], - "io_serviced_recursive": null,
- "io_queue_recursive": null,
- "io_service_time_recursive": null,
- "io_wait_time_recursive": null,
- "io_merged_recursive": null,
- "io_time_recursive": null,
- "sectors_recursive": null
}, - "num_procs": 16,
- "storage_stats": {
- "read_count_normalized": 7593984,
- "read_size_bytes": 7593984,
- "write_count_normalized": 7593984,
- "write_size_bytes": 7593984
}, - "cpu_stats": {
- "cpu_usage": {
- "total_usage": 29912000,
- "percpu_usage": [
- 29912000
], - "usage_in_kernelmode": 21994000,
- "usage_in_usermode": 7918000
}, - "system_cpu_usage": 5,
- "online_cpus": 5,
- "throttling_data": {
- "periods": 0,
- "throttled_periods": 0,
- "throttled_time": 0
}
}, - "precpu_stats": {
- "cpu_usage": {
- "total_usage": 29912000,
- "percpu_usage": [
- 29912000
], - "usage_in_kernelmode": 21994000,
- "usage_in_usermode": 7918000
}, - "system_cpu_usage": 5,
- "online_cpus": 5,
- "throttling_data": {
- "periods": 0,
- "throttled_periods": 0,
- "throttled_time": 0
}
}, - "memory_stats": {
- "usage": 0,
- "max_usage": 0,
- "stats": {
- "active_anon": 1572864,
- "active_file": 5115904,
- "anon": 1572864,
- "anon_thp": 0,
- "file": 7626752,
- "file_dirty": 0,
- "file_mapped": 2723840,
- "file_writeback": 0,
- "inactive_anon": 0,
- "inactive_file": 2510848,
- "kernel_stack": 16384,
- "pgactivate": 0,
- "pgdeactivate": 0,
- "pgfault": 2042,
- "pglazyfree": 0,
- "pglazyfreed": 0,
- "pgmajfault": 45,
- "pgrefill": 0,
- "pgscan": 0,
- "pgsteal": 0,
- "shmem": 0,
- "slab": 1180928,
- "slab_reclaimable": 725576,
- "slab_unreclaimable": 455352,
- "sock": 0,
- "thp_collapse_alloc": 0,
- "thp_fault_alloc": 1,
- "unevictable": 0,
- "workingset_activate": 0,
- "workingset_nodereclaim": 0,
- "workingset_refault": 0
}, - "failcnt": 0,
- "limit": 8217579520,
- "commitbytes": 0,
- "commitpeakbytes": 0,
- "privateworkingset": 0
}, - "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
}
}
}
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": "No such container: c2ada9df5af8"
}
id required | string ID or name of the container |
signal | string Signal to send to the container as an integer or string (e.g. |
t | integer Number of seconds to wait before killing the container |
{- "message": "No such container: c2ada9df5af8"
}
id required | string ID or name of the container |
signal | string Signal to send to the container as an integer or string (e.g. |
t | integer Number of seconds to wait before killing the container |
{- "message": "No such container: c2ada9df5af8"
}
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 <int64> 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. | |
DeviceCgroupRules | Array of strings a list of cgroup rules to apply to the container |
Array of objects (DeviceRequest) A list of requests for devices to be sent to device drivers. | |
KernelMemoryTCP | integer <int64> Hard limit for kernel TCP buffer memory (in bytes). Depending on the OCI runtime in use, this option may be ignored. It is no longer supported by the default (runc) runtime. This field is omitted when empty. |
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. |
Init | boolean or null Run an init inside the container that forwards signals and reaps processes. This field is omitted if empty, and the default (as configured on the daemon) is used. |
PidsLimit | integer or null <int64> Tune a container's PIDs limit. Set |
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) 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,
- "RestartPolicy": {
- "MaximumRetryCount": 4,
- "Name": "on-failure"
}
}
{- "Warnings": [
- "Published ports are discarded when using host network mode"
]
}
Use the freezer cgroup 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 freezer
cgroup 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 HTTP Content-Type header is set to application/vnd.docker.multiplexed-stream
and 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 |
stdin | boolean Default: false Attach to |
stdout | boolean Default: false Attach to |
stderr | boolean Default: false Attach to |
{- "message": "Something went wrong."
}
Block until a container stops, then returns the exit code.
id required | string ID or name of the container |
condition | string Default: "not-running" Enum: "not-running" "next-exit" "removed" Wait until a container state reaches the given condition. Defaults to |
{- "StatusCode": 0,
- "Error": {
- "Message": "string"
}
}
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. |
link | boolean Default: false Remove the specified link associated with the container. |
{- "message": "Something went wrong."
}
A response header X-Docker-Container-Path-Stat
is returned, 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 a 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 |
copyUIDGID | string If |
The input stream must be a tar archive compressed with one of the
following algorithms: identity
(no compression), gzip
, bzip2
,
or xz
.
{- "message": "not a directory"
}
filters | string Filters to process on the prune list, encoded as JSON (a Available filters:
|
{- "ContainersDeleted": [
- "string"
], - "SpaceReclaimed": 0
}
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:
|
shared-size | boolean Default: false Compute and show shared size as a |
digests | boolean Default: false Show digest information as a |
manifests | boolean Default: false Include |
[- {
- "Id": "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710",
- "ParentId": "",
- "RepoTags": [
- "example:1.0",
- "example:latest",
- "example:stable",
- "internal.registry.example.com:5000/example:1.0"
], - "RepoDigests": [
- "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb",
- "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578"
], - "Created": "1644009612",
- "Size": 172064416,
- "SharedSize": 1239828,
- "VirtualSize": 172064416,
- "Labels": {
- "com.example.some-label": "some-value",
- "com.example.some-other-label": "some-other-value"
}, - "Containers": 2,
- "Manifests": [
- {
- "ID": "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f",
- "Descriptor": {
- "mediaType": "application/vnd.oci.image.manifest.v1+json",
- "digest": "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96",
- "size": 424,
- "annotations": {
- "com.docker.official-images.bashbrew.arch": "amd64",
- "org.opencontainers.image.base.digest": "sha256:0d0ef5c914d3ea700147da1bd050c59edb8bb12ca312f3800b29d7c8087eabd8",
- "org.opencontainers.image.base.name": "scratch",
- "org.opencontainers.image.created": "2025-01-27T00:00:00Z",
- "org.opencontainers.image.revision": "9fabb4bad5138435b01857e2fe9363e2dc5f6a79",
- "org.opencontainers.image.version": "24.04"
}, - "data": null,
- "platform": {
- "architecture": "arm",
- "os": "windows",
- "os.version": "10.0.19041.1165",
- "os.features": [
- "win32k"
], - "variant": "v7"
}, - "artifactType": null
}, - "Available": true,
- "Size": {
- "Total": 8213251,
- "Content": 3987495
}, - "Kind": "image",
- "ImageData": {
- "Platform": {
- "architecture": "arm",
- "os": "windows",
- "os.version": "10.0.19041.1165",
- "os.features": [
- "win32k"
], - "variant": "v7"
}, - "Containers": [
- "ede54ee1fda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c7430",
- "abadbce344c096744d8d6071a90d474d28af8f1034b5ea9fb03c3f4bfc6d005e"
], - "Size": {
- "Unpacked": 3987495
}
}, - "AttestationData": {
- "For": "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f"
}
}
], - "Descriptor": {
- "mediaType": "application/vnd.oci.image.manifest.v1+json",
- "digest": "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96",
- "size": 424,
- "annotations": {
- "com.docker.official-images.bashbrew.arch": "amd64",
- "org.opencontainers.image.base.digest": "sha256:0d0ef5c914d3ea700147da1bd050c59edb8bb12ca312f3800b29d7c8087eabd8",
- "org.opencontainers.image.base.name": "scratch",
- "org.opencontainers.image.created": "2025-01-27T00:00:00Z",
- "org.opencontainers.image.revision": "9fabb4bad5138435b01857e2fe9363e2dc5f6a79",
- "org.opencontainers.image.version": "24.04"
}, - "data": null,
- "platform": {
- "architecture": "arm",
- "os": "windows",
- "os.version": "10.0.19041.1165",
- "os.features": [
- "win32k"
], - "variant": "v7"
}, - "artifactType": null
}
}
]
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 |
extrahosts | string Extra hosts to add to /etc/hosts |
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 | string 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 For example, the build arg |
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: |
platform | string Default: "" Platform in the format os[/arch[/variant]] |
target | string Default: "" Target build stage |
outputs | string Default: "" BuildKit output configuration |
version | string Default: "1" Enum: "1" "2" Version of the builder backend to use.
|
Content-type | string Default: application/x-tar Value: "application/x-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."
}
keep-storage | integer <int64> Amount of disk space in bytes to keep for cache
|
reserved-space | integer <int64> Amount of disk space in bytes to keep for cache |
max-used-space | integer <int64> Maximum amount of disk space allowed to keep for cache |
min-free-space | integer <int64> Target amount of free disk space after pruning |
all | boolean Remove all types of build cache |
filters | string A JSON encoded value of the filters (a Available filters:
|
{- "CachesDeleted": [
- "string"
], - "SpaceReclaimed": 0
}
Pull or import an image.
fromImage | string Name of the image to pull. If the name includes a tag or digest, specific behavior applies:
|
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. |
message | string Set commit message for imported image. |
changes | Array of strings Apply Supported |
platform | string Default: "" Platform in the format os[/arch[/variant]]. When used in combination with the When used with the |
X-Registry-Auth | string A base64url-encoded auth configuration. Refer to 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 |
manifests | boolean Default: false Include Manifests in the image summary. |
{- "Id": "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710",
- "Descriptor": {
- "mediaType": "application/vnd.oci.image.manifest.v1+json",
- "digest": "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96",
- "size": 424,
- "annotations": {
- "com.docker.official-images.bashbrew.arch": "amd64",
- "org.opencontainers.image.base.digest": "sha256:0d0ef5c914d3ea700147da1bd050c59edb8bb12ca312f3800b29d7c8087eabd8",
- "org.opencontainers.image.base.name": "scratch",
- "org.opencontainers.image.created": "2025-01-27T00:00:00Z",
- "org.opencontainers.image.revision": "9fabb4bad5138435b01857e2fe9363e2dc5f6a79",
- "org.opencontainers.image.version": "24.04"
}, - "data": null,
- "platform": {
- "architecture": "arm",
- "os": "windows",
- "os.version": "10.0.19041.1165",
- "os.features": [
- "win32k"
], - "variant": "v7"
}, - "artifactType": null
}, - "Manifests": [
- {
- "ID": "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f",
- "Descriptor": {
- "mediaType": "application/vnd.oci.image.manifest.v1+json",
- "digest": "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96",
- "size": 424,
- "annotations": {
- "com.docker.official-images.bashbrew.arch": "amd64",
- "org.opencontainers.image.base.digest": "sha256:0d0ef5c914d3ea700147da1bd050c59edb8bb12ca312f3800b29d7c8087eabd8",
- "org.opencontainers.image.base.name": "scratch",
- "org.opencontainers.image.created": "2025-01-27T00:00:00Z",
- "org.opencontainers.image.revision": "9fabb4bad5138435b01857e2fe9363e2dc5f6a79",
- "org.opencontainers.image.version": "24.04"
}, - "data": null,
- "platform": {
- "architecture": "arm",
- "os": "windows",
- "os.version": "10.0.19041.1165",
- "os.features": [
- "win32k"
], - "variant": "v7"
}, - "artifactType": null
}, - "Available": true,
- "Size": {
- "Total": 8213251,
- "Content": 3987495
}, - "Kind": "image",
- "ImageData": {
- "Platform": {
- "architecture": "arm",
- "os": "windows",
- "os.version": "10.0.19041.1165",
- "os.features": [
- "win32k"
], - "variant": "v7"
}, - "Containers": [
- "ede54ee1fda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c7430",
- "abadbce344c096744d8d6071a90d474d28af8f1034b5ea9fb03c3f4bfc6d005e"
], - "Size": {
- "Unpacked": 3987495
}
}, - "AttestationData": {
- "For": "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f"
}
}
], - "RepoTags": [
- "example:1.0",
- "example:latest",
- "example:stable",
- "internal.registry.example.com:5000/example:1.0"
], - "RepoDigests": [
- "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb",
- "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578"
], - "Parent": "",
- "Comment": "",
- "Created": "2022-02-04T21:20:12.497794809Z",
- "DockerVersion": "27.0.1",
- "Author": "",
- "Config": {
- "Hostname": "",
- "Domainname": "",
- "User": "web:web",
- "AttachStdin": false,
- "AttachStdout": false,
- "AttachStderr": false,
- "ExposedPorts": {
- "80/tcp": { },
- "443/tcp": { }
}, - "Tty": false,
- "OpenStdin": false,
- "StdinOnce": false,
- "Env": [
- "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
], - "Cmd": [
- "/bin/sh"
], - "Healthcheck": {
- "Test": [
- "string"
], - "Interval": 0,
- "Timeout": 0,
- "Retries": 0,
- "StartPeriod": 0,
- "StartInterval": 0
}, - "ArgsEscaped": true,
- "Image": "",
- "Volumes": {
- "/app/data": { },
- "/app/config": { }
}, - "WorkingDir": "/public/",
- "Entrypoint": [ ],
- "OnBuild": [ ],
- "Labels": {
- "com.example.some-label": "some-value",
- "com.example.some-other-label": "some-other-value"
}, - "StopSignal": "SIGTERM",
- "Shell": [
- "/bin/sh",
- "-c"
]
}, - "Architecture": "arm",
- "Variant": "v7",
- "Os": "linux",
- "OsVersion": "",
- "Size": 1239828,
- "VirtualSize": 1239828,
- "GraphDriver": {
- "Name": "overlay2",
- "Data": {
- "MergedDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/merged",
- "UpperDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/diff",
- "WorkDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/work"
}
}, - "RootFS": {
- "Type": "layers",
- "Layers": [
- "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6",
- "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef"
]
}, - "Metadata": {
- "LastTagTime": "2022-02-28T14:40:02.623929178Z"
}
}
Return parent layers of an image.
name required | string Image name or ID |
platform | string JSON-encoded OCI platform to select the platform-variant. If omitted, it defaults to any locally available platform, prioritizing the daemon's host platform. If the daemon provides a multi-platform image store, this selects the platform-variant to show the history for. If the image is a single-platform image, or if the multi-platform image does not provide a variant matching the given platform, an error is returned. Example: |
[- {
- "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, |
platform | string JSON-encoded OCI platform to select the platform-variant to push. If not provided, all available variants will attempt to be pushed. If the daemon provides a multi-platform image store, this selects the platform-variant to push to the registry. If the image is a single-platform image, or if the multi-platform image does not provide a variant matching the given platform, an error is returned. Example: |
X-Registry-Auth required | string A base64url-encoded auth configuration. Refer to 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": "A minimal Docker image based on Alpine Linux with a complete package index and only 5 MB in size!",
- "is_official": true,
- "is_automated": false,
- "name": "alpine",
- "star_count": 10093
}, - {
- "description": "Busybox base image.",
- "is_official": true,
- "is_automated": false,
- "name": "Busybox base image.",
- "star_count": 3037
}, - {
- "description": "The PostgreSQL object-relational database system provides reliability and data integrity.",
- "is_official": true,
- "is_automated": false,
- "name": "postgres",
- "star_count": 12408
}
]
filters | string Filters to process on the prune list, encoded as JSON (a
|
{- "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 Commands run as this user inside the container. If omitted, commands run as the user specified in the image the container was started from. Can be either user-name or UID, and optional group-name or GID,
separated by a colon ( |
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 or null 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 |
Cmd | Array of strings Command to run specified as a string or an array of strings. |
object (HealthConfig) A test to perform to check that the container is healthy. | |
ArgsEscaped | boolean or null Default: false Command is already escaped (Windows only) |
Image | string The name (or reference) of the image to use when creating the container, or which was used when the container was created. |
object An object mapping mount point paths inside the container to empty objects. | |
WorkingDir | string The working directory for commands to run in. |
Entrypoint | Array of strings 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 or null Disable networking for the container. |
MacAddress | string or null MAC address of the container. Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. |
OnBuild | Array of strings or null
|
object User-defined key/value metadata. | |
StopSignal | string or null Signal to stop a container as a string or unsigned integer. |
StopTimeout | integer or null Default: 10 Timeout to stop a container in seconds. |
Shell | Array of strings or null Shell for when |
{- "Hostname": "439f4e91bd1d",
- "Domainname": "string",
- "User": "123:456",
- "AttachStdin": false,
- "AttachStdout": true,
- "AttachStderr": true,
- "ExposedPorts": {
- "80/tcp": { },
- "443/tcp": { }
}, - "Tty": false,
- "OpenStdin": false,
- "StdinOnce": false,
- "Env": [
- "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
], - "Cmd": [
- "/bin/sh"
], - "Healthcheck": {
- "Test": [
- "string"
], - "Interval": 0,
- "Timeout": 0,
- "Retries": 0,
- "StartPeriod": 0,
- "StartInterval": 0
}, - "ArgsEscaped": false,
- "Image": "example-image:1.0",
- "Volumes": {
- "property1": { },
- "property2": { }
}, - "WorkingDir": "/public/",
- "Entrypoint": [ ],
- "NetworkDisabled": true,
- "MacAddress": "string",
- "OnBuild": [ ],
- "Labels": {
- "com.example.some-label": "some-value",
- "com.example.some-other-label": "some-other-value"
}, - "StopSignal": "SIGTERM",
- "StopTimeout": 10,
- "Shell": [
- "/bin/sh",
- "-c"
]
}
{- "Id": "string"
}
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. |
platform | string JSON encoded OCI platform describing a platform which will be used to select a platform-specific image to be load if the image is multi-platform. If not provided, the full multi-platform image will be loaded. Example: |
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.
Returns a list of networks. For details on the format, see the network inspect endpoint.
Note that it uses a different, smaller representation of a network than inspecting a single network. For example, the list of containers attached to the network is not propagated in API versions 1.28 and up.
filters | string JSON encoded value of the filters (a Available filters:
|
[- {
- "Name": "bridge",
- "Id": "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566",
- "Created": "2016-10-19T06:21:00.416543526Z",
- "Scope": "local",
- "Driver": "bridge",
- "EnableIPv4": true,
- "EnableIPv6": false,
- "Internal": false,
- "Attachable": false,
- "Ingress": false,
- "IPAM": {
- "Driver": "default",
- "Config": [
- {
- "Subnet": "172.17.0.0/16"
}
]
}, - "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",
- "EnableIPv4": false,
- "EnableIPv6": false,
- "Internal": false,
- "Attachable": false,
- "Ingress": false,
- "IPAM": {
- "Driver": "default",
- "Config": [ ]
}, - "Containers": { },
- "Options": { }
}, - {
- "Name": "host",
- "Id": "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e",
- "Created": "0001-01-01T00:00:00Z",
- "Scope": "local",
- "Driver": "host",
- "EnableIPv4": false,
- "EnableIPv6": false,
- "Internal": false,
- "Attachable": false,
- "Ingress": false,
- "IPAM": {
- "Driver": "default",
- "Config": [ ]
}, - "Containers": { },
- "Options": { }
}
]
id required | string Network ID or name |
verbose | boolean Default: false Detailed inspect output for troubleshooting |
scope | string Filter the network by scope (swarm, global, or local) |
{- "Name": "my_network",
- "Id": "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99",
- "Created": "2016-10-19T04:33:30.360899459Z",
- "Scope": "local",
- "Driver": "overlay",
- "EnableIPv4": true,
- "EnableIPv6": false,
- "IPAM": {
- "Driver": "default",
- "Config": [
- {
- "Subnet": "172.20.0.0/16",
- "IPRange": "172.20.10.0/24",
- "Gateway": "172.20.10.11",
- "AuxiliaryAddresses": {
- "property1": "string",
- "property2": "string"
}
}
], - "Options": {
- "foo": "bar"
}
}, - "Internal": false,
- "Attachable": false,
- "Ingress": false,
- "ConfigFrom": {
- "Network": "config_only_network_01"
}, - "ConfigOnly": 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"
}, - "Peers": [
- {
- "Name": "6869d7c1732b",
- "IP": "10.133.77.91"
}
]
}
Network configuration
Name required | string The network's name. |
Driver | string Default: "bridge" Name of the network driver plugin to use. |
Scope | string The level at which the network exists (e.g. |
Internal | boolean Restrict external access to the network. |
Attachable | boolean Globally scoped network is manually attachable by regular containers from workers in swarm mode. |
Ingress | boolean Ingress network is the network which provides the routing-mesh in swarm mode. |
ConfigOnly | boolean Default: false Creates a config-only network. Config-only networks are placeholder networks for network configurations to be used by other networks. Config-only networks cannot be used directly to run containers or services. |
object (ConfigReference) The config-only network source to provide the configuration for this network. | |
object (IPAM) | |
EnableIPv4 | boolean Enable IPv4 on the network. |
EnableIPv6 | boolean Enable IPv6 on the network. |
object Network specific options to be used by the drivers. | |
object User-defined key/value metadata. |
{- "Name": "my_network",
- "Driver": "bridge",
- "Scope": "string",
- "Internal": true,
- "Attachable": true,
- "Ingress": false,
- "ConfigOnly": false,
- "ConfigFrom": {
- "Network": "config_only_network_01"
}, - "IPAM": {
- "Driver": "default",
- "Config": [
- {
- "Subnet": "172.20.0.0/16",
- "IPRange": "172.20.10.0/24",
- "Gateway": "172.20.10.11",
- "AuxiliaryAddresses": {
- "property1": "string",
- "property2": "string"
}
}
], - "Options": {
- "foo": "bar"
}
}, - "EnableIPv4": true,
- "EnableIPv6": 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": "b5c4fc71e8022147cd25de22b22173de4e3b170134117172eb595cb91b4e7e5d",
- "Warning": ""
}
The network must be either a local-scoped network or a swarm-scoped network with the attachable
option set. A network cannot be re-attached to a running container
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. |
{- "Container": "3613f73ba0e4",
- "EndpointConfig": {
- "IPAMConfig": {
- "IPv4Address": "172.24.56.89",
- "IPv6Address": "2001:db8::5689"
}, - "MacAddress": "02:42:ac:12:05:02",
- "Priority": 100
}
}
{- "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 Filters to process on the prune list, encoded as JSON (a Available filters:
|
{- "NetworksDeleted": [
- "string"
]
}
filters | string <json> JSON encoded value of the filters (a
|
{- "Volumes": [
- {
- "Name": "tardis",
- "Driver": "custom",
- "Mountpoint": "/var/lib/docker/volumes/tardis",
- "CreatedAt": "2016-06-07T20:31:11.853781916Z",
- "Status": {
- "hello": "world"
}, - "Labels": {
- "com.example.some-label": "some-value",
- "com.example.some-other-label": "some-other-value"
}, - "Scope": "local",
- "ClusterVolume": {
- "ID": "string",
- "Version": {
- "Index": 373531
}, - "CreatedAt": "string",
- "UpdatedAt": "string",
- "Spec": {
- "Group": "string",
- "AccessMode": {
- "Scope": "single",
- "Sharing": "none",
- "MountVolume": { },
- "Secrets": [
- {
- "Key": "string",
- "Secret": "string"
}
], - "AccessibilityRequirements": {
- "Requisite": [
- {
- "property1": "string",
- "property2": "string"
}
], - "Preferred": [
- {
- "property1": "string",
- "property2": "string"
}
]
}, - "CapacityRange": {
- "RequiredBytes": 0,
- "LimitBytes": 0
}, - "Availability": "active"
}
}, - "Info": {
- "CapacityBytes": 0,
- "VolumeContext": {
- "property1": "string",
- "property2": "string"
}, - "VolumeID": "string",
- "AccessibleTopology": [
- {
- "property1": "string",
- "property2": "string"
}
]
}, - "PublishStatus": [
- {
- "NodeID": "string",
- "State": "pending-publish",
- "PublishContext": {
- "property1": "string",
- "property2": "string"
}
}
]
}, - "Options": {
- "device": "tmpfs",
- "o": "size=100m,uid=1000",
- "type": "tmpfs"
}, - "UsageData": {
- "Size": -1,
- "RefCount": -1
}
}
], - "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. | |
object (ClusterVolumeSpec) Cluster-specific options used to create the volume. |
{- "Name": "tardis",
- "Driver": "custom",
- "DriverOpts": {
- "device": "tmpfs",
- "o": "size=100m,uid=1000",
- "type": "tmpfs"
}, - "Labels": {
- "com.example.some-label": "some-value",
- "com.example.some-other-label": "some-other-value"
}, - "ClusterVolumeSpec": {
- "Group": "string",
- "AccessMode": {
- "Scope": "single",
- "Sharing": "none",
- "MountVolume": { },
- "Secrets": [
- {
- "Key": "string",
- "Secret": "string"
}
], - "AccessibilityRequirements": {
- "Requisite": [
- {
- "property1": "string",
- "property2": "string"
}
], - "Preferred": [
- {
- "property1": "string",
- "property2": "string"
}
]
}, - "CapacityRange": {
- "RequiredBytes": 0,
- "LimitBytes": 0
}, - "Availability": "active"
}
}
}
{- "Name": "tardis",
- "Driver": "custom",
- "Mountpoint": "/var/lib/docker/volumes/tardis",
- "CreatedAt": "2016-06-07T20:31:11.853781916Z",
- "Status": {
- "hello": "world"
}, - "Labels": {
- "com.example.some-label": "some-value",
- "com.example.some-other-label": "some-other-value"
}, - "Scope": "local",
- "ClusterVolume": {
- "ID": "string",
- "Version": {
- "Index": 373531
}, - "CreatedAt": "string",
- "UpdatedAt": "string",
- "Spec": {
- "Group": "string",
- "AccessMode": {
- "Scope": "single",
- "Sharing": "none",
- "MountVolume": { },
- "Secrets": [
- {
- "Key": "string",
- "Secret": "string"
}
], - "AccessibilityRequirements": {
- "Requisite": [
- {
- "property1": "string",
- "property2": "string"
}
], - "Preferred": [
- {
- "property1": "string",
- "property2": "string"
}
]
}, - "CapacityRange": {
- "RequiredBytes": 0,
- "LimitBytes": 0
}, - "Availability": "active"
}
}, - "Info": {
- "CapacityBytes": 0,
- "VolumeContext": {
- "property1": "string",
- "property2": "string"
}, - "VolumeID": "string",
- "AccessibleTopology": [
- {
- "property1": "string",
- "property2": "string"
}
]
}, - "PublishStatus": [
- {
- "NodeID": "string",
- "State": "pending-publish",
- "PublishContext": {
- "property1": "string",
- "property2": "string"
}
}
]
}, - "Options": {
- "device": "tmpfs",
- "o": "size=100m,uid=1000",
- "type": "tmpfs"
}, - "UsageData": {
- "Size": -1,
- "RefCount": -1
}
}
{- "Name": "tardis",
- "Driver": "custom",
- "Mountpoint": "/var/lib/docker/volumes/tardis",
- "CreatedAt": "2016-06-07T20:31:11.853781916Z",
- "Status": {
- "hello": "world"
}, - "Labels": {
- "com.example.some-label": "some-value",
- "com.example.some-other-label": "some-other-value"
}, - "Scope": "local",
- "ClusterVolume": {
- "ID": "string",
- "Version": {
- "Index": 373531
}, - "CreatedAt": "string",
- "UpdatedAt": "string",
- "Spec": {
- "Group": "string",
- "AccessMode": {
- "Scope": "single",
- "Sharing": "none",
- "MountVolume": { },
- "Secrets": [
- {
- "Key": "string",
- "Secret": "string"
}
], - "AccessibilityRequirements": {
- "Requisite": [
- {
- "property1": "string",
- "property2": "string"
}
], - "Preferred": [
- {
- "property1": "string",
- "property2": "string"
}
]
}, - "CapacityRange": {
- "RequiredBytes": 0,
- "LimitBytes": 0
}, - "Availability": "active"
}
}, - "Info": {
- "CapacityBytes": 0,
- "VolumeContext": {
- "property1": "string",
- "property2": "string"
}, - "VolumeID": "string",
- "AccessibleTopology": [
- {
- "property1": "string",
- "property2": "string"
}
]
}, - "PublishStatus": [
- {
- "NodeID": "string",
- "State": "pending-publish",
- "PublishContext": {
- "property1": "string",
- "property2": "string"
}
}
]
}, - "Options": {
- "device": "tmpfs",
- "o": "size=100m,uid=1000",
- "type": "tmpfs"
}, - "UsageData": {
- "Size": -1,
- "RefCount": -1
}
}
name required | string The name or ID of the volume |
version required | integer <int64> The version number of the volume being updated. This is required to
avoid conflicting writes. Found in the volume's |
The spec of the volume to update. Currently, only Availability may change. All other fields must remain unchanged.
object (ClusterVolumeSpec) Cluster-specific options used to create the volume. |
{- "Spec": {
- "Group": "string",
- "AccessMode": {
- "Scope": "single",
- "Sharing": "none",
- "MountVolume": { },
- "Secrets": [
- {
- "Key": "string",
- "Secret": "string"
}
], - "AccessibilityRequirements": {
- "Requisite": [
- {
- "property1": "string",
- "property2": "string"
}
], - "Preferred": [
- {
- "property1": "string",
- "property2": "string"
}
]
}, - "CapacityRange": {
- "RequiredBytes": 0,
- "LimitBytes": 0
}, - "Availability": "active"
}
}
}
{- "message": "Something went wrong."
}
filters | string Filters to process on the prune list, encoded as JSON (a Available filters:
|
{- "VolumesDeleted": [
- "string"
], - "SpaceReclaimed": 0
}
Run new commands inside running containers. Refer to 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 |
ConsoleSize | Array of integers or null = 2 items [ items >= 0 ] Initial console size, as an |
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: |
WorkingDir | string The working directory for the exec process inside the container. |
{- "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. |
ConsoleSize | Array of integers or null = 2 items [ items >= 0 ] Initial console size, as an |
{- "Detach": false,
- "Tty": true,
- "ConsoleSize": [
- 80,
- 64
]
}
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
}
Engines can be clustered together in a swarm. Refer to the swarm mode documentation for more information.
{- "ID": "abajmipo7b4xz5ip2nrla6b11",
- "Version": {
- "Index": 373531
}, - "CreatedAt": "2016-08-18T10:44:24.496525531Z",
- "UpdatedAt": "2017-08-09T07:09:37.632105588Z",
- "Spec": {
- "Name": "default",
- "Labels": {
- "com.example.corp.type": "production",
- "com.example.corp.department": "engineering"
}, - "Orchestration": {
- "TaskHistoryRetentionLimit": 10
}, - "Raft": {
- "SnapshotInterval": 10000,
- "KeepOldSnapshots": 0,
- "LogEntriesForSlowFollowers": 500,
- "ElectionTick": 3,
- "HeartbeatTick": 1
}, - "Dispatcher": {
- "HeartbeatPeriod": 5000000000
}, - "CAConfig": {
- "NodeCertExpiry": 7776000000000000,
- "ExternalCAs": [
- {
- "Protocol": "cfssl",
- "URL": "string",
- "Options": {
- "property1": "string",
- "property2": "string"
}, - "CACert": "string"
}
], - "SigningCACert": "string",
- "SigningCAKey": "string",
- "ForceRotate": 0
}, - "EncryptionConfig": {
- "AutoLockManagers": false
}, - "TaskDefaults": {
- "LogDriver": {
- "Name": "json-file",
- "Options": {
- "max-file": "10",
- "max-size": "100m"
}
}
}
}, - "TLSInfo": {
- "TrustRoot": "-----BEGIN CERTIFICATE-----\nMIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0\nMzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf\n3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO\nPQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz\npxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H\n-----END CERTIFICATE-----\n",
- "CertIssuerSubject": "MBMxETAPBgNVBAMTCHN3YXJtLWNh",
- "CertIssuerPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A=="
}, - "RootRotationInProgress": false,
- "DataPathPort": 4789,
- "DefaultAddrPool": [
- [
- "10.10.0.0/16",
- "20.20.0.0/16"
]
], - "SubnetSize": 24,
- "JoinTokens": {
- "Worker": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx",
- "Manager": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2"
}
}
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
|
DataPathAddr | string Address or interface to use for data path traffic (format:
The |
DataPathPort | integer <uint32> DataPathPort specifies the data path port number for data traffic. Acceptable port range is 1024 to 49151. if no port is set or is set to 0, default port 4789 will be used. |
DefaultAddrPool | Array of strings Default Address Pool specifies default subnet pools for global scope networks. |
ForceNewCluster | boolean Force creation of a new swarm. |
SubnetSize | integer <uint32> SubnetSize specifies the subnet size of the networks created from the default subnet pool. |
object (SwarmSpec) User modifiable swarm configuration. |
{- "ListenAddr": "0.0.0.0:2377",
- "AdvertiseAddr": "192.168.1.1:2377",
- "DataPathPort": 4789,
- "DefaultAddrPool": [
- "10.10.0.0/8",
- "20.20.0.0/8"
], - "SubnetSize": 24,
- "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
|
DataPathAddr | string Address or interface to use for data path traffic (format:
The |
RemoteAddrs | Array of strings 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",
- "DataPathAddr": "192.168.1.1",
- "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 or null Orchestration configuration. | |
object Raft configuration. | |
object or null Dispatcher configuration. | |
object or null CA configuration. | |
object Parameters related to encryption-at-rest. | |
object Defaults for creating tasks in this cluster. |
{- "Name": "default",
- "Labels": {
- "com.example.corp.type": "production",
- "com.example.corp.department": "engineering"
}, - "Orchestration": {
- "TaskHistoryRetentionLimit": 10
}, - "Raft": {
- "SnapshotInterval": 10000,
- "KeepOldSnapshots": 0,
- "LogEntriesForSlowFollowers": 500,
- "ElectionTick": 3,
- "HeartbeatTick": 1
}, - "Dispatcher": {
- "HeartbeatPeriod": 5000000000
}, - "CAConfig": {
- "NodeCertExpiry": 7776000000000000,
- "ExternalCAs": [
- {
- "Protocol": "cfssl",
- "URL": "string",
- "Options": {
- "property1": "string",
- "property2": "string"
}, - "CACert": "string"
}
], - "SigningCACert": "string",
- "SigningCAKey": "string",
- "ForceRotate": 0
}, - "EncryptionConfig": {
- "AutoLockManagers": false
}, - "TaskDefaults": {
- "LogDriver": {
- "Name": "json-file",
- "Options": {
- "max-file": "10",
- "max-size": "100m"
}
}
}
}
{- "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": 373531
}, - "CreatedAt": "2016-08-18T10:44:24.496525531Z",
- "UpdatedAt": "2017-08-09T07:09:37.632105588Z",
- "Spec": {
- "Availability": "active",
- "Name": "node-name",
- "Role": "manager",
- "Labels": {
- "foo": "bar"
}
}, - "Description": {
- "Hostname": "bf3067039e47",
- "Platform": {
- "Architecture": "x86_64",
- "OS": "linux"
}, - "Resources": {
- "NanoCPUs": 4000000000,
- "MemoryBytes": 8272408576,
- "GenericResources": [
- {
- "DiscreteResourceSpec": {
- "Kind": "SSD",
- "Value": 3
}
}, - {
- "NamedResourceSpec": {
- "Kind": "GPU",
- "Value": "UUID1"
}
}, - {
- "NamedResourceSpec": {
- "Kind": "GPU",
- "Value": "UUID2"
}
}
]
}, - "Engine": {
- "EngineVersion": "17.06.0",
- "Labels": {
- "foo": "bar"
}, - "Plugins": [
- {
- "Type": "Log",
- "Name": "awslogs"
}, - {
- "Type": "Log",
- "Name": "fluentd"
}, - {
- "Type": "Log",
- "Name": "gcplogs"
}, - {
- "Type": "Log",
- "Name": "gelf"
}, - {
- "Type": "Log",
- "Name": "journald"
}, - {
- "Type": "Log",
- "Name": "json-file"
}, - {
- "Type": "Log",
- "Name": "splunk"
}, - {
- "Type": "Log",
- "Name": "syslog"
}, - {
- "Type": "Network",
- "Name": "bridge"
}, - {
- "Type": "Network",
- "Name": "host"
}, - {
- "Type": "Network",
- "Name": "ipvlan"
}, - {
- "Type": "Network",
- "Name": "macvlan"
}, - {
- "Type": "Network",
- "Name": "null"
}, - {
- "Type": "Network",
- "Name": "overlay"
}, - {
- "Type": "Volume",
- "Name": "local"
}, - {
- "Type": "Volume",
- "Name": "localhost:5000/vieux/sshfs:latest"
}, - {
- "Type": "Volume",
- "Name": "vieux/sshfs:latest"
}
]
}, - "TLSInfo": {
- "TrustRoot": "-----BEGIN CERTIFICATE-----\nMIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0\nMzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf\n3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO\nPQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz\npxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H\n-----END CERTIFICATE-----\n",
- "CertIssuerSubject": "MBMxETAPBgNVBAMTCHN3YXJtLWNh",
- "CertIssuerPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A=="
}
}, - "Status": {
- "State": "ready",
- "Message": "",
- "Addr": "172.17.0.2"
}, - "ManagerStatus": {
- "Leader": true,
- "Reachability": "reachable",
- "Addr": "10.0.0.46:2377"
}
}
]
{- "ID": "24ifsmvkjbyhk",
- "Version": {
- "Index": 373531
}, - "CreatedAt": "2016-08-18T10:44:24.496525531Z",
- "UpdatedAt": "2017-08-09T07:09:37.632105588Z",
- "Spec": {
- "Availability": "active",
- "Name": "node-name",
- "Role": "manager",
- "Labels": {
- "foo": "bar"
}
}, - "Description": {
- "Hostname": "bf3067039e47",
- "Platform": {
- "Architecture": "x86_64",
- "OS": "linux"
}, - "Resources": {
- "NanoCPUs": 4000000000,
- "MemoryBytes": 8272408576,
- "GenericResources": [
- {
- "DiscreteResourceSpec": {
- "Kind": "SSD",
- "Value": 3
}
}, - {
- "NamedResourceSpec": {
- "Kind": "GPU",
- "Value": "UUID1"
}
}, - {
- "NamedResourceSpec": {
- "Kind": "GPU",
- "Value": "UUID2"
}
}
]
}, - "Engine": {
- "EngineVersion": "17.06.0",
- "Labels": {
- "foo": "bar"
}, - "Plugins": [
- {
- "Type": "Log",
- "Name": "awslogs"
}, - {
- "Type": "Log",
- "Name": "fluentd"
}, - {
- "Type": "Log",
- "Name": "gcplogs"
}, - {
- "Type": "Log",
- "Name": "gelf"
}, - {
- "Type": "Log",
- "Name": "journald"
}, - {
- "Type": "Log",
- "Name": "json-file"
}, - {
- "Type": "Log",
- "Name": "splunk"
}, - {
- "Type": "Log",
- "Name": "syslog"
}, - {
- "Type": "Network",
- "Name": "bridge"
}, - {
- "Type": "Network",
- "Name": "host"
}, - {
- "Type": "Network",
- "Name": "ipvlan"
}, - {
- "Type": "Network",
- "Name": "macvlan"
}, - {
- "Type": "Network",
- "Name": "null"
}, - {
- "Type": "Network",
- "Name": "overlay"
}, - {
- "Type": "Volume",
- "Name": "local"
}, - {
- "Type": "Volume",
- "Name": "localhost:5000/vieux/sshfs:latest"
}, - {
- "Type": "Volume",
- "Name": "vieux/sshfs:latest"
}
]
}, - "TLSInfo": {
- "TrustRoot": "-----BEGIN CERTIFICATE-----\nMIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0\nMzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf\n3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO\nPQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz\npxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H\n-----END CERTIFICATE-----\n",
- "CertIssuerSubject": "MBMxETAPBgNVBAMTCHN3YXJtLWNh",
- "CertIssuerPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A=="
}
}, - "Status": {
- "State": "ready",
- "Message": "",
- "Addr": "172.17.0.2"
}, - "ManagerStatus": {
- "Leader": true,
- "Reachability": "reachable",
- "Addr": "10.0.0.46: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 Available filters:
|
status | boolean Include service status, with count of running and desired tasks. |
[- {
- "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,
- "Delay": 1000000000,
- "FailureAction": "pause",
- "Monitor": 15000000000,
- "MaxFailureRatio": 0.15
}, - "RollbackConfig": {
- "Parallelism": 1,
- "Delay": 1000000000,
- "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 base64url-encoded auth configuration for pulling from private registries. Refer to 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. | |
object Specification for the rollback strategy of the service. | |
Array of objects (NetworkAttachmentConfig) Specifies which networks the service should attach to. Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. | |
object (EndpointSpec) Properties that can be configured to access and load balance a service. |
{- "Name": "web",
- "Labels": {
- "property1": "string",
- "property2": "string",
- "foo": "bar"
}, - "TaskTemplate": {
- "PluginSpec": {
- "Name": "string",
- "Remote": "string",
- "Disabled": true,
- "PluginPrivilege": [
- {
- "Name": "network",
- "Description": "string",
- "Value": [
- "host"
]
}
]
}, - "ContainerSpec": {
- "Image": "nginx:alpine",
- "Labels": {
- "property1": "string",
- "property2": "string"
}, - "Command": [
- "string"
], - "Args": [
- "string"
], - "Hostname": "string",
- "Env": [
- "string"
], - "Dir": "string",
- "User": "33",
- "Groups": [
- "string"
], - "Privileges": {
- "CredentialSpec": {
- "Config": "0bt9dmxjvjiqermk6xrop3ekq",
- "File": "spec.json",
- "Registry": "string"
}, - "SELinuxContext": {
- "Disable": true,
- "User": "string",
- "Role": "string",
- "Type": "string",
- "Level": "string"
}, - "Seccomp": {
- "Mode": "default",
- "Profile": "string"
}, - "AppArmor": {
- "Mode": "default"
}, - "NoNewPrivileges": true
}, - "TTY": true,
- "OpenStdin": true,
- "ReadOnly": true,
- "Mounts": [
- {
- "Target": "/usr/share/nginx/html",
- "Source": "web-data",
- "Type": "volume",
- "ReadOnly": true,
- "Consistency": "string",
- "BindOptions": {
- "Propagation": "private",
- "NonRecursive": false,
- "CreateMountpoint": false,
- "ReadOnlyNonRecursive": false,
- "ReadOnlyForceRecursive": false
}, - "VolumeOptions": {
- "NoCopy": false,
- "Labels": {
- "property1": "string",
- "property2": "string",
- "com.example.something": "something-value"
}, - "DriverConfig": {
- "Name": "string",
- "Options": {
- "property1": "string",
- "property2": "string"
}
}, - "Subpath": "dir-inside-volume/subdirectory"
}, - "ImageOptions": {
- "Subpath": "dir-inside-image/subdirectory"
}, - "TmpfsOptions": {
- "SizeBytes": 0,
- "Mode": 0,
- "Options": [
- [
- "noexec"
]
]
}
}
], - "StopSignal": "string",
- "StopGracePeriod": 0,
- "HealthCheck": {
- "Test": [
- "string"
], - "Interval": 0,
- "Timeout": 0,
- "Retries": 0,
- "StartPeriod": 0,
- "StartInterval": 0
}, - "Hosts": [
- "10.10.10.10 host1",
- "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789 host2"
], - "DNSConfig": {
- "Nameservers": [
- "8.8.8.8"
], - "Search": [
- "example.org"
], - "Options": [
- "timeout:3"
]
}, - "Secrets": [
- {
- "File": {
- "Name": "www.example.org.key",
- "UID": "33",
- "GID": "33",
- "Mode": 384
}, - "SecretID": "fpjqlhnwb19zds35k8wn80lq9",
- "SecretName": "example_org_domain_key"
}
], - "OomScoreAdj": 0,
- "Configs": [
- {
- "File": {
- "Name": "string",
- "UID": "string",
- "GID": "string",
- "Mode": 0
}, - "Runtime": { },
- "ConfigID": "string",
- "ConfigName": "string"
}
], - "Isolation": "default",
- "Init": true,
- "Sysctls": {
- "property1": "string",
- "property2": "string"
}, - "CapabilityAdd": [
- "CAP_NET_RAW",
- "CAP_SYS_ADMIN",
- "CAP_SYS_CHROOT",
- "CAP_SYSLOG"
], - "CapabilityDrop": [
- "CAP_NET_RAW"
], - "Ulimits": [
- {
- "Name": "string",
- "Soft": 0,
- "Hard": 0
}
]
}, - "NetworkAttachmentSpec": {
- "ContainerID": "string"
}, - "Resources": {
- "Limits": {
- "NanoCPUs": 4000000000,
- "MemoryBytes": 104857600,
- "Pids": 100
}, - "Reservations": {
- "NanoCPUs": 4000000000,
- "MemoryBytes": 8272408576,
- "GenericResources": [
- {
- "DiscreteResourceSpec": {
- "Kind": "SSD",
- "Value": 3
}
}, - {
- "NamedResourceSpec": {
- "Kind": "GPU",
- "Value": "UUID1"
}
}, - {
- "NamedResourceSpec": {
- "Kind": "GPU",
- "Value": "UUID2"
}
}
]
}
}, - "RestartPolicy": {
- "Condition": "on-failure",
- "Delay": 10000000000,
- "MaxAttempts": 10,
- "Window": 0
}, - "Placement": {
- "Constraints": [
- "node.hostname!=node3.corp.example.com",
- "node.role!=manager",
- "node.labels.type==production",
- "node.platform.os==linux",
- "node.platform.arch==x86_64"
], - "Preferences": [
- {
- "Spread": {
- "SpreadDescriptor": "node.labels.datacenter"
}
}, - {
- "Spread": {
- "SpreadDescriptor": "node.labels.rack"
}
}
], - "MaxReplicas": 0,
- "Platforms": [
- {
- "Architecture": "x86_64",
- "OS": "linux"
}
]
}, - "ForceUpdate": 0,
- "Runtime": "string",
- "Networks": [
- {
- "Target": "string",
- "Aliases": [
- "string"
], - "DriverOpts": {
- "property1": "string",
- "property2": "string"
}
}
], - "LogDriver": {
- "Name": "json-file",
- "Options": {
- "property1": "string",
- "property2": "string",
- "max-file": "3",
- "max-size": "10M"
}
}
}, - "Mode": {
- "Replicated": {
- "Replicas": 4
}, - "Global": { },
- "ReplicatedJob": {
- "MaxConcurrent": 1,
- "TotalCompletions": 0
}, - "GlobalJob": { }
}, - "UpdateConfig": {
- "Parallelism": 2,
- "Delay": 1000000000,
- "FailureAction": "pause",
- "Monitor": 15000000000,
- "MaxFailureRatio": 0.15,
- "Order": "stop-first"
}, - "RollbackConfig": {
- "Parallelism": 1,
- "Delay": 1000000000,
- "FailureAction": "pause",
- "Monitor": 15000000000,
- "MaxFailureRatio": 0.15,
- "Order": "stop-first"
}, - "Networks": [
- {
- "Target": "string",
- "Aliases": [
- "string"
], - "DriverOpts": {
- "property1": "string",
- "property2": "string"
}
}
], - "EndpointSpec": {
- "Mode": "vip",
- "Ports": [
- {
- "Name": "string",
- "Protocol": "tcp",
- "TargetPort": 80,
- "PublishedPort": 8080,
- "PublishMode": "ingress"
}
]
}
}
{- "ID": "ak7w3gjqoa3kuz8xcpnyy0pvl",
- "Warnings": [
- "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found"
]
}
id required | string ID or name of service. |
insertDefaults | boolean Default: false Fill empty fields with default values. |
{- "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,
- "Delay": 1000000000,
- "FailureAction": "pause",
- "Monitor": 15000000000,
- "MaxFailureRatio": 0.15
}, - "RollbackConfig": {
- "Parallelism": 1,
- "Delay": 1000000000,
- "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.
This version number should be the value as currently set on the
service before the update. You can find the current version by
calling |
registryAuthFrom | string Default: "spec" Enum: "spec" "previous-spec" If the |
rollback | string Set to this parameter to |
X-Registry-Auth | string A base64url-encoded auth configuration for pulling from private registries. Refer to 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. | |
object Specification for the rollback strategy of the service. | |
Array of objects (NetworkAttachmentConfig) Specifies which networks the service should attach to. Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. | |
object (EndpointSpec) Properties that can be configured to access and load balance a service. |
{- "Name": "top",
- "Labels": {
- "property1": "string",
- "property2": "string"
}, - "TaskTemplate": {
- "PluginSpec": {
- "Name": "string",
- "Remote": "string",
- "Disabled": true,
- "PluginPrivilege": [
- {
- "Name": "network",
- "Description": "string",
- "Value": [
- "host"
]
}
]
}, - "ContainerSpec": {
- "Image": "busybox",
- "Labels": {
- "property1": "string",
- "property2": "string"
}, - "Command": [
- "string"
], - "Args": [
- "top"
], - "Hostname": "string",
- "Env": [
- "string"
], - "Dir": "string",
- "User": "string",
- "Groups": [
- "string"
], - "Privileges": {
- "CredentialSpec": {
- "Config": "0bt9dmxjvjiqermk6xrop3ekq",
- "File": "spec.json",
- "Registry": "string"
}, - "SELinuxContext": {
- "Disable": true,
- "User": "string",
- "Role": "string",
- "Type": "string",
- "Level": "string"
}, - "Seccomp": {
- "Mode": "default",
- "Profile": "string"
}, - "AppArmor": {
- "Mode": "default"
}, - "NoNewPrivileges": true
}, - "TTY": true,
- "OpenStdin": true,
- "ReadOnly": true,
- "Mounts": [
- {
- "Target": "string",
- "Source": "string",
- "Type": "bind",
- "ReadOnly": true,
- "Consistency": "string",
- "BindOptions": {
- "Propagation": "private",
- "NonRecursive": false,
- "CreateMountpoint": false,
- "ReadOnlyNonRecursive": false,
- "ReadOnlyForceRecursive": false
}, - "VolumeOptions": {
- "NoCopy": false,
- "Labels": {
- "property1": "string",
- "property2": "string"
}, - "DriverConfig": {
- "Name": "string",
- "Options": {
- "property1": "string",
- "property2": "string"
}
}, - "Subpath": "dir-inside-volume/subdirectory"
}, - "ImageOptions": {
- "Subpath": "dir-inside-image/subdirectory"
}, - "TmpfsOptions": {
- "SizeBytes": 0,
- "Mode": 0,
- "Options": [
- [
- "noexec"
]
]
}
}
], - "StopSignal": "string",
- "StopGracePeriod": 0,
- "HealthCheck": {
- "Test": [
- "string"
], - "Interval": 0,
- "Timeout": 0,
- "Retries": 0,
- "StartPeriod": 0,
- "StartInterval": 0
}, - "Hosts": [
- "string"
], - "DNSConfig": {
- "Nameservers": [
- "string"
], - "Search": [
- "string"
], - "Options": [
- "string"
]
}, - "Secrets": [
- {
- "File": {
- "Name": "string",
- "UID": "string",
- "GID": "string",
- "Mode": 0
}, - "SecretID": "string",
- "SecretName": "string"
}
], - "OomScoreAdj": 0,
- "Configs": [
- {
- "File": {
- "Name": "string",
- "UID": "string",
- "GID": "string",
- "Mode": 0
}, - "Runtime": { },
- "ConfigID": "string",
- "ConfigName": "string"
}
], - "Isolation": "default",
- "Init": true,
- "Sysctls": {
- "property1": "string",
- "property2": "string"
}, - "CapabilityAdd": [
- "CAP_NET_RAW",
- "CAP_SYS_ADMIN",
- "CAP_SYS_CHROOT",
- "CAP_SYSLOG"
], - "CapabilityDrop": [
- "CAP_NET_RAW"
], - "Ulimits": [
- {
- "Name": "string",
- "Soft": 0,
- "Hard": 0
}
]
}, - "NetworkAttachmentSpec": {
- "ContainerID": "string"
}, - "Resources": {
- "Limits": {
- "NanoCPUs": 4000000000,
- "MemoryBytes": 8272408576,
- "Pids": 100
}, - "Reservations": {
- "NanoCPUs": 4000000000,
- "MemoryBytes": 8272408576,
- "GenericResources": [
- {
- "DiscreteResourceSpec": {
- "Kind": "SSD",
- "Value": 3
}
}, - {
- "NamedResourceSpec": {
- "Kind": "GPU",
- "Value": "UUID1"
}
}, - {
- "NamedResourceSpec": {
- "Kind": "GPU",
- "Value": "UUID2"
}
}
]
}
}, - "RestartPolicy": {
- "Condition": "any",
- "Delay": 0,
- "MaxAttempts": 0,
- "Window": 0
}, - "Placement": {
- "Constraints": [
- "node.hostname!=node3.corp.example.com",
- "node.role!=manager",
- "node.labels.type==production",
- "node.platform.os==linux",
- "node.platform.arch==x86_64"
], - "Preferences": [
- {
- "Spread": {
- "SpreadDescriptor": "node.labels.datacenter"
}
}, - {
- "Spread": {
- "SpreadDescriptor": "node.labels.rack"
}
}
], - "MaxReplicas": 0,
- "Platforms": [
- {
- "Architecture": "x86_64",
- "OS": "linux"
}
]
}, - "ForceUpdate": 0,
- "Runtime": "string",
- "Networks": [
- {
- "Target": "string",
- "Aliases": [
- "string"
], - "DriverOpts": {
- "property1": "string",
- "property2": "string"
}
}
], - "LogDriver": {
- "Name": "string",
- "Options": {
- "property1": "string",
- "property2": "string"
}
}
}, - "Mode": {
- "Replicated": {
- "Replicas": 1
}, - "Global": { },
- "ReplicatedJob": {
- "MaxConcurrent": 1,
- "TotalCompletions": 0
}, - "GlobalJob": { }
}, - "UpdateConfig": {
- "Parallelism": 2,
- "Delay": 1000000000,
- "FailureAction": "pause",
- "Monitor": 15000000000,
- "MaxFailureRatio": 0.15,
- "Order": "stop-first"
}, - "RollbackConfig": {
- "Parallelism": 1,
- "Delay": 1000000000,
- "FailureAction": "pause",
- "Monitor": 15000000000,
- "MaxFailureRatio": 0.15,
- "Order": "stop-first"
}, - "Networks": [
- {
- "Target": "string",
- "Aliases": [
- "string"
], - "DriverOpts": {
- "property1": "string",
- "property2": "string"
}
}
], - "EndpointSpec": {
- "Mode": "vip",
- "Ports": [
- {
- "Name": "string",
- "Protocol": "tcp",
- "TargetPort": 0,
- "PublishedPort": 0,
- "PublishMode": "ingress"
}
]
}
}
{- "Warnings": [
- "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found"
]
}
Get stdout
and stderr
logs from a service. See also
/containers/{id}/logs
.
Note: This endpoint works only for services with the local
,
json-file
or journald
logging drivers.
id required | string ID or name of the service |
details | boolean Default: false Show service context and extra details provided to logs. |
follow | boolean Default: false Keep connection after returning logs. |
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 Available filters:
|
[- {
- "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"
]
}
], - "AssignedGenericResources": [
- {
- "DiscreteResourceSpec": {
- "Kind": "SSD",
- "Value": 3
}
}, - {
- "NamedResourceSpec": {
- "Kind": "GPU",
- "Value": "UUID1"
}
}, - {
- "NamedResourceSpec": {
- "Kind": "GPU",
- "Value": "UUID2"
}
}
]
}
Get stdout
and stderr
logs from a task.
See also /containers/{id}/logs
.
Note: This endpoint works only for services with the local
,
json-file
or journald
logging drivers.
id required | string ID of the task |
details | boolean Default: false Show task context and extra details provided to logs. |
follow | boolean Default: false Keep connection after returning logs. |
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 |
Secrets are sensitive data that can be used by services. Swarm mode must be enabled for these endpoints to work.
filters | string A JSON encoded value of the filters (a Available filters:
|
[- {
- "ID": "blt1owaxmitz71s9v5zh81zun",
- "Version": {
- "Index": 85
}, - "CreatedAt": "2017-07-20T13:55:28.678958722Z",
- "UpdatedAt": "2017-07-20T13:55:28.678958722Z",
- "Spec": {
- "Name": "mysql-passwd",
- "Labels": {
- "some.label": "some.value"
}, - "Driver": {
- "Name": "secret-bucket",
- "Options": {
- "OptionA": "value for driver option A",
- "OptionB": "value for driver option B"
}
}
}
}, - {
- "ID": "ktnbjxoalbkvbvedmg1urrz8h",
- "Version": {
- "Index": 11
}, - "CreatedAt": "2016-11-05T01:20:17.327670065Z",
- "UpdatedAt": "2016-11-05T01:20:17.327670065Z",
- "Spec": {
- "Name": "app-dev.crt",
- "Labels": {
- "foo": "bar"
}
}
}
]
Name | string User-defined name of the secret. |
object User-defined key/value metadata. | |
Data | string Base64-url-safe-encoded (RFC 4648) data to store as secret. This field is only used to create a secret, and is not returned by other endpoints. |
object (Driver) Driver represents a driver (network, logging, secrets). | |
object (Driver) Driver represents a driver (network, logging, secrets). |
{- "Name": "app-key.crt",
- "Labels": {
- "com.example.some-label": "some-value",
- "com.example.some-other-label": "some-other-value",
- "foo": "bar"
}, - "Data": "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==",
- "Driver": {
- "Name": "secret-bucket",
- "Options": {
- "OptionA": "value for driver option A",
- "OptionB": "value for driver option B"
}
}, - "Templating": {
- "Name": "some-driver",
- "Options": {
- "OptionA": "value for driver-specific option A",
- "OptionB": "value for driver-specific option B"
}
}
}
{- "Id": "string"
}
{- "ID": "ktnbjxoalbkvbvedmg1urrz8h",
- "Version": {
- "Index": 11
}, - "CreatedAt": "2016-11-05T01:20:17.327670065Z",
- "UpdatedAt": "2016-11-05T01:20:17.327670065Z",
- "Spec": {
- "Name": "app-dev.crt",
- "Labels": {
- "foo": "bar"
}, - "Driver": {
- "Name": "secret-bucket",
- "Options": {
- "OptionA": "value for driver option A",
- "OptionB": "value for driver option B"
}
}
}
}
id required | string The ID or name of the secret |
version required | integer <int64> The version number of the secret object being updated. This is required to avoid conflicting writes. |
The spec of the secret to update. Currently, only the Labels field can be updated. All other fields must remain unchanged from the SecretInspect endpoint response values.
Name | string User-defined name of the secret. |
object User-defined key/value metadata. | |
Data | string Base64-url-safe-encoded (RFC 4648) data to store as secret. This field is only used to create a secret, and is not returned by other endpoints. |
object (Driver) Driver represents a driver (network, logging, secrets). | |
object (Driver) Driver represents a driver (network, logging, secrets). |
{- "Name": "string",
- "Labels": {
- "com.example.some-label": "some-value",
- "com.example.some-other-label": "some-other-value"
}, - "Data": "",
- "Driver": {
- "Name": "some-driver",
- "Options": {
- "OptionA": "value for driver-specific option A",
- "OptionB": "value for driver-specific option B"
}
}, - "Templating": {
- "Name": "some-driver",
- "Options": {
- "OptionA": "value for driver-specific option A",
- "OptionB": "value for driver-specific option B"
}
}
}
{- "message": "Something went wrong."
}
Configs are application configurations that can be used by services. Swarm mode must be enabled for these endpoints to work.
filters | string A JSON encoded value of the filters (a Available filters:
|
[- {
- "ID": "ktnbjxoalbkvbvedmg1urrz8h",
- "Version": {
- "Index": 11
}, - "CreatedAt": "2016-11-05T01:20:17.327670065Z",
- "UpdatedAt": "2016-11-05T01:20:17.327670065Z",
- "Spec": {
- "Name": "server.conf"
}
}
]
Name | string User-defined name of the config. |
object User-defined key/value metadata. | |
Data | string Base64-url-safe-encoded (RFC 4648) config data. |
object (Driver) Driver represents a driver (network, logging, secrets). |
{- "Name": "server.conf",
- "Labels": {
- "property1": "string",
- "property2": "string",
- "foo": "bar"
}, - "Data": "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==",
- "Templating": {
- "Name": "some-driver",
- "Options": {
- "OptionA": "value for driver-specific option A",
- "OptionB": "value for driver-specific option B"
}
}
}
{- "Id": "string"
}
{- "ID": "ktnbjxoalbkvbvedmg1urrz8h",
- "Version": {
- "Index": 11
}, - "CreatedAt": "2016-11-05T01:20:17.327670065Z",
- "UpdatedAt": "2016-11-05T01:20:17.327670065Z",
- "Spec": {
- "Name": "app-dev.crt"
}
}
id required | string The ID or name of the config |
version required | integer <int64> The version number of the config object being updated. This is required to avoid conflicting writes. |
The spec of the config to update. Currently, only the Labels field can be updated. All other fields must remain unchanged from the ConfigInspect endpoint response values.
Name | string User-defined name of the config. |
object User-defined key/value metadata. | |
Data | string Base64-url-safe-encoded (RFC 4648) config data. |
object (Driver) Driver represents a driver (network, logging, secrets). |
{- "Name": "string",
- "Labels": {
- "property1": "string",
- "property2": "string"
}, - "Data": "string",
- "Templating": {
- "Name": "some-driver",
- "Options": {
- "OptionA": "value for driver-specific option A",
- "OptionB": "value for driver-specific option B"
}
}
}
{- "message": "Something went wrong."
}
Returns information about installed plugins.
filters | string A JSON encoded value of the filters (a Available filters:
|
[- {
- "Id": "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078",
- "Name": "tiborvass/sample-volume-plugin",
- "Enabled": true,
- "Settings": {
- "Mounts": [
- {
- "Name": "some-mount",
- "Description": "This is a mount that's used by the plugin.",
- "Settable": [
- "string"
], - "Source": "/var/lib/docker/plugins/",
- "Destination": "/mnt/state",
- "Type": "bind",
- "Options": [
- "rbind",
- "rw"
]
}
], - "Env": [
- "DEBUG=0"
], - "Args": [
- "string"
], - "Devices": [
- {
- "Name": "string",
- "Description": "string",
- "Settable": [
- "string"
], - "Path": "/dev/fuse"
}
]
}, - "PluginReference": "localhost:5000/tiborvass/sample-volume-plugin:latest",
- "Config": {
- "DockerVersion": "17.06.0-ce",
- "Description": "A sample volume plugin for Docker",
- "Interface": {
- "Types": [
- "docker.volumedriver/1.0"
], - "Socket": "plugins.sock",
- "ProtocolScheme": "some.protocol/v1.0"
}, - "Entrypoint": [
- "/usr/bin/sample-volume-plugin",
- "/data"
], - "WorkDir": "/bin/",
- "User": {
- "UID": 1000,
- "GID": 1000
}, - "Network": {
- "Type": "host"
}, - "Linux": {
- "Capabilities": [
- "CAP_SYS_ADMIN",
- "CAP_SYSLOG"
], - "AllowAllDevices": false,
- "Devices": [
- {
- "Name": "string",
- "Description": "string",
- "Settable": [
- "string"
], - "Path": "/dev/fuse"
}
]
}, - "PropagatedMount": "/mnt/volumes",
- "IpcHost": false,
- "PidHost": false,
- "Mounts": [
- {
- "Name": "some-mount",
- "Description": "This is a mount that's used by the plugin.",
- "Settable": [
- "string"
], - "Source": "/var/lib/docker/plugins/",
- "Destination": "/mnt/state",
- "Type": "bind",
- "Options": [
- "rbind",
- "rw"
]
}
], - "Env": [
- {
- "Name": "DEBUG",
- "Description": "If set, prints debug messages",
- "Settable": null,
- "Value": "0"
}
], - "Args": {
- "Name": "args",
- "Description": "command line arguments",
- "Settable": [
- "string"
], - "Value": [
- "string"
]
}, - "rootfs": {
- "type": "layers",
- "diff_ids": [
- "sha256:675532206fbf3030b8458f88d6e26d4eb1577688a25efec97154c94e8b6b4887",
- "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8"
]
}
}
}
]
remote 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 base64url-encoded auth configuration to use when pulling a plugin from a registry. Refer to 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",
- "Enabled": true,
- "Settings": {
- "Mounts": [
- {
- "Name": "some-mount",
- "Description": "This is a mount that's used by the plugin.",
- "Settable": [
- "string"
], - "Source": "/var/lib/docker/plugins/",
- "Destination": "/mnt/state",
- "Type": "bind",
- "Options": [
- "rbind",
- "rw"
]
}
], - "Env": [
- "DEBUG=0"
], - "Args": [
- "string"
], - "Devices": [
- {
- "Name": "string",
- "Description": "string",
- "Settable": [
- "string"
], - "Path": "/dev/fuse"
}
]
}, - "PluginReference": "localhost:5000/tiborvass/sample-volume-plugin:latest",
- "Config": {
- "DockerVersion": "17.06.0-ce",
- "Description": "A sample volume plugin for Docker",
- "Interface": {
- "Types": [
- "docker.volumedriver/1.0"
], - "Socket": "plugins.sock",
- "ProtocolScheme": "some.protocol/v1.0"
}, - "Entrypoint": [
- "/usr/bin/sample-volume-plugin",
- "/data"
], - "WorkDir": "/bin/",
- "User": {
- "UID": 1000,
- "GID": 1000
}, - "Network": {
- "Type": "host"
}, - "Linux": {
- "Capabilities": [
- "CAP_SYS_ADMIN",
- "CAP_SYSLOG"
], - "AllowAllDevices": false,
- "Devices": [
- {
- "Name": "string",
- "Description": "string",
- "Settable": [
- "string"
], - "Path": "/dev/fuse"
}
]
}, - "PropagatedMount": "/mnt/volumes",
- "IpcHost": false,
- "PidHost": false,
- "Mounts": [
- {
- "Name": "some-mount",
- "Description": "This is a mount that's used by the plugin.",
- "Settable": [
- "string"
], - "Source": "/var/lib/docker/plugins/",
- "Destination": "/mnt/state",
- "Type": "bind",
- "Options": [
- "rbind",
- "rw"
]
}
], - "Env": [
- {
- "Name": "DEBUG",
- "Description": "If set, prints debug messages",
- "Settable": null,
- "Value": "0"
}
], - "Args": {
- "Name": "args",
- "Description": "command line arguments",
- "Settable": [
- "string"
], - "Value": [
- "string"
]
}, - "rootfs": {
- "type": "layers",
- "diff_ids": [
- "sha256:675532206fbf3030b8458f88d6e26d4eb1577688a25efec97154c94e8b6b4887",
- "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8"
]
}
}
}
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",
- "Enabled": true,
- "Settings": {
- "Mounts": [
- {
- "Name": "some-mount",
- "Description": "This is a mount that's used by the plugin.",
- "Settable": [
- "string"
], - "Source": "/var/lib/docker/plugins/",
- "Destination": "/mnt/state",
- "Type": "bind",
- "Options": [
- "rbind",
- "rw"
]
}
], - "Env": [
- "DEBUG=0"
], - "Args": [
- "string"
], - "Devices": [
- {
- "Name": "string",
- "Description": "string",
- "Settable": [
- "string"
], - "Path": "/dev/fuse"
}
]
}, - "PluginReference": "localhost:5000/tiborvass/sample-volume-plugin:latest",
- "Config": {
- "DockerVersion": "17.06.0-ce",
- "Description": "A sample volume plugin for Docker",
- "Interface": {
- "Types": [
- "docker.volumedriver/1.0"
], - "Socket": "plugins.sock",
- "ProtocolScheme": "some.protocol/v1.0"
}, - "Entrypoint": [
- "/usr/bin/sample-volume-plugin",
- "/data"
], - "WorkDir": "/bin/",
- "User": {
- "UID": 1000,
- "GID": 1000
}, - "Network": {
- "Type": "host"
}, - "Linux": {
- "Capabilities": [
- "CAP_SYS_ADMIN",
- "CAP_SYSLOG"
], - "AllowAllDevices": false,
- "Devices": [
- {
- "Name": "string",
- "Description": "string",
- "Settable": [
- "string"
], - "Path": "/dev/fuse"
}
]
}, - "PropagatedMount": "/mnt/volumes",
- "IpcHost": false,
- "PidHost": false,
- "Mounts": [
- {
- "Name": "some-mount",
- "Description": "This is a mount that's used by the plugin.",
- "Settable": [
- "string"
], - "Source": "/var/lib/docker/plugins/",
- "Destination": "/mnt/state",
- "Type": "bind",
- "Options": [
- "rbind",
- "rw"
]
}
], - "Env": [
- {
- "Name": "DEBUG",
- "Description": "If set, prints debug messages",
- "Settable": null,
- "Value": "0"
}
], - "Args": {
- "Name": "args",
- "Description": "command line arguments",
- "Settable": [
- "string"
], - "Value": [
- "string"
]
}, - "rootfs": {
- "type": "layers",
- "diff_ids": [
- "sha256:675532206fbf3030b8458f88d6e26d4eb1577688a25efec97154c94e8b6b4887",
- "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8"
]
}
}
}
name required | string The name of the plugin. The |
remote required | string Remote reference to upgrade to. The |
X-Registry-Auth | string A base64url-encoded auth configuration to use when pulling a plugin from a registry. Refer to 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 |
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..."
}
{- "ID": "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS",
- "Containers": 14,
- "ContainersRunning": 3,
- "ContainersPaused": 1,
- "ContainersStopped": 10,
- "Images": 508,
- "Driver": "overlay2",
- "DriverStatus": [
- [
- "Backing Filesystem",
- "extfs"
], - [
- "Supports d_type",
- "true"
], - [
- "Native Overlay Diff",
- "true"
]
], - "DockerRootDir": "/var/lib/docker",
- "Plugins": {
- "Volume": [
- "local"
], - "Network": [
- "bridge",
- "host",
- "ipvlan",
- "macvlan",
- "null",
- "overlay"
], - "Authorization": [
- "img-authz-plugin",
- "hbm"
], - "Log": [
- "awslogs",
- "fluentd",
- "gcplogs",
- "gelf",
- "journald",
- "json-file",
- "splunk",
- "syslog"
]
}, - "MemoryLimit": true,
- "SwapLimit": true,
- "KernelMemoryTCP": true,
- "CpuCfsPeriod": true,
- "CpuCfsQuota": true,
- "CPUShares": true,
- "CPUSet": true,
- "PidsLimit": true,
- "OomKillDisable": true,
- "IPv4Forwarding": true,
- "BridgeNfIptables": false,
- "BridgeNfIp6tables": false,
- "Debug": true,
- "NFd": 64,
- "NGoroutines": 174,
- "SystemTime": "2017-08-08T20:28:29.06202363Z",
- "LoggingDriver": "string",
- "CgroupDriver": "cgroupfs",
- "CgroupVersion": "1",
- "NEventsListener": 30,
- "KernelVersion": "6.8.0-31-generic",
- "OperatingSystem": "Ubuntu 24.04 LTS",
- "OSVersion": "24.04",
- "OSType": "linux",
- "Architecture": "x86_64",
- "NCPU": 4,
- "MemTotal": 2095882240,
- "RegistryConfig": {
- "AllowNondistributableArtifactsCIDRs": [ ],
- "AllowNondistributableArtifactsHostnames": [ ],
- "InsecureRegistryCIDRs": [
- "::1/128",
- "127.0.0.0/8"
], - "IndexConfigs": {
- "127.0.0.1:5000": {
- "Name": "127.0.0.1:5000",
- "Mirrors": [ ],
- "Secure": false,
- "Official": false
}, - "[2001:db8:a0b:12f0::1]:80": {
- "Name": "[2001:db8:a0b:12f0::1]:80",
- "Mirrors": [ ],
- "Secure": false,
- "Official": false
}, - "docker.io": {
- "Name": "docker.io",
- "Secure": true,
- "Official": true
}, - "registry.internal.corp.example.com:3000": {
- "Name": "registry.internal.corp.example.com:3000",
- "Mirrors": [ ],
- "Secure": false,
- "Official": false
}
},
}, - "GenericResources": [
- {
- "DiscreteResourceSpec": {
- "Kind": "SSD",
- "Value": 3
}
}, - {
- "NamedResourceSpec": {
- "Kind": "GPU",
- "Value": "UUID1"
}
}, - {
- "NamedResourceSpec": {
- "Kind": "GPU",
- "Value": "UUID2"
}
}
], - "NoProxy": "*.local, 169.254/16",
- "Name": "node5.corp.example.com",
- "Labels": [
- "storage=ssd",
- "production"
], - "ExperimentalBuild": true,
- "ServerVersion": "27.0.1",
- "Runtimes": {
- "runc": {
- "path": "runc"
}, - "runc-master": {
- "path": "/go/bin/runc"
}, - "custom": {
- "path": "/usr/local/bin/my-oci-runtime",
- "runtimeArgs": [
- "--debug",
- "--systemd-cgroup=false"
]
}
}, - "DefaultRuntime": "runc",
- "Swarm": {
- "NodeID": "k67qz4598weg5unwwffg6z1m1",
- "NodeAddr": "10.0.0.46",
- "LocalNodeState": "active",
- "ControlAvailable": true,
- "Error": "",
- "RemoteManagers": [
- {
- "NodeID": "71izy0goik036k48jg985xnds",
- "Addr": "10.0.0.158:2377"
}, - {
- "NodeID": "79y6h1o4gv8n120drcprv5nmc",
- "Addr": "10.0.0.159:2377"
}, - {
- "NodeID": "k67qz4598weg5unwwffg6z1m1",
- "Addr": "10.0.0.46:2377"
}
], - "Nodes": 4,
- "Managers": 3,
- "Cluster": {
- "ID": "abajmipo7b4xz5ip2nrla6b11",
- "Version": {
- "Index": 373531
}, - "CreatedAt": "2016-08-18T10:44:24.496525531Z",
- "UpdatedAt": "2017-08-09T07:09:37.632105588Z",
- "Spec": {
- "Name": "default",
- "Labels": {
- "com.example.corp.type": "production",
- "com.example.corp.department": "engineering"
}, - "Orchestration": {
- "TaskHistoryRetentionLimit": 10
}, - "Raft": {
- "SnapshotInterval": 10000,
- "KeepOldSnapshots": 0,
- "LogEntriesForSlowFollowers": 500,
- "ElectionTick": 3,
- "HeartbeatTick": 1
}, - "Dispatcher": {
- "HeartbeatPeriod": 5000000000
}, - "CAConfig": {
- "NodeCertExpiry": 7776000000000000,
- "ExternalCAs": [
- {
- "Protocol": "cfssl",
- "URL": "string",
- "Options": {
- "property1": "string",
- "property2": "string"
}, - "CACert": "string"
}
], - "SigningCACert": "string",
- "SigningCAKey": "string",
- "ForceRotate": 0
}, - "EncryptionConfig": {
- "AutoLockManagers": false
}, - "TaskDefaults": {
- "LogDriver": {
- "Name": "json-file",
- "Options": {
- "max-file": "10",
- "max-size": "100m"
}
}
}
}, - "TLSInfo": {
- "TrustRoot": "-----BEGIN CERTIFICATE-----\nMIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0\nMzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf\n3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO\nPQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz\npxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H\n-----END CERTIFICATE-----\n",
- "CertIssuerSubject": "MBMxETAPBgNVBAMTCHN3YXJtLWNh",
- "CertIssuerPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A=="
}, - "RootRotationInProgress": false,
- "DataPathPort": 4789,
- "DefaultAddrPool": [
- [
- "10.10.0.0/16",
- "20.20.0.0/16"
]
], - "SubnetSize": 24
}
}, - "LiveRestoreEnabled": false,
- "Isolation": "default",
- "InitBinary": "docker-init",
- "ContainerdCommit": {
- "ID": "cfb82a876ecc11b5ca0977d1733adbe58599088a",
- "Expected": "2d41c047c83e09a6d61d464906feb2a2f3c52aa4"
}, - "RuncCommit": {
- "ID": "cfb82a876ecc11b5ca0977d1733adbe58599088a",
- "Expected": "2d41c047c83e09a6d61d464906feb2a2f3c52aa4"
}, - "InitCommit": {
- "ID": "cfb82a876ecc11b5ca0977d1733adbe58599088a",
- "Expected": "2d41c047c83e09a6d61d464906feb2a2f3c52aa4"
}, - "SecurityOptions": [
- "name=apparmor",
- "name=seccomp,profile=default",
- "name=selinux",
- "name=userns",
- "name=rootless"
], - "ProductLicense": "Community Engine",
- "DefaultAddressPools": [
- {
- "Base": "10.10.0.0/16",
- "Size": "24"
}
], - "Warnings": [
- "WARNING: No memory limit support"
], - "CDISpecDirs": [
- "/etc/cdi",
- "/var/run/cdi"
], - "Containerd": {
- "Address": "/run/containerd/containerd.sock",
- "Namespaces": {
- "Containers": "moby",
- "Plugins": "plugins.moby"
}
}
}
Returns the version of Docker that is running and various information about the system that Docker is running on.
{- "Platform": {
- "Name": "string"
}, - "Components": [
- {
- "Name": "Engine",
- "Version": "27.0.1",
- "Details": { }
}
], - "Version": "27.0.1",
- "ApiVersion": "1.47",
- "MinAPIVersion": "1.24",
- "GitCommit": "48a66213fe",
- "GoVersion": "go1.22.7",
- "Os": "linux",
- "Arch": "amd64",
- "KernelVersion": "6.8.0-31-generic",
- "Experimental": true,
- "BuildTime": "2020-06-22T15:49:27.000000000+00:00"
}
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
, exec_die
, export
, health_status
, kill
, oom
, pause
, rename
, resize
, restart
, start
, stop
, top
, unpause
, update
, and prune
Images report these events: create
, delete
, import
, load
, pull
, push
, save
, tag
, untag
, and prune
Volumes report these events: create
, mount
, unmount
, destroy
, and prune
Networks report these events: create
, connect
, disconnect
, destroy
, update
, remove
, and prune
The Docker daemon reports these events: reload
Services report these events: create
, update
, and remove
Nodes report these events: create
, update
, and remove
Secrets report these events: create
, update
, and remove
Configs report these events: create
, update
, and remove
The Builder reports prune
events
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:latest",
- "name": "my-container"
}
}, - "scope": "local",
- "time": 1629574695,
- "timeNano": 1629574695515050000
}
type | Array of strings Items Enum: "container" "image" "volume" "build-cache" Object types, for which to compute and return data. |
{- "LayersSize": 1092588,
- "Images": [
- {
- "Id": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749",
- "ParentId": "",
- "RepoTags": [
- "busybox:latest"
], - "RepoDigests": [
- "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6"
], - "Created": 1466724217,
- "Size": 1092588,
- "SharedSize": 0,
- "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": "/var/lib/docker/volumes/my-volume/_data",
- "Labels": null,
- "Scope": "local",
- "Options": null,
- "UsageData": {
- "Size": 10920104,
- "RefCount": 2
}
}
], - "BuildCache": [
- {
- "ID": "hw53o5aio51xtltp5xjp8v7fx",
- "Parents": [ ],
- "Type": "regular",
- "Description": "pulled from docker.io/library/debian@sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0",
- "InUse": false,
- "Shared": true,
- "Size": 0,
- "CreatedAt": "2021-06-28T13:31:01.474619385Z",
- "LastUsedAt": "2021-07-07T22:02:32.738075951Z",
- "UsageCount": 26
}, - {
- "ID": "ndlpt0hhvkqcdfkputsk4cq9c",
- "Parents": [
- "ndlpt0hhvkqcdfkputsk4cq9c"
], - "Type": "regular",
- "Description": "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache",
- "InUse": false,
- "Shared": true,
- "Size": 51,
- "CreatedAt": "2021-06-28T13:31:03.002625487Z",
- "LastUsedAt": "2021-07-07T22:02:32.773909517Z",
- "UsageCount": 26
}
]
}
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 |
platform | string JSON encoded OCI platform describing a platform which will be used to select a platform-specific image to be saved if the image is multi-platform. If not provided, the full multi-platform image will be saved. Example: |
Return image digest and platform information by contacting the registry.
name required | string Image name or id |
{- "Descriptor": {
- "mediaType": "application/vnd.oci.image.manifest.v1+json",
- "digest": "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96",
- "size": 424,
- "annotations": {
- "com.docker.official-images.bashbrew.arch": "amd64",
- "org.opencontainers.image.base.digest": "sha256:0d0ef5c914d3ea700147da1bd050c59edb8bb12ca312f3800b29d7c8087eabd8",
- "org.opencontainers.image.base.name": "scratch",
- "org.opencontainers.image.created": "2025-01-27T00:00:00Z",
- "org.opencontainers.image.revision": "9fabb4bad5138435b01857e2fe9363e2dc5f6a79",
- "org.opencontainers.image.version": "24.04"
}, - "data": null,
- "platform": {
- "architecture": "arm",
- "os": "windows",
- "os.version": "10.0.19041.1165",
- "os.features": [
- "win32k"
], - "variant": "v7"
}, - "artifactType": null
}, - "Platforms": [
- {
- "architecture": "arm",
- "os": "windows",
- "os.version": "10.0.19041.1165",
- "os.features": [
- "win32k"
], - "variant": "v7"
}
]
}
Start a new interactive session with a server. Session allows server to call back to the client for advanced capabilities.
This endpoint hijacks the HTTP connection to HTTP2 transport that allows the client to expose gPRC services on that connection.
For example, the client sends this request to upgrade the connection:
POST /session HTTP/1.1
Upgrade: h2c
Connection: Upgrade
The Docker daemon responds with a 101 UPGRADED
response follow with
the raw stream:
HTTP/1.1 101 UPGRADED
Connection: Upgrade
Upgrade: h2c