Interview Prep/Docker/Volumes, storage and data

What happens to data when you run `docker compose down` vs `down -v`?

BeginnerScenarioVolumes, storage and data
Answer

Situation read → Common accident.

What I'd do → docker compose down removes containers and networks but keeps named volumes. docker compose down -v also deletes named volumes declared in the file, and anonymous ones. Use stop if you only want to pause.

Why → -v is destructive; bind mounts are never deleted.

Interview tip → Say you guard prod hosts with backups and never run -v there.

All Docker questions Roadmap: Docker & containers

More on Volumes, storage and data