List containers Run in API Explorer

GET /containers/json

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

  • all boolean

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

    Default value is false.

  • limit integer

    Return this number of most recently created containers, including non-running ones.

  • size boolean

    Return the size of container as fields SizeRw and SizeRootFs.

    Default value is false.

  • filters string

    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>)

Responses

  • 200 application/json

    no error

    Hide response attributes Show response attributes object
    • Id string

      The ID of this container as a 128-bit (64-character) hexadecimal string (32 bytes).

      Minimum length is 64, maximum length is 64. Format should match the following pattern: ^[0-9a-fA-F]{64}$.

    • Names array[string]

      The names associated with this container. Most containers have a single name, but when using legacy "links", the container can have multiple names.

      For historic reasons, names are prefixed with a forward-slash (/).

    • Image string

      The name or ID of the image used to create the container.

      This field shows the image reference as was specified when creating the container, which can be in its canonical form (e.g., docker.io/library/ubuntu:latest or docker.io/library/ubuntu@sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782), short form (e.g., ubuntu:latest)), or the ID(-prefix) of the image (e.g., 72297848456d).

      The content of this field can be updated at runtime if the image used to create the container is untagged, in which case the field is updated to contain the the image ID (digest) it was resolved to in its canonical, non-truncated form (e.g., sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782).

    • ImageID string

      The ID (digest) of the image that this container was created from.

    • ImageManifestDescriptor object

      Descriptor is an OCI descriptor of the image target. In case of a multi-platform image, this descriptor points to the OCI index or a manifest list.

      This field is only present if the daemon provides a multi-platform image store.

      WARNING: This is experimental and may change at any time without any backward compatibility.

      Hide ImageManifestDescriptor attributes Show ImageManifestDescriptor attributes object
      • mediaType string

        The media type of the object this schema refers to.

      • digest string

        The digest of the targeted content.

      • size integer(int64)

        The size in bytes of the blob.

      • urls array[string(uri)]

        List of URLs from which this object MAY be downloaded.

      • annotations object

        Arbitrary metadata relating to the targeted content.

        Hide annotations attribute Show annotations attribute object
        • * string Additional properties
      • data string

        Data is an embedding of the targeted content. This is encoded as a base64 string when marshalled to JSON (automatically, by encoding/json). If present, Data can be used directly to avoid fetching the targeted content.

      • platform object

        Describes the platform which the image in the manifest runs on, as defined in the OCI Image Index Specification.

        Hide platform attributes Show platform attributes object
        • architecture string

          The CPU architecture, for example amd64 or ppc64.

        • os string

          The operating system, for example linux or windows.

        • os.version string

          Optional field specifying the operating system version, for example on Windows 10.0.19041.1165.

        • os.features array[string]

          Optional field specifying an array of strings, each listing a required OS feature (for example on Windows win32k).

        • variant string

          Optional field specifying a variant of the CPU, for example v7 to specify ARMv7 when architecture is arm.

      • artifactType string

        ArtifactType is the IANA media type of this artifact.

    • Command string

      Command to run when starting the container

    • Created integer(int64)

      Date and time at which the container was created as a Unix timestamp (number of seconds since EPOCH).

    • Ports array[object]

      Port-mappings for the container.

      An open port on a container

      Hide Ports attributes Show Ports attributes object
      • IP string(ip-address)

        Host IP address that the container's port is mapped to

      • PrivatePort integer(uint16) Required

        Port on the container

      • PublicPort integer(uint16)

        Port exposed on the host

      • Type string Required

        Values are tcp, udp, or sctp.

    • SizeRw integer(int64)

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

      This field is omitted by default, and only set when size is requested in the API request.

    • SizeRootFs integer(int64)

      The total size of all files in the read-only layers from the image that the container uses. These layers can be shared between containers.

      This field is omitted by default, and only set when size is requested in the API request.

    • Labels object

      User-defined key/value metadata.

      Hide Labels attribute Show Labels attribute object
      • * string Additional properties
    • State string

      The state of this container.

      Values are created, running, paused, restarting, exited, removing, or dead.

    • Status string

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

    • HostConfig object

      Summary of host-specific runtime information of the container. This is a reduced set of information in the container's "HostConfig" as available in the container "inspect" response.

      Hide HostConfig attributes Show HostConfig attributes object
      • NetworkMode string

        Networking mode (host, none, container:<id>) or name of the primary network the container is using.

        This field is primarily for backward compatibility. The container can be connected to multiple networks for which information can be found in the NetworkSettings.Networks field, which enumerates settings per network.

      • Annotations object

        Arbitrary key-value metadata attached to the container.

        Hide Annotations attribute Show Annotations attribute object
        • * string Additional properties
    • NetworkSettings object

      Summary of the container's network settings

      Hide NetworkSettings attribute Show NetworkSettings attribute object
      • Networks object

        Summary of network-settings for each network the container is attached to.

        Hide Networks attribute Show Networks attribute object
        • * object Additional properties

          Configuration for a network endpoint.

          Hide * attributes Show * attributes object
          • IPAMConfig object

            EndpointIPAMConfig represents an endpoint's IPAM configuration.

            Hide IPAMConfig attributes Show IPAMConfig attributes object
            • IPv4Address string
            • IPv6Address string
            • LinkLocalIPs array[string]
          • MacAddress string

            MAC address for the endpoint on this network. The network driver might ignore this parameter.

          • Aliases array[string]
          • DriverOpts object

            DriverOpts is a mapping of driver options and values. These options are passed directly to the driver and are driver specific.

            Hide DriverOpts attribute Show DriverOpts attribute object
            • * string Additional properties
          • GwPriority number

            This property determines which endpoint will provide the default gateway for a container. The endpoint with the highest priority will be used. If multiple endpoints have the same priority, endpoints are lexicographically sorted based on their network name, and the one that sorts first is picked.

          • NetworkID string

            Unique ID of the network.

          • EndpointID string

            Unique ID for the service endpoint in a Sandbox.

          • Gateway string

            Gateway address for this network.

          • IPAddress string

            IPv4 address.

          • IPPrefixLen integer

            Mask length of the IPv4 address.

          • IPv6Gateway string

            IPv6 gateway address.

          • GlobalIPv6Address string

            Global IPv6 address.

          • GlobalIPv6PrefixLen integer(int64)

            Mask length of the global IPv6 address.

          • DNSNames array[string]

            List of all DNS names an endpoint has on a specific network. This list is based on the container name, network aliases, container short ID, and hostname.

            These DNS names are non-fully qualified but can contain several dots. You can get fully qualified DNS names by appending .<network-name>. For instance, if container name is my.ctr and the network is named testnet, DNSNames will contain my.ctr and the FQDN will be my.ctr.testnet.

    • Mounts array[object]

      List of mounts used by the container.

      MountPoint represents a mount point configuration inside the container. This is used for reporting the mountpoints in use by a container.

      Hide Mounts attributes Show Mounts attributes object
      • Type string

        The mount type:

        • bind a mount of a file or directory from the host into the container.
        • volume a docker volume with the given Name.
        • image a docker image
        • tmpfs a tmpfs.
        • npipe a named pipe from the host into the container.
        • cluster a Swarm cluster volume

        Values are bind, volume, image, tmpfs, npipe, or cluster.

      • Name string

        Name is the name reference to the underlying data defined by Source e.g., the volume name.

      • Source string

        Source location of the mount.

        For volumes, this contains the storage location of the volume (within /var/lib/docker/volumes/). For bind-mounts, and npipe, this contains the source (host) part of the bind-mount. For tmpfs mount points, this field is empty.

      • Destination string

        Destination is the path relative to the container root (/) where the Source is mounted inside the container.

      • Driver string

        Driver is the volume driver used to create the volume (if it is a volume).

      • Mode string

        Mode is a comma separated list of options supplied by the user when creating the bind/volume mount.

        The default is platform-specific ("z" on Linux, empty on Windows).

      • RW boolean

        Whether the mount is mounted writable (read-write).

      • Propagation string

        Propagation describes how mounts are propagated from the host into the mount point, and vice-versa. Refer to the Linux kernel documentation for details. This field is not used on Windows.

  • 400 application/json

    bad parameter

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

  • 500 application/json

    server error

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

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."
}