podman-healthcheck(1)
π podman-healthcheck β manage healthchecks for containers π©Ίβ¨
okay so bestie, welcome to the podman healthcheck suite of commands β it's literally the whole toolkit for managing container healthchecks, from the General Commands Manual (yes that's the vibe, we're fancy here) π
podman healthcheck subcommand
β¨ DESCRIPTION β¨
The podman healthcheck commands are used to manage container healthchecks. That's the whole assignment, and they ate. π
Healthchecks are typically sourced from images β so if you wanna spot one, use podman image inspect and peek at the image's Config section. iykyk. π
You can also define healthchecks yourself when creating a container via podman run or podman create, like:
--health-cmdβ sets the check command (the string form runs viaCMD-SHELL; the array form usesCMD) π«Ά--health-interval,--health-timeout,--health-retries,--health-start-periodβ the whole timing squad β±οΈ--no-healthcheckβ nukes an image-defined healthcheck, no cap π- Startup healthcheck knobs:
--health-startup-cmd,--health-startup-interval,--health-startup-retries,--health-startup-success,--health-startup-timeoutπ
πΈ Startup Healthcheck vs Regular Healthcheck πΈ
Regular healthcheck runs continuously throughout the container's lifetime to monitor ongoing health. The --health-start-period option gives you a grace period during container initialization, where failures won't mark the container as unhealthy. it's giving "give her a minute to wake up" β
Startup healthcheck is a separate healthcheck that runs during container startup and then transitions to the regular healthcheck once the container has successfully started. It's designed for containers with extended or unpredictable startup times:
- Define it with
--health-startup-cmdβ and yes, it requires a regular healthcheck to also be set π - The startup healthcheck cannot be sourced from an image; it can only be set manually, periodt
- Once the startup healthcheck succeeds (based on
--health-startup-successconsecutive successes), it stops and the regular healthcheck takes over π¦ - If it fails too many times (
--health-startup-retries), the container can be restarted based on--health-on-failureπ
When to use each:
- Use
--health-start-periodfor simple cases where you know roughly how long startup takes π - Use the startup healthcheck (
--health-startup-cmd) when startup time is unpredictable, or when you need a different check during startup than during normal operation π
To debug or inspect healthchecks:
- Use
podman inspect <container>and view.Config.Healthcheckfor the effective settings. Other relevant sections are.State.Healthcheck,Config.StartupHealthCheck,.Config.HealthcheckOnFailureAction,.Config.HealthMaxLogCount,.Config.HealthMaxLogSize, and.Config.HealthLogDestinationπ§ - Use
podman inspect --format '{{.State.Health.Status}} {{.Config.Healthcheck}}' <container>to show current health status and healthcheck config π - Trigger on-demand with
podman healthcheck run <container>and check the exit code (0=success,1=failure,125=error) π₯- To get more details on why a healthcheck failed, run
podman --log-level debug healthcheck run <container>π΅οΈ
- To get more details on why a healthcheck failed, run
- Ensure the health command exists inside the container and is quoted properly (prefer single quotes for shell pipelines) π
To update healthchecks:
- Use
podman update <flag> <container>to update the healthcheck settings of a container while the container is running π« - Example:
podman update --health-max-log-count=10 <container>to store up to 10 healthcheck results in the log π
π¦ SUBCOMMANDS π¦
not me turning the table into a list, but every detail is staying, don't worry bestie π
runβ man page:podman-healthcheck-run(1)β Run a container healthcheck π©Ί
π SEE ALSO π
podman(1), podman-run(1), podman-create(1), podman-inspect(1), podman-update(1) β go read them, they're iconic β¨
π HISTORY π
Feb 2019, originally compiled by Brent Baude bbaude@redhat.com β¨mailto:bbaude@redhat.comβ© β thank you Brent, king behavior π
and that's the whole page, bestie π«Ά the footer's just chilling there as podman-healthcheck(1), so consider this your official sign-off from the General Commands Manual β stay healthy, stay hydrated, and check your containers π
ππ
π¦ where this page comes from
- arch rolling: podman 6.1.4-1 Β· Apache-2.0
- centos-stream 10: podman 7:6.1.0-2.el10 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0
- nixpkgs unstable: podman 6.1.4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms