beginnerDockerfile Instructions & Multi-Stage Builds

What does HEALTHCHECK do, and how does Docker use the result?

HEALTHCHECK defines a command Docker runs periodically inside the container (e.g., curl against an actuator/health endpoint). Based on the exit code, Docker marks the container's health status as starting, healthy, or unhealthy, visible via docker ps. Orchestrators and load balancers can use this status to avoid routing traffic to a container that is technically running but not actually ready to serve requests.

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full DevOps Mastery library.

What does HEALTHCHECK do, and how does Docker use the result?

Next Step

Continue to Why might WORKDIR be safer than using RUN cd?← Back to all Docker questions