docker events
The command that prints the daemon's real-time stream of events, such as a container starting, dying, being killed for memory or changing health.
In more detail
Filters narrow the stream to one container or one kind of event, and the since and until options replay a time window instead of waiting for new events. Each die event carries the exit code, so a crash loop reads as a repeating start and die sequence.
Example
docker events --since 20s --until 0s -f container=m07l01-loopRelated terms
- docker inspect — Prints everything Docker knows about a container or image as JSON: state, configuration, mounts, network settings and more.
- exit code — A number a process returns when it finishes: 0 means success, anything else means something went wrong.
- restart policy — A setting that tells Docker or Kubernetes whether to start a container again automatically after it exits.
- health check — A regular automated test of whether a program or service is working, such as a request to its health endpoint or a command run inside its container.
Taught in
- Diagnose Crashes, Resource Limits And Unhealthy Containers — Docker Architecture & Production Containers