What you need to know
Removing a container does not normally remove the anonymous storage it used.
Potentially affected
Review anonymous Docker-managed volume identity and retention during container replacement or retirement.
DSE recommendation
DSE recommends recording volume identifiers, application ownership, mount destinations, and recovery requirements before replacing or retiring a container.
Removing a container does not normally remove the anonymous storage it used.
Source facts
Docker gives anonymous volumes unique generated names. Like named volumes, they normally persist after their container is removed. Docker documents an exception for anonymous volumes associated with containers created using --rm. New containers do not automatically share an old anonymous volume merely because they use the same image or mount location.
Source: Docker documentation — Volumes.
Applicability
Review anonymous Docker-managed volume identity and retention during container replacement or retirement.
DSE recommendation
DSE recommends recording volume identifiers, application ownership, mount destinations, and recovery requirements before replacing or retiring a container. Use intentional names or an explicit storage inventory when retained data matters. Review cleanup automation so it cannot equate unused with unwanted. When storage consumption rises, identify abandoned volumes without immediately pruning them. Keep the retention decision with the application owner and make restoration into a replacement container an explicit procedure rather than expecting Docker to rediscover the old data automatically.
Verification
With disposable data, remove a test container and inspect its volume independently. Create a replacement and confirm which volume it actually mounts. Exercise any approved cleanup option only against the test assets, then verify the expected retention or removal and the resulting application data path. Keep the old and replacement mount inventories together. Have the data owner reconcile each retained volume to an application or approve its disposal individually, rather than authorizing a broad cleanup from a container count.
Official reference
Docker documentation — Volumes. Reviewed October 20, 2026.
Review the official source
Docker documentation — Volumes · Verified October 20, 2026
Need help applying this guidance safely?
DSE can help confirm applicability, protect service continuity, and validate the result across physical security and IT systems.
Talk with DSE