When a container misbehaves, you need to see inside it: what configuration it has, what it is logging, and what is happening within it right now. Three commands cover the vast majority of this: docker inspect for detailed metadata, docker logs for a container's output, and docker exec to run commands inside a running container. Together they are the essential toolkit for understanding and debugging containers.
inspect reveals a container's (or image's) full configuration as structured data — its network settings, mounts, environment, state, and more. logs shows the output the container's main process has written, the primary window into what an application is doing. exec lets you run a command — often a shell — inside a running container, to look around its filesystem or run diagnostics live.
This lesson covers these three commands and a couple of companions (stats, top) for observing resource use and processes. They are the everyday tools for inspecting and debugging containers, and fluency with them turns an opaque running container into something you can understand and troubleshoot.