Search or ask Docker

HealthConfig

HealthConfig schema in Docker Engine API 1.57.

View Markdown

Schema

Type: object

A test to perform to check that the container is healthy. Healthcheck commands should be side-effect free.
Interval

Type: integer

The time to wait between checks in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit.
All schema constraints and annotations
{
  "description": "The time to wait between checks in nanoseconds. It should be 0 or at\nleast 1000000 (1 ms). 0 means inherit.\n",
  "format": "int64",
  "type": "integer"
}
Retries

Type: integer

The number of consecutive failures needed to consider a container as unhealthy. 0 means inherit.
All schema constraints and annotations
{
  "description": "The number of consecutive failures needed to consider a container as\nunhealthy. 0 means inherit.\n",
  "type": "integer"
}
StartInterval

Type: integer

The time to wait between checks in nanoseconds during the start period. It should be 0 or at least 1000000 (1 ms). 0 means inherit.
All schema constraints and annotations
{
  "description": "The time to wait between checks in nanoseconds during the start period.\nIt should be 0 or at least 1000000 (1 ms). 0 means inherit.\n",
  "format": "int64",
  "type": "integer"
}
StartPeriod

Type: integer

Start period for the container to initialize before starting health-retries countdown in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit.
All schema constraints and annotations
{
  "description": "Start period for the container to initialize before starting\nhealth-retries countdown in nanoseconds. It should be 0 or at least\n1000000 (1 ms). 0 means inherit.\n",
  "format": "int64",
  "type": "integer"
}
Test

Type: array

The test to perform. Possible values are:

  • [] inherit healthcheck from image or parent image
  • ["NONE"] disable healthcheck
  • ["CMD", args...] exec arguments directly
  • ["CMD-SHELL", command] run command with system's default shell

A non-zero exit code indicates a failed healthcheck:

  • 0 healthy
  • 1 unhealthy
  • 2 reserved (treated as unhealthy)
  • other values: error running probe
Array item

Type: string

All schema constraints and annotations
{
  "type": "string"
}
All schema constraints and annotations
{
  "description": "The test to perform. Possible values are:\n\n- `[]` inherit healthcheck from image or parent image\n- `[\"NONE\"]` disable healthcheck\n- `[\"CMD\", args...]` exec arguments directly\n- `[\"CMD-SHELL\", command]` run command with system's default shell\n\nA non-zero exit code indicates a failed healthcheck:\n- `0` healthy\n- `1` unhealthy\n- `2` reserved (treated as unhealthy)\n- other values: error running probe\n",
  "items": {
    "type": "string"
  },
  "type": "array"
}
Timeout

Type: integer

The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit.

If the health check command does not complete within this timeout, the check is considered failed and the health check process is forcibly terminated without a graceful shutdown.

All schema constraints and annotations
{
  "description": "The time to wait before considering the check to have hung. It should\nbe 0 or at least 1000000 (1 ms). 0 means inherit.\n\nIf the health check command does not complete within this timeout,\nthe check is considered failed and the health check process is\nforcibly terminated without a graceful shutdown.\n",
  "format": "int64",
  "type": "integer"
}
All schema constraints and annotations
{
  "description": "A test to perform to check that the container is healthy.\nHealthcheck commands should be side-effect free.\n",
  "properties": {
    "Interval": {
      "description": "The time to wait between checks in nanoseconds. It should be 0 or at\nleast 1000000 (1 ms). 0 means inherit.\n",
      "format": "int64",
      "type": "integer"
    },
    "Retries": {
      "description": "The number of consecutive failures needed to consider a container as\nunhealthy. 0 means inherit.\n",
      "type": "integer"
    },
    "StartInterval": {
      "description": "The time to wait between checks in nanoseconds during the start period.\nIt should be 0 or at least 1000000 (1 ms). 0 means inherit.\n",
      "format": "int64",
      "type": "integer"
    },
    "StartPeriod": {
      "description": "Start period for the container to initialize before starting\nhealth-retries countdown in nanoseconds. It should be 0 or at least\n1000000 (1 ms). 0 means inherit.\n",
      "format": "int64",
      "type": "integer"
    },
    "Test": {
      "description": "The test to perform. Possible values are:\n\n- `[]` inherit healthcheck from image or parent image\n- `[\"NONE\"]` disable healthcheck\n- `[\"CMD\", args...]` exec arguments directly\n- `[\"CMD-SHELL\", command]` run command with system's default shell\n\nA non-zero exit code indicates a failed healthcheck:\n- `0` healthy\n- `1` unhealthy\n- `2` reserved (treated as unhealthy)\n- other values: error running probe\n",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "Timeout": {
      "description": "The time to wait before considering the check to have hung. It should\nbe 0 or at least 1000000 (1 ms). 0 means inherit.\n\nIf the health check command does not complete within this timeout,\nthe check is considered failed and the health check process is\nforcibly terminated without a graceful shutdown.\n",
      "format": "int64",
      "type": "integer"
    }
  },
  "type": "object"
}