ContainerState stores container's running state. It's part of ContainerJSONBase and will be returned by the "inspect" command. ContainerState

interface ContainerState {
    Dead?: boolean;
    Error?: string;
    ExitCode?: number;
    FinishedAt?: string;
    Health?: null | Health;
    OOMKilled?: boolean;
    Paused?: boolean;
    Pid?: number;
    Restarting?: boolean;
    Running?: boolean;
    StartedAt?: string;
    Status?: ContainerStateStatusEnum;
}

Properties

Dead?: boolean
Error?: string
ExitCode?: number

The last exit code of this container

FinishedAt?: string

The time when this container last exited.

Health?: null | Health
OOMKilled?: boolean

Whether this container has been killed because it ran out of memory.

Paused?: boolean

Whether this container is paused.

Pid?: number

The process ID of this container

Restarting?: boolean

Whether this container is restarting.

Running?: boolean

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 freezer cgroup 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".

StartedAt?: string

The time when this container was last started.

String representation of the container state. Can be one of "created", "running", "paused", "restarting", "removing", "exited", or "dead".