v1

latestSwagger 2.02026-07-17107115429.6 KB
Container

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

Idstring

The ID of this container

Namesstring[]

The names that this container has been given

Imagestring

The name of the image used when creating this container

ImageIDstring

The ID of the image that this container was created from

Commandstring

Command to run when starting the container

Createdinteger

When the container was created

SizeRwinteger

The size of files that have been created or changed by this container

SizeRootFsinteger

The total size of all the files in this container

Labelsobject

User-defined key/value metadata.

Statestring

The state of this container (e.g. Exited)

Statusstring

Additional human-readable status of this container (e.g. Exit 0)

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
      }
    ]
  }
]
All 107 operations