List containers Run in API Explorer
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 .
Query parameters
-
Return all containers. By default, only running containers are shown.
Default value is
false
. -
Return this number of most recently created containers, including non-running ones.
-
Return the size of container as fields
SizeRw
andSizeRootFs
.Default value is
false
. -
Filters to process on the container list, encoded as JSON (a
map[string][]string
). For example,{"status": ["paused"]}
will only return paused containers.Available filters:
ancestor
=(<image-name>[:<tag>]
,<image id>
, or<image@digest>
)before
=(<container id>
or<container name>
)expose
=(<port>[/<proto>]
|<startport-endport>/[<proto>]
)exited=<int>
containers with exit code of<int>
health
=(starting
|healthy
|unhealthy
|none
)id=<ID>
a container's IDisolation=
(default
|process
|hyperv
) (Windows daemon only)is-task=
(true
|false
)label=key
orlabel="key=value"
of a container labelname=<name>
a container's namenetwork
=(<network id>
or<network name>
)publish
=(<port>[/<proto>]
|<startport-endport>/[<proto>]
)since
=(<container id>
or<container name>
)status=
(created
|restarting
|running
|removing
|paused
|exited
|dead
)volume
=(<volume name>
or<mount point destination>
)
GET
/containers/json
curl \
--request GET 'http://api.example.com/v1.49/containers/json'
Response examples (200)
[
{
"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,
"urls": [
"https://example.com"
],
"annotations": {
"org.opencontainers.image.url": "https://hub.docker.com/_/ubuntu",
"org.opencontainers.image.source": "https://git.launchpad.net/cloud-images/+oci/ubuntu-base",
"org.opencontainers.image.created": "2025-01-27T00:00:00Z",
"org.opencontainers.image.version": "24.04",
"org.opencontainers.image.revision": "9fabb4bad5138435b01857e2fe9363e2dc5f6a79",
"org.opencontainers.image.base.name": "scratch",
"org.opencontainers.image.base.digest": "sha256:0d0ef5c914d3ea700147da1bd050c59edb8bb12ca312f3800b29d7c8087eabd8",
"com.docker.official-images.bashbrew.arch": "amd64"
},
"data": "string",
"platform": {
"architecture": "arm",
"os": "windows",
"os.version": "10.0.19041.1165",
"os.features": [
"win32k"
],
"variant": "v7"
},
"artifactType": "string"
},
"Command": "/bin/bash",
"Created": "1739811096",
"Ports": [
{
"Type": "tcp",
"PublicPort": 80,
"PrivatePort": 8080
}
],
"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.sandbox.id": "3befe639bed0fd6afdd65fd1fa84506756f59360ec4adc270b0fdac9be22b4d3",
"io.kubernetes.docker.type": "container"
}
},
"NetworkSettings": {
"Networks": {
"additionalProperty1": {
"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"
]
},
"additionalProperty2": {
"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": "string"
}
]
}
]
Response examples (400)
{
"message": "Something went wrong."
}
Response examples (400)
{
"message": "Something went wrong."
}
Response examples (500)
{
"message": "Something went wrong."
}
Response examples (500)
{
"message": "Something went wrong."
}