Docker Volumes vs Bind Mounts

Bind mount

File or directory on host mounted into container. You refer to this file/directory using the full file path used on the host.

The problem with a bind mount is you have to have the full host file path which may be different on different hosts. E.g. if you use /Users/dave it’s going to break if someone else doesn’t have a Users/dave directory.

Volume

While bind mounts are dependent on the directory structure of the host machine, volumes are completely managed by Docker. They’re created in  /var/lib/docker/volumesand you refer to them by name. E.g.

-v mysql_data:/containerdir

Here’s what this means:

  • the first field is the name of the volume. It’s unique on a given host machine
  • the second field is the path where the file or directory are mounted in the container

https://docs.docker.com/storage/bind-mounts/

https://docs.docker.com/storage/volumes/#choose-the–v-or—mount-flag

https://stackoverflow.com/questions/47150829/what-is-the-difference-between-binding-mounts-and-volumes-while-handling-persist

REX-Ray: container orchestration engine

From REX-Ray’s website, it’s acontainer storage orchestration engine enabling persistence for cloud native workloads

Fore more info:

REX-Ray Front Page

and https://rexray.readthedocs.io/en/latest/

The long-term goal of the REX-Ray project is to enable collaboration between organizations focused on creating enterprise-grade storage plugins for the Container Storage Interface (CSI)

Note: alternatives are Portworx