Managing data in containers with volumes
Some salient features of a volume in Docker are mentioned as follows:
- A volume is a directory that is separated from the container's
- It is managed directly by the
docker daemon and can be shared across containers.
- A volume can also be used to mount a directory of the host system inside a container.
- Changes made to a volume will not be included when an image is updated from a running container.
- Since a volume is outside the filesystem of the container, it doesn't have the concept of data layers or snapshots. Hence, reads and writes happen directly on the volume.
- If multiple containers use the same volume, the volume persists until there is at least one container using it.
Creating a volume is easy. ...