Complete the code to list all running Docker containers.
docker [1]The docker ps command lists all running containers. This helps you see which containers are active and may need debugging.
Complete the code to start an interactive shell inside a running container named 'webapp'.
docker exec -it webapp [1]The command docker exec -it webapp /bin/bash opens an interactive shell inside the 'webapp' container, allowing you to debug inside it.
Fix the error in the command to view logs of a container named 'db'.
docker logs [1]The correct container name is 'db'. Using the exact container name is necessary to view its logs.
Fill both blanks to create a Docker command that shows logs and follows new log entries for container 'api'.
docker logs [1] [2]
The command docker logs api -f shows the logs of the 'api' container and keeps following new log entries live.
Fill all three blanks to create a command that builds a Docker image named 'myapp' from the current directory.
docker [1] -t [2] [3]
The command docker build -t myapp . builds a Docker image named 'myapp' using the Dockerfile in the current directory.