Container data is not part of the Container filesystem and is stored in the host filesystem where Container runs. Container data can be used to store data that needs to be manipulated frequently, such as a database. Container data typically needs to be shared between multiple Containers.
Changes made in the container are stored as part of the Union filesystem. If we want to save some data outside the scope of the container, volumes can be used. Volumes are stored as part of the host filesystem and it gets mounted in the Container. When container changes are committed, volumes are not committed as they reside outside the Container filesystem. Volumes can be used to share the source code with the host filesystem, maintain ...