What causes a container in a crash loop with a growing delay, and how do you triage?
IntermediateProductionResource Limits, Health & Reliability
Answer
docker ps shows Restarting (1) 5 seconds ago. Triage:
docker logs --tail 100 app
docker inspect -f '{{.State.ExitCode}} {{.State.Error}} {{.State.OOMKilled}}' app
docker run --rm -it --entrypoint sh app:1.4.2 # reproduce
Typical causes: bad config/env, missing secret, unreachable dependency, permission denied on a volume, OOM.
More on Resource Limits, Health & Reliability
How do you set memory and CPU limits, and what happens when they are exceeded?BeginnerWhat is the difference between `--cpus`, `--cpu-shares` and `--cpuset-cpus`?BeginnerWhat does `--memory-reservation` do?AdvancedHow do you diagnose an OOM-killed container?IntermediateWhy do JVM and Node services in containers need explicit memory flags?IntermediateWhat is CPU throttling, and how do you detect it?Advanced