Alex Povolotsky
Alex Povolotsky

Reputation: 402

How do I create zfs volumes with docker compose?

I've patched a docker zfs plugin to make it work with docker composes's ideas on container naming, so docker volume create -d zfs my-volume creates my-volume under specified in config filesystem.

However, when I've tried to use it in docker-compose, I got an error

version: "3.9"


volumes:
  postgres_16:
    driver: zfs

services:
  postgres_16:
    image: postgres_develop
    container_name: postgres_16
    ports:
      - 5432:5432
    volumes:
      - "./configs/postgresql/postgresql.conf:/var/lib/postgresql/data/postgresql.conf"
      - "/etc/localtime:/etc/localtime"
      - "postgres_16:/var/lib/postgresql"

results in

external volume "stagingc_postgres_16" not found

What am I doing wrong?

I can create all containers manually and mark them as external: true - but isn't docker compose supposed to do it for me?

Upvotes: 1

Views: 238

Answers (0)

Related Questions