डिफ़ॉल्ट रूप से, एक container में data क्षणिक होता है — container हटाए जाने पर खो जाता है। Volumes (और bind mounts) persistent storage प्रदान करते हैं जो containers से अधिक समय तक रहता है, जो databases और किसी भी ऐसे data के लिए आवश्यक है जिसे container restarts/removals में बचा रहना चाहिए।
समस्या: containers क्षणिक हैं
A container's writable layer is DELETED when the container is removed:
→ data written inside the container (e.g. a database's files) is LOST
→ containers are meant to be disposable/replaceable → don't store important data in them
→ For persistent data, you need storage OUTSIDE the container's lifecycle.
