While using Docker, whenever we create a container, the details and data for the container need to be stored in some particular location. If we don’t assign a storage location, the data gets stored within the containers by default. As soon as we delete the container, the data also gets lost. Now, what if that data was important? In real-world scenarios, we don’t want to lose the data. Sometimes we even want to share the data between containers. Here, the need for volumes arises.

Get hands-on with 1200+ tech skills courses.