Web Server Rescue
Read-only, can be slowFind 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}}'
Before you run this
System impact: Read-only. Can create load on large logs, directories, filesystems, or process tables.
When not to use it: Do not stop at this command; follow with recent logs for the failing container.
Expected output
A table of restarting containers, or no rows if none match.
System impact
Read-only, can be slow. Nothing changes. Docker filters container metadata to restarting containers.
Scope this to the smallest useful path or service on busy systems.
Recovery / rollback: no state is changed.
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.
next steps
Related commands
List Docker Container Restart Status
Restart loops are visible before rebuilding anything.
docker ps -a --format 'table {{.Names}} {{.Image}} {{.Status}} {{.RestartCount}}'
Show Containers in a Clean Triage Table
Turn noisy docker ps output into the few fields operators scan first.
docker ps -a --format 'table {{.Names}}\t{{.Status}}\t{{.Image}}\t{{.Ports}}'
Show Published Container Ports
When a service is unreachable, confirm Docker is publishing the port you think it is.
docker port web
Read Recent Container Logs
Skip the million-line log scroll and read only the recent failure window.
docker logs --since 10m --tail 100 api
Check What Is Actually Listening
The app was running. The port was not listening.
ss -tulpn | grep ':80\|:443'
Study mapping
Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.