Hosting Operations
Read-onlySee Container Network Attachments
Services cannot reach each other and you need to confirm container network membership.
Command
docker inspect --format '{{.Name}} {{range $name, $net := .NetworkSettings.Networks}}{{$name}} {{$net.IPAddress}} {{end}}' api
Before you run this
System impact: Read-only. Low when scoped to the shown target.
When not to use it: Do not use it as a packet-level diagnosis; follow up with DNS and connectivity checks when needed.
Expected output
/api app_net 172.18.0.5
System impact
Read-only. Nothing changes. Docker reads container networking metadata.
Recovery / rollback: no state is changed.
When to use it
Use when containers cannot connect by service name, expected networks are missing, or IP assumptions look wrong.
When not to use it
Do not use it as a packet-level diagnosis; follow up with DNS and connectivity checks when needed.
next steps
Related commands
Check Container Health Status
Docker may say a container is running while its health check says otherwise.
docker inspect --format '{{.Name}} health={{if .State.Health}}{{.State.Health.Status}}{{else}}none{{end}} status={{.State.Status}}' web
Snapshot Container CPU and Memory
Get Docker resource usage once, without leaving a live dashboard running.
docker stats --no-stream --format 'table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}\t{{.BlockIO}}'
Inspect Container Environment Names
Check what environment variables exist without printing their secret values.
docker inspect --format '{{range .Config.Env}}{{println .}}{{end}}' api | sed 's/=.*$/=<redacted>/'
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}}'
List SQLite User Tables Only
System metadata tables can distract from the app tables you care about.
sqlite3 app.db "SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;"
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.