---
title: "Inspect a container"
method: GET
path: "/containers/{id}/json"
tags: ["Container"]
---

# Inspect a container

`GET /containers/{id}/json`

Return low-level information about a container.

## Path parameters

- `id` string, required

## Query parameters

- `size` boolean

## Response `200`

no error

- ContainerJSON — ContainerJSON contains response of Engine API: GET "/containers/{id}/json"
  - `Id` string — The ID of the container
  - `Created` string — The time the container was created
  - `Path` string — The path to the command being run
  - `Args` string[] — The arguments to the command being run
  - `State` ContainerState
    - `Status` 'created' | 'running' | 'stopped' | 'paused' | 'restarting' | 'removing' | 'exited' | 'dead', required — The status of the container. For example, "running" or "exited".
    - `Running` boolean, required — Whether this container is running. Note that a running container can be _paused_. The `Running` and `Paused` booleans are not mutually exclusive: When pausing a container (on Linux), the cgroups freezer is used to suspend all processes in the container. Freezing the process requires the process to be running. As a result, paused containers are both `Running` _and_ `Paused`. Use the `Status` field instead to determine if a container's state is "running".
    - `Paused` boolean, required — Whether this container is paused.
    - `Restarting` boolean, required — Whether this container is restarting.
    - `OOMKilled` boolean, required — Whether this container has been killed because it ran out of memory.
    - `Dead` boolean, required — Whether this container is dead.
    - `Exited` boolean — Whether this container is abnormal stopped. So that we can distinguish whether a container stoppped by API or abnormal. This flag can be used on the circumstances that when the host restart and try to pull up the containers that are running before host down. If we have a container with `RestartPolicy` is `always` but the `Status` is `Stopped`, should we start it or not? So with the `Exited` flag being set, we can make sure that this container is exited by abnormal, we should pull it up. But with status is `Stopped`, we should not pull it up because it is stopped by API.
    - `Pid` integer, required — The process ID of this container
    - `ExitCode` integer, required — The last exit code of this container
    - `Error` string, required — The error message of this container
    - `StartedAt` string, required — The time when this container was last started.
    - `FinishedAt` string, required — The time when this container last exited.
  - `Image` string — The container's image
  - `ResolvConfPath` string — the path of container's resolvConf file on host.
  - `HostnamePath` string — the path of container's hostname file on host.
  - `HostsPath` string — the path of container's hosts file on host.
  - `LogPath` string — the path of container's log file on host.
  - `Name` string — name of the created container.
  - `RestartCount` integer — the container's restart time
  - `Driver` string
  - `MountLabel` string — MountLabel contains the options for the 'mount' command.
  - `ProcessLabel` string
  - `AppArmorProfile` string — AppArmorProfile are specific for AppArmor to Unix platforms
  - `ExecIDs` string[] — exec ids of container
  - `HostConfig` HostConfig — A container's resources (cgroups config, ulimits, etc)
    - `Binds` string[] — A list of volume bindings for this container. Each volume binding is a string in one of these forms: - `host-src:container-dest` to bind-mount a host path into the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - `host-src:container-dest:ro` to make the bind mount read-only inside the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - `volume-name:container-dest` to bind-mount a volume managed by a volume driver into the container. `container-dest` must be an _absolute_ path. - `volume-name:container-dest:ro` to mount the volume read-only inside the container. `container-dest` must be an _absolute_ path.
    - `ContainerIDFile` string — Path to a file where the container ID is written
    - `LogConfig` LogConfig — The logging configuration for this container
      - `Type` 'json-file' | 'syslog' | 'journald' | 'gelf' | 'fluentd' | 'awslogs' | 'splunk' | 'etwlogs' | 'none'
      - `Config` object
    - `RestartPolicy` RestartPolicy — Define container's restart policy
      - `Name` string
      - `MaximumRetryCount` integer
    - `NetworkMode` string — Network mode to use for this container. Supported standard values are: `netns:<path>`, `bridge`, `host`, `none`, and `container:<name|id>`. Any other value is taken as a custom network's name to which this container should connect to.
    - `PortBindings` PortMap — PortMap describes the mapping of container ports to host ports, using the container's port-number and protocol as key in the format `<port>/<protocol>`, for example, `80/udp`. If a container's port is mapped for both `tcp` and `udp`, two separate entries are added to the mapping table.
    - `AutoRemove` boolean — Automatically remove the container when the container's process exits. This has no effect if `RestartPolicy` is set.
    - `VolumeDriver` string — Driver that this container uses to mount volumes.
    - `VolumesFrom` string[] — A list of volumes to inherit from another container, specified in the form `<container name>[:<ro|rw>]`.
    - `CapAdd` string[] — A list of kernel capabilities to add to the container.
    - `CapDrop` string[] — A list of kernel capabilities to drop from the container.
    - `Dns` string[] — A list of DNS servers for the container to use.
    - `DnsOptions` string[] — A list of DNS options.
    - `DnsSearch` string[] — A list of DNS search domains.
    - `ExtraHosts` string[] — A list of hostnames/IP mappings to add to the container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`.
    - `GroupAdd` string[] — A list of additional groups that the container process will run as.
    - `CgroupMode` string — Determine the container has own cgroup namespace, valid values is host `"host"` means own host cgroup namespace, default or other values will share host cgroup namespace. Note cgroup namespace only take effect for kernel > 4.6
    - `IpcMode` string — IPC sharing mode for the container. Possible values are: - `"none"`: own private IPC namespace, with /dev/shm not mounted - `"private"`: own private IPC namespace - `"shareable"`: own private IPC namespace, with a possibility to share it with other containers - `"container:<name|id>"`: join another (shareable) container's IPC namespace - `"host"`: use the host system's IPC namespace If not specified, daemon default is used, which can either be `"private"` or `"shareable"`, depending on daemon version and configuration.
    - `Cgroup` string — Cgroup to use for the container.
    - `Links` string[] — A list of links for the container in the form `container_name:alias`.
    - `OomScoreAdj` integer — An integer value containing the score given to the container in order to tune OOM killer preferences. The range is in [-1000, 1000].
    - `PidMode` string — Set the PID (Process) Namespace mode for the container. It can be either: - `"container:<name|id>"`: joins another container's PID namespace - `"host"`: use the host's PID namespace inside the container
    - `Privileged` boolean — Gives the container full access to the host.
    - `PublishAllPorts` boolean — Allocates a random host port for all of a container's exposed ports.
    - `ReadonlyRootfs` boolean — Mount the container's root filesystem as read only.
    - `SecurityOpt` string[] — A list of string values to customize labels for MLS systems, such as SELinux.
    - `StorageOpt` object — Storage driver options for this container, in the form `{"size": "120G"}`.
    - `Tmpfs` object — A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options. For example: `{ "/run": "rw,noexec,nosuid,size=65536k" }`.
    - `UTSMode` string — UTS namespace to use for the container.
    - `UsernsMode` string — Sets the usernamespace mode for the container when usernamespace remapping option is enabled.
    - `ShmSize` integer — Size of `/dev/shm` in bytes. If omitted, the system uses 64MB.
    - `Sysctls` object — A list of kernel parameters (sysctls) to set in the container. For example: `{"net.ipv4.ip_forward": "1"}`
    - `Runtime` string — Runtime to use with this container.
    - `RuntimeType` string — The runtime type used in containerd.
    - `ConsoleSize` integer[] — Initial console size, as an `[height, width]` array. (Windows only)
    - `Isolation` 'default' | 'process' | 'hyperv' — Isolation technology of the container. (Windows only)
    - `EnableLxcfs` boolean — Whether to enable lxcfs.
    - `Rich` boolean — Whether to start container in rich container mode. (default false)
    - `RichMode` 'dumb-init' | 'sbin-init' | 'systemd' — Choose one rich container mode.(default dumb-init)
    - `InitScript` string — Initial script executed in container. The script will be executed before entrypoint or command
    - `MaskedPaths` string[] — Masks over the provided paths inside the container.
    - `ReadonlyPaths` string[] — Set the provided paths as RO inside the container.
    - `CgroupParent` string — Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist.
    - `BlkioWeight` integer — Block IO weight (relative weight), need CFQ IO Scheduler enable.
    - `BlkioWeightDevice` WeightDevice[] — Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`.
      - `Path` string — Weight Device
      - `Weight` integer
    - `BlkioDeviceReadBps` ThrottleDevice[] — Limit read rate (bytes per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`.
      - `Path` string — Device path
      - `Rate` integer — Rate
    - `BlkioDeviceWriteBps` ThrottleDevice[] — Limit write rate (bytes per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`.
      - `Path` string — Device path
      - `Rate` integer — Rate
    - `BlkioDeviceReadIOps` ThrottleDevice[] — Limit read rate (IO per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`.
      - `Path` string — Device path
      - `Rate` integer — Rate
    - `BlkioDeviceWriteIOps` ThrottleDevice[] — Limit write rate (IO per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`.
      - `Path` string — Device path
      - `Rate` integer — Rate
    - `CpuShares` integer — An integer value representing this container's relative CPU weight versus other containers.
    - `CpuPeriod` integer — CPU CFS (Completely Fair Scheduler) period. The length of a CPU period in microseconds.
    - `CpuQuota` integer — CPU CFS (Completely Fair Scheduler) quota. Microseconds of CPU time that the container can get in a CPU period."
    - `CpuRealtimePeriod` integer — The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks.
    - `CpuRealtimeRuntime` integer — The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks.
    - `CpusetCpus` string — CPUs in which to allow execution (e.g., `0-3`, `0,1`)
    - `CpusetMems` string — Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.
    - `Devices` DeviceMapping[] — A list of devices to add to the container.
      - `PathOnHost` string — path on host of the device mapping
      - `PathInContainer` string — path in container of the device mapping
      - `CgroupPermissions` string — cgroup permissions of the device
    - `DeviceCgroupRules` string[] — a list of cgroup rules to apply to the container
    - `KernelMemory` integer — Kernel memory limit in bytes.
    - `Memory` integer — Memory limit in bytes.
    - `MemoryReservation` integer — Memory soft limit in bytes.
    - `MemorySwap` integer — Total memory limit (memory + swap). Set as `-1` to enable unlimited swap.
    - `MemorySwappiness` integer — Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. -1 is also accepted, as a legacy alias of 0.
    - `NanoCpus` integer — CPU quota in units of 10<sup>-9</sup> CPUs.
    - `OomKillDisable` boolean, nullable — Disable OOM Killer for the container.
    - `PidsLimit` integer — Tune a container's pids limit. Set -1 for unlimited. Only on Linux 4.4 does this parameter support.
    - `Ulimits` Ulimit[] — A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`"
      - `Name` string — Name of ulimit
      - `Soft` integer — Soft limit
      - `Hard` integer — Hard limit
    - `CpuCount` integer — The number of usable CPUs (Windows only). On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last.
    - `CpuPercent` integer — The usable percentage of the available CPUs (Windows only). On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last.
    - `IOMaximumIOps` integer — Maximum IOps for the container system drive (Windows only)
    - `IOMaximumBandwidth` integer — Maximum IO in bytes per second for the container system drive (Windows only)
    - `IntelRdtL3Cbm` string — IntelRdtL3Cbm specifies settings for Intel RDT/CAT group that the container is placed into to limit the resources (e.g., L3 cache) the container has available.
    - `ScheLatSwitch` integer — ScheLatSwitch enables scheduler latency count in cpuacct
    - `MemoryWmarkRatio` integer, nullable — MemoryWmarkRatio is an integer value representing this container's memory low water mark percentage. The value of memory low water mark is memory.limit_in_bytes * MemoryWmarkRatio.
    - `MemoryExtra` integer, nullable — MemoryExtra is an integer value representing memory extra in bytes
    - `MemoryForceEmptyCtl` integer — MemoryForceEmptyCtl represents whether to reclaim the page cache when deleting cgroup.
    - `NvidiaConfig` NvidiaConfig
      - `NvidiaVisibleDevices` string — NvidiaVisibleDevices controls which GPUs will be made accessible inside the container
      - `NvidiaDriverCapabilities` string — NvidiaDriverCapabilities controls which driver libraries/binaries will be mounted inside the container
  - `SizeRw` integer, nullable — The size of files that have been created or changed by this container.
  - `SizeRootFs` integer, nullable — The total size of all the files in this container.
  - `Config` ContainerConfig — Configuration for a container that is portable between hosts
    - `Hostname` string, hostname — The hostname to use for the container, as a valid RFC 1123 hostname.
    - `Domainname` string — The domain name to use for the container.
    - `User` string — The user that commands are run as inside the container.
    - `AttachStdin` boolean — Whether to attach to `stdin`.
    - `AttachStdout` boolean — Whether to attach to `stdout`.
    - `AttachStderr` boolean — Whether to attach to `stderr`.
    - `DisableNetworkFiles` boolean — Whether to generate the network files(/etc/hostname, /etc/hosts and /etc/resolv.conf) for container.
    - `ExposedPorts` object — An object mapping ports to an empty object in the form:`{<port>/<tcp|udp>: {}}`
    - `Tty` boolean — Attach standard streams to a TTY, including `stdin` if it is not closed.
    - `OpenStdin` boolean — Open `stdin`
    - `StdinOnce` boolean — Close `stdin` after one attached client disconnects
    - `Env` string[] — A list of environment variables to set inside the container in the form `["VAR=value", ...]`. A variable like "A=" means setting env A in container to be empty value. And a variable without `=` is removed from the environment, rather than to have an empty value.
    - `Cmd` string[] — Command to run specified an array of strings.
    - `ArgsEscaped` boolean — Command is already escaped (Windows only)
    - `Image` string, required — The name of the image to use when creating the container
    - `Volumes` object — An object mapping mount point paths inside the container to empty objects.
    - `WorkingDir` string — The working directory for commands to run in.
    - `Entrypoint` string[] — The entry point for the container as a string or an array of strings. If the array consists of exactly one empty string (`[""]`) then the entry point is reset to system default.
    - `NetworkDisabled` boolean — Disable networking for the container.
    - `MacAddress` string — MAC address of the container.
    - `OnBuild` string[] — `ONBUILD` metadata that were defined.
    - `Labels` object — User-defined key/value metadata.
    - `StopSignal` string — Signal to stop a container as a string or unsigned integer.
    - `StopTimeout` integer — Timeout to stop a container in seconds.
    - `Shell` string[] — Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell.
    - `Rich` boolean — Whether to start container in rich container mode. (default false)
    - `RichMode` 'dumb-init' | 'sbin-init' | 'systemd' — Choose one rich container mode.(default dumb-init)
    - `InitScript` string — Initial script executed in container. The script will be executed before entrypoint or command
    - `DiskQuota` object, nullable — Set disk quota for container. Key is the dir in container. Value is disk quota size for the dir. / means rootfs dir in container. .* includes rootfs dir and all volume dir.
    - `SpecAnnotation` object — annotations send to runtime spec.
    - `QuotaID` string — Set disk quota by specified quota id. If QuotaID <= 0, it means pouchd should allocate a unique quota id by sequence automatically. By default, a quota ID is mapped to only one container. And one quota ID can include several mountpoint.
    - `NetPriority` integer — net priority.
    - `SpecificID` string — Create container with given id. MinLength: 64 MaxLength: 64 The characters of given id should be in 0123456789abcdef. By default, given id is unnecessary.
    - `Snapshotter` string — The snapshotter container choose, can be different with default snapshotter. The Field only set through hook plugin.
  - `Snapshotter` SnapshotterData — Information about a container's snapshotter.
    - `Name` string, required
    - `Data` object, required
  - `GraphDriver` GraphDriverData — Information about a container's graph driver.
    - `Name` string, required
    - `Data` object, required
  - `Mounts` MountPoint[] — Set of mount point in a container.
    - `Type` string
    - `ID` string
    - `Name` string
    - `Source` string
    - `Destination` string
    - `Driver` string
    - `Mode` string
    - `RW` boolean
    - `CopyData` boolean
    - `Named` boolean
    - `Replace` string
    - `Propagation` string
  - `NetworkSettings` NetworkSettings — NetworkSettings exposes the network settings in the API.
    - `Bridge` string — Name of the network'a bridge (for example, `pouch-br`).
    - `SandboxID` string — SandboxID uniquely represents a container's network stack.
    - `HairpinMode` boolean — Indicates if hairpin NAT should be enabled on the virtual interface
    - `LinkLocalIPv6Address` string — IPv6 unicast address using the link-local prefix
    - `LinkLocalIPv6PrefixLen` integer — Prefix length of the IPv6 unicast address.
    - `Ports` PortMap — PortMap describes the mapping of container ports to host ports, using the container's port-number and protocol as key in the format `<port>/<protocol>`, for example, `80/udp`. If a container's port is mapped for both `tcp` and `udp`, two separate entries are added to the mapping table.
    - `SandboxKey` string — SandboxKey identifies the sandbox
    - `SecondaryIPAddresses` IPAddress[], nullable
      - `Addr` string — IP address.
      - `PrefixLen` integer — Mask length of the IP address.
    - `SecondaryIPv6Addresses` IPAddress[], nullable
      - `Addr` string — IP address.
      - `PrefixLen` integer — Mask length of the IP address.
    - `Networks` object — Information about all networks that the container is connected to
  - `HostRootPath` string — The rootfs path of the container on the host.

## Other responses

- `404` — An unexpected 404 error occurred.
- `500` — An unexpected server error occurred.

---

[API](https://skmtc.dev/aliyun/apis/pouch-engine-api.md) · [All operations](https://skmtc.dev/aliyun/apis/pouch-engine-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/aliyun/pouch-engine-api/revisions/36d75b2825fc/schema)
