DCA · Question #97
The following Docker Compose file is deployed as a stack: Is this statement correct about this health check definition? Solution: Health checks test for app health ten seconds apart. Three failed…
The correct answer is A. Yes. This statement accurately describes the effect of a Docker Compose health check configuration with a 10-second interval and 3 retries.
Question
The following Docker Compose file is deployed as a stack:
Is this statement correct about this health check definition? Solution: Health checks test for app health ten seconds apart. Three failed health checks transition the container into "unhealthy" status.
Exhibit
Options
- AYes
- BNo
How the community answered
(62 responses)- A95% (59)
- B5% (3)
Why each option
This statement accurately describes the effect of a Docker Compose health check configuration with a 10-second interval and 3 retries.
A Docker Compose health check defined with an `interval: 10s` means checks occur ten seconds apart. If `retries: 3` is also configured, the container will be marked 'unhealthy' after three consecutive failed health checks.
The description correctly interprets the common `interval` and `retries` parameters within a Docker Compose health check definition.
Concept tested: Docker Compose health check parameters
Source: https://docs.docker.com/compose/compose-file/05-services/#healthcheck
Topics
Community Discussion
No community discussion yet for this question.
