Docker Certified Associate Exam Course

Kubernetes

Docker Storage

Understanding how Docker handles storage is essential for working with container orchestration platforms like Kubernetes. This guide covers the two primary Docker storage mechanisms—Storage Drivers and Volume Driver Plugins—laying the groundwork for deeper Kubernetes storage concepts.

Prerequisite

If you’re already familiar with Docker storage drivers, feel free to skip ahead to the Volume Driver Plugins section.

The image is a slide titled "DOCKER STORAGE" with two sections labeled "STORAGE DRIVERS" and "VOLUME DRIVERS."

Key Docker Storage Mechanisms

Docker storage relies on two core components:

  • Storage Drivers: Manage how image and container layers are stored on the host filesystem.
  • Volume Driver Plugins: Provide integration with external block, file, or distributed storage solutions.
MechanismPurposeCommon Examples
Storage DriversControls layer management for images and containersoverlay2, aufs, devicemapper
Volume Driver PluginsConnects containers to external storage systems and servicesazurefile, flocker, nfs

Storage Drivers

Storage drivers determine how Docker writes and manages the union filesystem for images and containers. They affect performance, stability, and compatibility. Docker supports multiple drivers; choosing the right one depends on your host OS and workload requirements.

  • overlay2: Default on most Linux distributions.
  • aufs: Supported on older kernels; deprecated in many distros.
  • devicemapper: Uses block devices; suited for environments needing thin provisioning.

Driver Compatibility

Not all storage drivers work on every kernel version. Check your OS documentation before switching drivers.

To view the currently active driver:

docker info --format '{{.Driver}}'

Volume Driver Plugins

Volume driver plugins enable Docker to mount volumes from external storage backends. This approach decouples container data from the host, making it easier to manage persistence, backups, and scaling.

Plugin TypeUse CaseExample Command
Cloud File ShareShared storage across multiple hostsdocker volume create --driver azurefile myvolume
Network File SystemOn-prem NFS mountsdocker volume create --driver local --opt type=nfs --opt o=addr=<nfs-server>,rw --opt device=:/export nfsvol
Distributed File SystemHigh-availability clustered storagedocker plugin install flocker/flocker:latest

Refer to the Docker Volume plugins documentation for a full list of supported drivers and configuration options.

Watch Video

Watch video content

Previous
Network Policies