v1
latestSwagger 2.02026-07-17107114423.2 KBContainer
List containers
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 .
get/containers/json
Query parameters
allboolean
Return all containers. By default, only running containers are shown.
limitinteger
Return this number of most recently created containers, including non-running ones.
sizeboolean
Return the size of container as fields SizeRw and SizeRootFs.
filtersstring
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 ID
- isolation=(default|process|hyperv) (Windows daemon only)
- is-task=(true|false)
- label=key or label="key=value" of a container label
- name=<name> a container's name
- network=(<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>)
Response
no error
Example response
[
{
"Ports": [
{
"PrivatePort": 8080,
"PublicPort": 80,
"Type": "tcp"
}
],
"Mounts": [
{
"Type": "volume",
"Name": "myvolume",
"Source": "/var/lib/docker/volumes/myvolume/_data",
"Destination": "/usr/share/nginx/html/",
"Driver": "local",
"Mode": "z",
"RW": true
}
]
}
]