docs/source/markdown/podman-healthcheck.1.md
% podman-healthcheck 1
podman-healthcheck - Manage healthchecks for containers
podman healthcheck subcommand
The podman healthcheck suite of commands are used to manage container healthchecks.
Healthchecks are typically sourced from images. Use podman image inspect to identify a healthcheck in the image's Config section.
Healthchecks can also be defined when creating a container via podman run or podman create using:
--health-cmd to set the check command (string form runs via CMD-SHELL; array form uses CMD)--health-interval, --health-timeout, --health-retries, --health-start-period--no-healthcheck to disable an image-defined healthcheck--health-startup-cmd, --health-startup-interval, --health-startup-retries, --health-startup-success, --health-startup-timeoutRegular healthcheck runs continuously throughout the container's lifetime to monitor ongoing health. The --health-start-period option provides a grace period during container initialization where failures won't mark the container as unhealthy.
Startup healthcheck is a separate healthcheck that runs during container startup and transitions to the regular healthcheck once the container has successfully started. It's designed for containers with extended or unpredictable startup times:
--health-startup-cmd (requires a regular healthcheck to also be set)--health-startup-success consecutive successes), it stops and the regular healthcheck takes over--health-startup-retries), the container can be restarted based on --health-on-failureWhen to use each:
--health-start-period for simple cases where you know roughly how long startup takes--health-startup-cmd) when startup time is unpredictable or you need a different check during startup than during normal operationTo debug or inspect healthchecks:
podman inspect <container> and view .Config.Healthcheck for the effective settings. Other relevant sections are .State.Healthcheck, Config.StartupHealthCheck, .Config.HealthcheckOnFailureAction, .Config.HealthMaxLogCount, .Config.HealthMaxLogSize, and .Config.HealthLogDestinationpodman inspect --format '{{.State.Health.Status}} {{.Config.Healthcheck}}' <container> to show current health status and healthcheck configpodman healthcheck run <container> and check the exit code (0=success, 1=failure, 125=error)
podman --log-level debug healthcheck run <container>To update healthchecks:
podman update <flag> <container> to update the healthcheck settings of a container while the container is runningpodman update --health-max-log-count=10 <container> to store up to 10 healthcheck results in the log| Command | Man Page | Description |
|---|---|---|
| run | podman-healthcheck-run(1) | Run a container healthcheck |
podman(1), podman-run(1), podman-create(1), podman-inspect(1), podman-update(1)
Feb 2019, Originally compiled by Brent Baude [email protected]