# Removing Volumes with Containers

> How do you remove a container together with its anonymous volumes, and why does Docker not do this by default?

Canonical: https://www.internhack.in/learn/interview/docker-containers/docker-rm-v-flag
Last updated: 2026-11-28

Difficulty: Intermediate

## Question

How do you remove a container together with its anonymous volumes, and why does Docker not do this by default?

*The full answer is for InternHack members. Open the page link above to read it.*

## Concepts covered

docker rm -v, Anonymous volumes, Named volumes, --rm, docker volume prune

Previous: [Interactive Terminal](https://www.internhack.in/learn/interview/docker-containers/docker-run-it-meaning) · Next: [ENV File](https://www.internhack.in/learn/interview/docker-containers/docker-env-file-loading) · [All of Docker & Containers](https://www.internhack.in/learn/interview/docker-containers)

## More Docker & Containers questions

- [Shared Memory](https://www.internhack.in/learn/interview/docker-containers/docker-shm-size)
- [Searching Hub](https://www.internhack.in/learn/interview/docker-containers/docker-search-command)
- [Updating Limits](https://www.internhack.in/learn/interview/docker-containers/docker-update-running-container)
- [Wait Command](https://www.internhack.in/learn/interview/docker-containers/docker-wait-command)
- [Checking Ports](https://www.internhack.in/learn/interview/docker-containers/docker-port-mapping-check)
- [Filtering Images](https://www.internhack.in/learn/interview/docker-containers/docker-image-filtering)

## Related

- [Learn](https://www.internhack.in/learn)
- [Interview Prep](https://www.internhack.in/learn/interview)
- [Docker & Containers](https://www.internhack.in/learn/interview/docker-containers)
