This article has two words:
- Volumes persist until no containers use them
- If you remove containers that mount volumes, including the initial dbdata
container, or the subsequent containers db1 and db2, the volumes will not
be deleted. To delete the volume from disk, you must explicitly call
docker rm -v against the last container with a reference to the volume. This
allows you to upgrade, or effectively migrate data volumes between containers.
Does It conflictive?
In my test, I deleted all containers without
-v, that’s mean no containers use the volumes.
But when I try
ls /var/lib/docker/volumes, there are lots of dir with data.
How I manage(reuse/delete) them?