restart count
The number of times Docker has restarted a container under its restart policy, recorded in the container's state.
In more detail
Every automatic restart reuses the same container, so the count keeps climbing while the status can look normal between crashes. Read it with docker inspect and a format string. A rising restart count is the clearest sign of a crash loop.
Example
docker inspect -f '{{.RestartCount}}' m07l01-loopRelated terms
- restart policy — A setting that tells Docker or Kubernetes whether to start a container again automatically after it exits.
- exit code — A number a process returns when it finishes: 0 means success, anything else means something went wrong.
- docker inspect — Prints everything Docker knows about a container or image as JSON: state, configuration, mounts, network settings and more.
- container status — The current state of a container as Docker reports it, such as created, running, exited or restarting.
Taught in
- Probes And Health Checks — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Mock Exam: Sixteen Tasks Against The Clock — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Diagnose Crashes, Resource Limits And Unhealthy Containers — Docker Architecture & Production Containers