🐳 Reading Docker Runtime Errors
4 exercises — read real docker run, docker ps, and docker inspect output. Diagnose name conflicts, port conflicts, architecture mismatches, and OOMKilled containers.
Runtime error checklist
- "Conflict. The container name ... already in use" → remove or rename the old container
- "port is already allocated" → something on the host already holds that port
- "exec format error" → CPU architecture mismatch (arm64 vs amd64)
- Exit code 137 → killed by SIGKILL, almost always OOMKilled
Talking about it out loud (Slack / stand-up)
- "It's not crashing — there's already a stopped container with that name from before."
- "Port's already in use on my machine, probably left over from another container."
- "This looks like an arch mismatch — the image was built for arm64 and we're on x86."
- "docker inspect confirms OOMKilled — we need to either raise the memory limit or find the leak."
0 / 4 completed
1 / 4
docker run output — name conflict
{ex.passage} What is the problem, and what does Docker want you to do about it?
Container names must be unique — Docker will not silently reuse or rename one for you.
Every container gets a name (explicit via
The fix:
How to describe this to a colleague: "It's not a real crash — there's already a stopped container called
Every container gets a name (explicit via
--name, or a random one like great_hopper if you don't set one). Docker keeps stopped containers around until you explicitly delete them, so re-running the same docker run --name web ... command a second time hits this conflict even if the first "web" container already exited.The fix:
docker rm web to delete the old container, or docker rm -f web if it's still running, or add --rm to future docker run commands so the container is auto-deleted on exit.How to describe this to a colleague: "It's not a real crash — there's already a stopped container called
web from a previous run. I just need to remove it first." This distinguishes a naming conflict (harmless, easy fix) from an actual application failure — useful vocabulary when triaging in a channel.