intermediateDocker Compose: Services, Networks, Volumes, Scaling & Health Checks
What is the difference between docker compose down and docker compose down -v?
docker compose down stops and removes the containers and the project's network, but leaves named volumes (and their data) intact. Adding -v additionally removes the named volumes, which is destructive for any stateful service — useful for a genuinely clean slate, but it will permanently delete database data if used carelessly.
Ready to master this question?
Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.
Sign in to generate a response