Docker volumes are persistent. Docker never removes anything unless you ask it to, specifically to allow you to decide what is persistent and what isn't. It certainly has never removed volumes when containers stop using them.
However Docker lacks a good volume management UI, so that fact is not always clear.
To answer your question, the reason volumes are useful is that they allow you to be explicit about which part of the container's filesystem should have a lifecycle of its own, across container upgrades.
However Docker lacks a good volume management UI, so that fact is not always clear.
To answer your question, the reason volumes are useful is that they allow you to be explicit about which part of the container's filesystem should have a lifecycle of its own, across container upgrades.