Docker & Containers
Debugging a running container: exec, logs, inspect, nsenter
The container is Up, the health check is green and users still get errors. Debugging it means asking the container, the kernel and the host in a fixed order, and having a plan when the image has no shell.
What is in the lesson
- A real situation where this goes wrong
- How it works, step by step
- A walkthrough with commands you can run
- How it fails in production, and how to tell
- Three quiz questions with explanations
Read this lessonFree. No account needed.
More in Docker & Containers
- Why did my container exit? Exit codes 0, 1, 137 and 143Beginner · 5 min
Every stopped container leaves a number behind. Read it, and a mystery restart loop becomes one of three or four causes you can test in a minute.
- PID 1, signal forwarding and why docker stop takes 10 secondsBeginner · 5 min
docker stop waits exactly ten seconds and then kills your service. The ten seconds are not Docker being slow: your program is PID 1, and the kernel treats PID 1…
- Layer caching: order your Dockerfile for fast buildsBeginner · 5 min
A Node.js service rebuilds in over four minutes after every one-line edit because the dependency install runs again. The fix is moving two lines, and it works only once…
- Multi-stage builds and small imagesBeginner · 5 min
A Go service that compiles to a 14 MB binary ships as a 1.1 GB image, because the compiler came along for the ride. Multi-stage builds leave the toolbox behind.
- Tags vs digests: reproducible buildsBeginner · 5 min
Friday's build passed and Monday's failed with the same Dockerfile and the same commit. A tag is a label someone can move, and a digest is a fingerprint no one can.
- OCI image manifestBeginner · 4 min
OCI image manifest describes layers configuration and platform.