Automation, Orchestration, and Scripting
What does docker compose down remove by default?
Show the answer
Correct answerA. The project's containers and networks, keeping its named volumes
AWhy this is right: compose down removes the project's containers and networks and keeps named volumes so data survives.
BWhy not this: Named volumes are removed only when -v or --volumes is added.
CWhy not this: compose down also removes the networks it created for the project.
DWhy not this: Images are removed only when --rmi is given.
By default, down removes the project's containers and networks. Named volumes are kept so data survives, and are deleted only when -v (--volumes) is added; images are removed only with --rmi.