Docker Compose Storage Types

12 February 2025

Docker, IaC

Docker Compose is a declarative tool that allows you to create YAML scripts to deploy Docker containers in a standardised fashion.

You may choose how the containers store persistent files on the host, so that when they are stopped, the data is not destroyed.

There are 3 options…

Anonymous Volumes

Named Volumes

services:
  nginx:
    ...
    volumes:
      - webroot:/var/www/html
    volumes:
      webroot:

Bind Mounts