v1

latestSwagger 2.02026-07-17107114423.2 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 the container

Createdstring

The time the container was created

Pathstring

The path to the command being run

Argsstring[]

The arguments to the command being run

Imagestring

The container's image ID

ResolvConfPathstring
HostnamePathstring
HostsPathstring
LogPathstring
Namestring
RestartCountinteger
Driverstring
Platformstring
MountLabelstring
ProcessLabelstring
AppArmorProfilestring
ExecIDsstring[] nullable

IDs of exec instances that are running in the container.

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.

Example response

{
  "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"
        }
      ]
    }
  },
  "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"
          ]
        ]
      }
    ],
    "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": [
      {
        "VolumeOptions": {
          "Subpath": "dir-inside-volume/subdirectory"
        },
        "TmpfsOptions": {
          "Options": [
            [
              "noexec"
            ]
          ]
        }
      }
    ],
    "OomScoreAdj": 500
  },
  "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",
    "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": {
    "Bridge": "docker0",
    "SandboxID": "9d12daf2c33f5959c8bf90aa513e4f65b561738661003029ec84830cd503a0c3",
    "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
    },
    "SandboxKey": "/var/run/docker/netns/8ab54b426c38",
    "EndpointID": "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b",
    "Gateway": "172.17.0.1",
    "GlobalIPv6Address": "2001:db8::5689",
    "GlobalIPv6PrefixLen": 64,
    "IPAddress": "172.17.0.4",
    "IPPrefixLen": 16,
    "IPv6Gateway": "2001:db8:2::100",
    "MacAddress": "02:42:ac:11:00:04"
  }
}