Web Server Rescue
Find Restarting Containers Fast
A service is unstable and you need to quickly identify containers stuck restarting.
Command
docker ps -a --filter status=restarting --format 'table {{.Names}}\t{{.Status}}\t{{.Image}}'
What changed
Nothing changes. Docker filters container metadata to restarting containers.
Danger
safe
When to use it
Use when an app is unavailable, flapping, or repeatedly failing startup checks.
When not to use it
Do not stop at this command; follow with recent logs for the failing container.
Undo or recovery
No undo needed because this command is read-only.
Expected output
A table of restarting containers, or no rows if none match.
demo script
Disposable terminal steps
docker ps -a --filter status=restarting --format 'table {{.Names}}\t{{.Status}}\t{{.Image}}'docker logs --tail 40 api
simulated output
What it looks like
::fixture-ready::
$ docker ps -a --filter status=restarting --format 'table {{.Names}}\t{{.Status}}\t{{.Image}}'
NAMES STATUS IMAGE
api Restarting (1) 18 seconds ago registry.example/api:v1.9.4
::exit-code::0
$ docker logs --tail 40 api
api: loading config
api: ERROR database connection refused
api: exiting with code 1
::exit-code::0
YouTube Short
Find Docker restart loops.
If a host feels broken, look for restart loops first. This filter shows only containers in restarting state.
LinkedIn hook
Restart loops hide in plain sight unless you filter for them.
Question: Do you check restart loops before digging into app logs?
experiments
A/B tests to run
Metric: save_rate
A: Restart loops hide in plain sight.
B: Before reading logs, find what is restarting.