Image and Container Storage

This is different than container storage

When you pull, the image is a file system contained of diff layers.

What storage driver should I choose?

This depends
Container and image storage

  • Block supports disk quotas.
    • As of 1.12, you can tell a container not to use more than XGb

Device mapper is bound to have issues. YES

Overlay2 takes advantage of new features, works with hard links to create the diff layers.
ZFS may be the most reliable.

Choose a driver

#YOLO

echo '{ "storage-driver": "overlay2" }' > /etc/docker/daemon.json

  • Don't do this, assumes the Jason file is empty. Better to vim into the file and edit the storage-driver attribute
  • This needs to be done on all our Docker hosts. Device mapper kills HD space.

Persistent Storage

Normally referenced to as Volumes
Persists outside of the container, data written will always exist (on host).

Volume can be setup with the docker volume create command, with flags for type like "nfs".

Find volume plugins here:
HTTPS://docs.docker.com/engine/extend/plugins/#colume-plugins

  • TODO: Figure out how to setup S3 volume plugin for cloud storage.
  • With swarm mode docker service create --mount type=volume.source...
  • Don't do host mounted volumes unless you really need to. (Whoops...)