Recall & Review
beginner
What does running a Docker container in detached mode mean?
Running a Docker container in detached mode means the container runs in the background, allowing you to continue using the terminal without being attached to the container's output.
Click to reveal answer
beginner
Which Docker command option runs a container in detached mode?
The
-d option in the docker run command runs the container in detached mode.Click to reveal answer
beginner
How can you check running containers after starting one in detached mode?
Use the command
docker ps to list all running containers, including those started in detached mode.Click to reveal answer
intermediate
What is the difference between running a container in attached vs detached mode?
Attached mode shows the container's output in the terminal and keeps the terminal busy. Detached mode runs the container in the background, freeing the terminal for other commands.
Click to reveal answer
beginner
How do you stop a container running in detached mode?
You can stop a detached container using
docker stop <container_id_or_name>.Click to reveal answer
Which command runs a Docker container in detached mode?
✗ Incorrect
The
-d option runs the container in detached mode, so docker run -d nginx is correct.What does the
docker ps command show?✗ Incorrect
docker ps lists all currently running containers.If you want to see the logs of a detached container, which command do you use?
✗ Incorrect
Use
docker logs <container_id> to view output from a detached container.What happens if you run a container without
-d option?✗ Incorrect
Without
-d, the container runs attached to the terminal, showing output and blocking the terminal.How do you stop a container running in detached mode?
✗ Incorrect
Use
docker stop <container_id> to stop a running container, including those in detached mode.Explain what detached mode is in Docker and why you might want to use it.
Think about running a program and still being able to use your computer for other things.
You got /3 concepts.
Describe the steps to run a container in detached mode and then check if it is running.
Start with the command to run, then how to verify.
You got /2 concepts.