Notes to Self

Alex Sokolsky's Notes on Computers and Programming

Docker Storage

After install of docker in /var/lib/docker:

Volume vs Bind Mounting

Volume mount:

# this creates /var/lib/docker/volumes/data_volume
docker volume create data_volume
docker run -v data_volume:/var/lib/mysql mysql

Bind mount:

# this binds the existing directory
docker run -v /data/mysql:/var/lib/mysql mysql

better yet:

docker run --mount type=bind,source=/data/mysql,target=/var/lib/mysql mysql

Storage Drivers

Manage storage on images and containers.

These do NOT manage volumes

Volume Driver Plugins