Debugging containers
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
find out why a container misbehaves.
Planned topics
docker logs -f NAMEshows the output of the app.docker exec -it NAME shopens a shell inside a running container.docker inspect NAMEshows environment, mounts, network, and exit code.docker ps -ashows stopped containers; check their exit code (137 often means killed, for example out of memory).- Check the simple things first: wrong port, wrong env var, wrong hostname.
Draft outline details
Demonstration
docker logs shop, docker exec -it shop sh, docker inspect shop --format '{{.State.ExitCode}}'.
Check your understanding
Which command opens a shell in a running container?
Show answer
docker exec -it NAME sh.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.