Intermediate By Samson Tanimawo, PhD Published Sep 20, 2026 5 min read

Docker Debug Cheat Sheet

When the container won't start, won't stop, or won't behave, these commands tell you why. Skip the docs; type these.

List and filter

Start by knowing what's running, what crashed, and what's about to.

Logs

The first stop. --since is the flag that turns 10,000-line logs into the 200 lines you actually need.

Exec into a container

Get a shell inside. Try bash first, fall back to sh, fall back further to nsenter.

Inspect

Everything Docker knows about a container or image, in one JSON blob. Pair with jq.

Resource pressure

Live CPU, memory, network IO, block IO per container. Use it to confirm a container is hot before you start blaming it.

Disk and prune

Docker fills disks. Reclaim space carefully.

Networking

"My container can't reach the database." Half the time it's networks, half the time it's DNS, occasionally it's actually the database.