v1

latestSwagger 2.02026-07-175684145.0 KB

List containers

get/containers/json

Query parameters

allboolean

Return all containers. By default, only running containers are shown

filtersstring

Filters encoded as JSON string(type map[string][]string in Golang). This API will list containers match all of the filters. For example, {"status": ["paused"]} will only return paused containers. Available filters:

  • id=<ID> container ID filter, support regular expression.
  • name=<name> container name filter, support regular expression.
  • status=<status> container status filter, support regular expression.
  • label=<key>=<value> container label filter, support equal and unequal operator. such as label=[k=a,k!=b].

Response

Summary containers that matches the query

Idstring

Container ID

Namesstring[]
Imagestring
ImageIDstring
Commandstring
Createdinteger

Created time of container in daemon.

SizeRwinteger
SizeRootFsinteger
Labelsobject
Statestring
Statusstring

Example response

[
  {
    "Names": [
      "container_1",
      "container_2"
    ],
    "HostConfig": {
      "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"
          }
        ],
        "2377/tcp": null
      },
      "CpusetCpus": "0-3",
      "Devices": [
        {
          "PathOnHost": "/dev/deviceName",
          "PathInContainer": "/dev/deviceName",
          "CgroupPermissions": "mrw"
        }
      ],
      "DeviceCgroupRules": [
        "c 13:* rwm"
      ],
      "NvidiaConfig": {
        "NvidiaVisibleDevices": "Possible values.\n0,1,2, GPU-fef8089b …: a comma-separated list of GPU UUID(s) or index(es).\nall: all GPUs will be accessible, this is the default value in our container images.\nnone: no GPU will be accessible, but driver capabilities will be enabled.\n",
        "NvidiaDriverCapabilities": "Possible values\ncompute,video, graphics,utility …: a comma-separated list of driver features the container needs.\nall: enable all available driver capabilities.\n"
      }
    }
  }
]