March 25, 2017

Named Volumes

Named Volumes: Host and Container Data Volumes

Docker does not support persistent data by default, i.e. container filesystem changes do not persist across container restarts. A named volume is a mechanism for decoupling persistent data needed by your container from the image used to create the container and from the host. Named volumes persists even when no container is currently using it. Data in named volumes can be shared between a container and the host machine, as well as between multiple containers.
  • Docker uses a storage driver to create, manage, and mount volumes.
  • Volumes enable persistent data storage in a container environment
  • Volumes are directories that are stored outside of the container’s filesystem and hold reusable and shareable data that persists even after a container is terminated.
  • There are three ways to create volumes with Docker:
    • Map a host directory as a volume to a container directory using the -v option
    • Create a data-only container
    • Explicitly create a Docker volume using the docker create command
  • Volumes are not a part of the containers' Union File System


  • No comments:

    Post a Comment