Back to lessons

Hosting Operations

Show Containers in a Clean Triage Table

You need a fast view of container state, image, uptime, and published ports without wrapped columns hiding the important parts.

Command

docker ps -a --format 'table {{.Names}}\t{{.Status}}\t{{.Image}}\t{{.Ports}}'

What changed

Nothing changes. Docker prints container metadata in a narrower table.

Danger

safe

When to use it

Use during first-response container triage to see what is running, stopped, restarting, or exposing ports.

When not to use it

Do not treat it as an application health check; it reports Docker state, not whether the app works.

Undo or recovery

No undo needed because this command is read-only.

Expected output

A table with container names, statuses, images, and port mappings.

demo script

Disposable terminal steps

  1. docker ps -a --format 'table {{.Names}}\t{{.Status}}\t{{.Image}}\t{{.Ports}}'
  2. docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'

simulated output

What it looks like

disposable vessel
::fixture-ready::
$ docker ps -a --format 'table {{.Names}}\t{{.Status}}\t{{.Image}}\t{{.Ports}}'
NAMES     STATUS                         IMAGE                         PORTS
web       Up 2 hours (healthy)           nginx:1.27                    0.0.0.0:8080->80/tcp
api       Restarting (1) 18 seconds ago  registry.example/api:v1.9.4   0.0.0.0:9000->9000/tcp
worker    Exited (0) 3 hours ago         registry.example/worker:v1.9.4
::exit-code::0
$ docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'
NAMES  STATUS                PORTS
web    Up 2 hours (healthy)  0.0.0.0:8080->80/tcp
::exit-code::0

YouTube Short

Readable docker ps.

When Docker output wraps into a mess, format it. Names, status, image, and ports are the first fields you need.

LinkedIn hook

Turn noisy docker ps output into the few fields operators scan first.

Question: What fields do you always want in your first Docker triage view?

experiments

A/B tests to run

Metric: shorts_completion_rate

A: Turn noisy docker ps output into a clean table.

B: Your first Docker triage command should be readable.