A volume is a Docker-managed persistent storage mechanism.
It is:
Core idea:
A container is temporary.
A volume is durable.
By default, container storage is ephemeral.
When you run:
docker run mongo
MongoDB writes data inside the container’s writable layer.
If you remove the container:
docker rm -f <container_id>
All data is lost.