Back to commands

Web Server Rescue

Read-only, can be slow

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}}'

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

Linux Survival Basics Can be slow

List Docker Container Restart Status

Restart loops are visible before rebuilding anything.

docker ps -a --format 'table {{.Names}} {{.Image}} {{.Status}} {{.RestartCount}}'
Hosting Operations Can be slow

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}}'
Web Server Rescue Read-only

Show Published Container Ports

When a service is unreachable, confirm Docker is publishing the port you think it is.

docker port web
Web Server Rescue Can be slow

Read Recent Container Logs

Skip the million-line log scroll and read only the recent failure window.

docker logs --since 10m --tail 100 api
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.

  • LFCS style performance-task practice

Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.