Recall & Review
beginner Click to reveal answer
What does the command
docker compose up do?It starts all the services defined in the
docker-compose.yml file, creating containers if they don't exist.beginner Click to reveal answer
What is the purpose of
docker compose down?It stops and removes all containers and networks created by
docker compose up.beginner Click to reveal answer
How can you run
docker compose up in detached mode?Add the
-d flag: docker compose up -d. This runs containers in the background.intermediate Click to reveal answer
What happens if you run
docker compose up and the containers already exist?Docker Compose will start the existing containers without recreating them unless the configuration has changed.
intermediate Click to reveal answer
Can
docker compose down remove volumes? How?Yes, by adding the
-v flag: docker compose down -v removes volumes created by Compose.What does
docker compose up -d do?✗ Incorrect
The -d flag runs containers in detached mode, meaning in the background.
Which command stops and removes containers created by Docker Compose?
✗ Incorrect
docker compose down stops and removes containers and networks.
How do you remove volumes when bringing down Docker Compose services?
✗ Incorrect
The -v flag with docker compose down removes volumes created by Compose.
If containers already exist, what does
docker compose up do?✗ Incorrect
Docker Compose starts existing containers unless configuration changes require recreation.
Which file does Docker Compose use to define services?
✗ Incorrect
docker-compose.yml is the default file where services are defined for Docker Compose.
Explain what happens when you run
docker compose up and how you can run it in the background.Think about starting containers and running them without blocking your terminal.
You got /3 concepts.
Describe the purpose of
docker compose down and how it affects containers, networks, and volumes.Consider how to clean up everything Docker Compose created.
You got /3 concepts.
