Search or ask Docker

ContainerState

ContainerState schema in Docker Engine API 1.57.

View Markdown

Schema

Type: object

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

Type: boolean

All schema constraints and annotations
{
  "example": false,
  "type": "boolean"
}
Error

Type: string

All schema constraints and annotations
{
  "type": "string"
}
ExitCode

Type: integer

The last exit code of this container
All schema constraints and annotations
{
  "description": "The last exit code of this container",
  "example": 0,
  "type": "integer"
}
FinishedAt

Type: string

The time when this container last exited.
All schema constraints and annotations
{
  "description": "The time when this container last exited.",
  "example": "2020-01-06T09:07:59.461876391Z",
  "type": "string"
}
Health

Schema: Health

OOMKilled

Type: boolean

Whether a process within this container has been killed because it ran out of memory since the container was last started.
All schema constraints and annotations
{
  "description": "Whether a process within this container has been killed because it ran\nout of memory since the container was last started.\n",
  "example": false,
  "type": "boolean"
}
Paused

Type: boolean

Whether this container is paused.
All schema constraints and annotations
{
  "description": "Whether this container is paused.",
  "example": false,
  "type": "boolean"
}
Pid

Type: integer

The process ID of this container
All schema constraints and annotations
{
  "description": "The process ID of this container",
  "example": 1234,
  "type": "integer"
}
Restarting

Type: boolean

Whether this container is restarting.
All schema constraints and annotations
{
  "description": "Whether this container is restarting.",
  "example": false,
  "type": "boolean"
}
Running

Type: 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".

All schema constraints and annotations
{
  "description": "Whether this container is running.\n\nNote that a running container can be _paused_. The `Running` and `Paused`\nbooleans are not mutually exclusive:\n\nWhen pausing a container (on Linux), the freezer cgroup is used to suspend\nall processes in the container. Freezing the process requires the process to\nbe running. As a result, paused containers are both `Running` _and_ `Paused`.\n\nUse the `Status` field instead to determine if a container's state is \"running\".\n",
  "example": true,
  "type": "boolean"
}
StartedAt

Type: string

The time when this container was last started.
All schema constraints and annotations
{
  "description": "The time when this container was last started.",
  "example": "2020-01-06T09:06:59.461876391Z",
  "type": "string"
}
Status

Type: string

String representation of the container state. Can be one of "created", "running", "paused", "restarting", "removing", "exited", or "dead".
All schema constraints and annotations
{
  "description": "String representation of the container state. Can be one of \"created\",\n\"running\", \"paused\", \"restarting\", \"removing\", \"exited\", or \"dead\".\n",
  "enum": [
    "created",
    "running",
    "paused",
    "restarting",
    "removing",
    "exited",
    "dead"
  ],
  "example": "running",
  "type": "string"
}
All schema constraints and annotations
{
  "description": "ContainerState stores container's running state. It's part of ContainerJSONBase\nand will be returned by the \"inspect\" command.\n",
  "properties": {
    "Dead": {
      "example": false,
      "type": "boolean"
    },
    "Error": {
      "type": "string"
    },
    "ExitCode": {
      "description": "The last exit code of this container",
      "example": 0,
      "type": "integer"
    },
    "FinishedAt": {
      "description": "The time when this container last exited.",
      "example": "2020-01-06T09:07:59.461876391Z",
      "type": "string"
    },
    "Health": {
      "$ref": "#/components/schemas/Health"
    },
    "OOMKilled": {
      "description": "Whether a process within this container has been killed because it ran\nout of memory since the container was last started.\n",
      "example": false,
      "type": "boolean"
    },
    "Paused": {
      "description": "Whether this container is paused.",
      "example": false,
      "type": "boolean"
    },
    "Pid": {
      "description": "The process ID of this container",
      "example": 1234,
      "type": "integer"
    },
    "Restarting": {
      "description": "Whether this container is restarting.",
      "example": false,
      "type": "boolean"
    },
    "Running": {
      "description": "Whether this container is running.\n\nNote that a running container can be _paused_. The `Running` and `Paused`\nbooleans are not mutually exclusive:\n\nWhen pausing a container (on Linux), the freezer cgroup is used to suspend\nall processes in the container. Freezing the process requires the process to\nbe running. As a result, paused containers are both `Running` _and_ `Paused`.\n\nUse the `Status` field instead to determine if a container's state is \"running\".\n",
      "example": true,
      "type": "boolean"
    },
    "StartedAt": {
      "description": "The time when this container was last started.",
      "example": "2020-01-06T09:06:59.461876391Z",
      "type": "string"
    },
    "Status": {
      "description": "String representation of the container state. Can be one of \"created\",\n\"running\", \"paused\", \"restarting\", \"removing\", \"exited\", or \"dead\".\n",
      "enum": [
        "created",
        "running",
        "paused",
        "restarting",
        "removing",
        "exited",
        "dead"
      ],
      "example": "running",
      "type": "string"
    }
  },
  "type": "object",
  "x-nullable": true
}