Introduction
When you run containers, their data disappears when they stop. Volumes let you save data outside containers so it stays safe and can be shared.
When you want to keep database files safe even if the container is removed
When you need to share files between multiple containers running on the same host
When you want to back up important data created by a container
When you want to separate your app code from its data for easier updates
When you want to persist logs generated by containers for later analysis