Docker and CI/CD · Junior · Question 38 of 75
What does a HEALTHCHECK instruction add to a container?
- ✓Correct answer: A command Docker runs periodically to mark it healthy or not
- 2A metrics endpoint that monitoring tools can scrape
- 3Automatic restarts whenever the container uses too much CPU
Explanation
Status appears in docker ps and can gate Compose startup (service_healthy). Plain Docker doesn't restart unhealthy containers by itself.