Docker Zfs
- Docker ZFS Storage Driver - container filesystem layers are created as ZFS datasets
Also see these:
Docker ZFS Storage Driver Setup
- You will need to have both Docker and ZFS installed before following these steps.
- Also keep in mind that you should identify disks “by-id” and nott using names like “/dev/sda”.
Stop the docker daemon:
sudo systemctl stop docker
Backup and remove the contents of /var/lib/docker:
sudo cp -au /var/lib/docker /var/lib/docker.bak
sudo rm -rf /var/lib/docker/*
Create a new zpool mounted on /var/lib/docker:
sudo zpool create -f zpool-docker -m /var/lib/docker mirror /dev/sda /dev/sdb
Verify that it is setup and mounted:
sudo zfs list
Enable the ZFS storage driver in the docker daemon config:
vi /etc/docker/daemon.json{ "storage-driver": "zfs" }
Start docker back up:
sudo systemctl start docker
Verify that docker is using the ZFS storage driver as expected:
docker info