Containers isolate applications, but sometimes they fail. Why is it important to debug containers?
Think about how containers run separately from your computer.
Debugging containers helps find and fix problems inside the container safely, without risking the host system.
What is the output of this command if the container 'webapp' is stopped?
docker inspect -f '{{.State.Status}}' webappCheck the container's state when it is not running.
The command shows the container's status. If the container is stopped, the status is 'exited'.
You run docker run myapp but the container exits immediately. Which command helps you see why?
Look for the container's output messages.
docker logs shows the output and errors from the container, helping to understand why it stopped.
Which sequence correctly describes how to debug a running container by opening a shell inside it?
Start by identifying the container, then open a shell inside it.
You first find the container, then open an interactive shell, explore inside, and finally exit.
What is the best practice for debugging containers running in a production environment?
Think about safety and stability in production.
Using logs and monitoring avoids risks of changing running containers and helps maintain stability.