Clarification on Docker Compose's `start_period` paramter

Viewed 8776

I am trying to understand how the start_period works with Docker Compose. If we have the following as a Healthcheck:

--start-period=60s --retries=2

Does that mean that Docker Swarm will try twice, each time wait 60 sec before considering the container Unhealthy?

Thank you.

1 Answers

Yup exactly.

Start period provides initialization time for containers that need time to bootstrap. Probe failure during that period will not be counted towards the maximum number of retries. However, if a health check succeeds during the start period, the container is considered started and all consecutive failures will be counted towards the maximum number of retries.

Related