v51

latestSwagger 2.0raw.githubusercontent.com2026-08-01108160461.1 KB
Container

Inspect a container

Return low-level information about a container.

get/containers/{id}/json

Path parameters

idstring required

ID or name of the container

Query parameters

sizeboolean

Return the size of container as fields SizeRw and SizeRootFs

Response

no error

Idstring

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

Createdstring dateTime nullable

Date and time at which the container was created, formatted in RFC 3339 format with nano-seconds.

Pathstring

The path to the command being run

Argsstring[]

The arguments to the command being run

Imagestring

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

ResolvConfPathstring

Location of the /etc/resolv.conf generated for the container on the host.

This file is managed through the docker daemon, and should not be accessed or modified by other tools.

HostnamePathstring

Location of the /etc/hostname generated for the container on the host.

This file is managed through the docker daemon, and should not be accessed or modified by other tools.

HostsPathstring

Location of the /etc/hosts generated for the container on the host.

This file is managed through the docker daemon, and should not be accessed or modified by other tools.

LogPathstring nullable

Location of the file used to buffer the container's logs. Depending on the logging-driver used for the container, this field may be omitted.

This file is managed through the docker daemon, and should not be accessed or modified by other tools.

Namestring

The name associated with this container.

For historic reasons, the name may be prefixed with a forward-slash (/).

RestartCountinteger

Number of times the container was restarted since it was created, or since daemon was started.

Driverstring

The storage-driver used for the container's filesystem (graph-driver or snapshotter).

Platformstring

The platform (operating system) for which the container was created.

This field was introduced for the experimental "LCOW" (Linux Containers On Windows) features, which has been removed. In most cases, this field is equal to the host's operating system (linux or windows).

MountLabelstring

SELinux mount label set for the container.

ProcessLabelstring

SELinux process label set for the container.

AppArmorProfilestring

The AppArmor profile set for the container.

ExecIDsstring[] nullable

IDs of exec instances that are running in the container.

SizeRwinteger nullable

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.

SizeRootFsinteger nullable

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.

Example response

{
  "Id": "aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf",
  "Created": "2025-02-17T17:43:39.64001363Z",
  "Path": "/bin/sh",
  "Args": [
    "-c",
    "exit 9"
  ],
  "State": {
    "Status": "running",
    "Running": true,
    "Pid": 1234,
    "StartedAt": "2020-01-06T09:06:59.461876391Z",
    "FinishedAt": "2020-01-06T09:07:59.461876391Z",
    "Health": {
      "Status": "healthy",
      "Log": [
        {
          "Start": "2020-01-04T10:44:24.496525531Z",
          "End": "2020-01-04T10:45:21.364524523Z"
        }
      ]
    }
  },
  "Image": "sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782",
  "ResolvConfPath": "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/resolv.conf",
  "HostnamePath": "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/hostname",
  "HostsPath": "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/hosts",
  "LogPath": "/var/lib/docker/containers/5b7c7e2b992aa426584ce6c47452756066be0e503a08b4516a433a54d2f69e59/5b7c7e2b992aa426584ce6c47452756066be0e503a08b4516a433a54d2f69e59-json.log",
  "Name": "/funny_chatelet",
  "Driver": "overlayfs",
  "Platform": "linux",
  "ImageManifestDescriptor": {
    "mediaType": "application/vnd.oci.image.manifest.v1+json",
    "digest": "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96",
    "size": 424,
    "annotations": {
      "com.docker.official-images.bashbrew.arch": "amd64",
      "org.opencontainers.image.base.digest": "sha256:0d0ef5c914d3ea700147da1bd050c59edb8bb12ca312f3800b29d7c8087eabd8",
      "org.opencontainers.image.base.name": "scratch",
      "org.opencontainers.image.created": "2025-01-27T00:00:00Z",
      "org.opencontainers.image.revision": "9fabb4bad5138435b01857e2fe9363e2dc5f6a79",
      "org.opencontainers.image.source": "https://git.launchpad.net/cloud-images/+oci/ubuntu-base",
      "org.opencontainers.image.url": "https://hub.docker.com/_/ubuntu",
      "org.opencontainers.image.version": "24.04"
    },
    "platform": {
      "architecture": "arm",
      "os": "windows",
      "os.version": "10.0.19041.1165",
      "os.features": [
        "win32k"
      ],
      "variant": "v7"
    }
  },
  "ExecIDs": [
    "b35395de42bc8abd327f9dd65d913b9ba28c74d2f0734eeeae84fa1c616a0fca",
    "3fc1232e5cd20c8de182ed81178503dc6437f4e7ef12b52cc5e8de020652f1c4"
  ],
  "HostConfig": {
    "CpusetCpus": "0-3",
    "Devices": [
      {
        "PathOnHost": "/dev/deviceName",
        "PathInContainer": "/dev/deviceName",
        "CgroupPermissions": "mrw"
      }
    ],
    "DeviceCgroupRules": [
      "c 13:* rwm"
    ],
    "DeviceRequests": [
      {
        "Driver": "nvidia",
        "Count": -1,
        "DeviceIDs": [
          "0",
          "1",
          "GPU-fef8089b-4820-abfc-e83e-94318197576e"
        ],
        "Capabilities": [
          [
            "gpu",
            "nvidia",
            "compute"
          ]
        ]
      }
    ],
    "LogConfig": {
      "Config": {
        "max-file": "5",
        "max-size": "10m"
      }
    },
    "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"
        }
      ],
      "53/udp": [
        {
          "HostIp": "0.0.0.0",
          "HostPort": "53"
        }
      ],
      "2377/tcp": null
    },
    "Mounts": [
      {
        "Type": "volume",
        "VolumeOptions": {
          "Subpath": "dir-inside-volume/subdirectory"
        },
        "ImageOptions": {
          "Subpath": "dir-inside-image/subdirectory"
        },
        "TmpfsOptions": {
          "Options": [
            [
              "noexec"
            ]
          ]
        }
      }
    ],
    "ConsoleSize": [
      80,
      64
    ],
    "OomScoreAdj": 500,
    "Sysctls": {
      "net.ipv4.ip_forward": "1"
    },
    "MaskedPaths": [
      "/proc/asound",
      "/proc/acpi",
      "/proc/kcore",
      "/proc/keys",
      "/proc/latency_stats",
      "/proc/timer_list",
      "/proc/timer_stats",
      "/proc/sched_debug",
      "/proc/scsi",
      "/sys/firmware",
      "/sys/devices/virtual/powercap"
    ],
    "ReadonlyPaths": [
      "/proc/bus",
      "/proc/fs",
      "/proc/irq",
      "/proc/sys",
      "/proc/sysrq-trigger"
    ]
  },
  "GraphDriver": {
    "Name": "overlay2",
    "Data": {
      "MergedDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/merged",
      "UpperDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/diff",
      "WorkDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/work"
    }
  },
  "Mounts": [
    {
      "Type": "volume",
      "Name": "myvolume",
      "Source": "/var/lib/docker/volumes/myvolume/_data",
      "Destination": "/usr/share/nginx/html/",
      "Driver": "local",
      "Mode": "z",
      "RW": true
    }
  ],
  "Config": {
    "Hostname": "439f4e91bd1d",
    "User": "123:456",
    "ExposedPorts": {
      "80/tcp": {},
      "443/tcp": {}
    },
    "Env": [
      "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
    ],
    "Cmd": [
      "/bin/sh"
    ],
    "Image": "example-image:1.0",
    "WorkingDir": "/public/",
    "Entrypoint": [],
    "OnBuild": [],
    "Labels": {
      "com.example.some-label": "some-value",
      "com.example.some-other-label": "some-other-value"
    },
    "StopSignal": "SIGTERM",
    "Shell": [
      "/bin/sh",
      "-c"
    ]
  },
  "NetworkSettings": {
    "SandboxID": "9d12daf2c33f5959c8bf90aa513e4f65b561738661003029ec84830cd503a0c3",
    "SandboxKey": "/var/run/docker/netns/8ab54b426c38",
    "Ports": {
      "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"
        }
      ],
      "53/udp": [
        {
          "HostIp": "0.0.0.0",
          "HostPort": "53"
        }
      ],
      "2377/tcp": null
    }
  }
}