Before now, when installing Docker in an Incus instance with zfs storage, it is near unusable out of the box and you would need to work around it or switch entirely to another storage driver.
I noticed today while using Incus that Docker now works fine with zfs out of the box. The storage driver section of docker info shows the following.
I have tried searching online to confirm if that is indeed the case but haven’t found anything substantial. However, I noticed that zfs is now a supported storage driver for Docker ZFS storage driver | Docker Docs.
Can anybody else confirm if that is indeed the case?
I fell in similar situation once again and I have finally figured this out.
1 Configure ZFS Pool Delegate
incus storage volume set <storage name> container/<container name> zfs.delegate=true
2 Install zfs utls package in the container
sudo apt install zfsutils-linux
3 Set zfs as storage driver in docker daemon settings.
Edit /etc/docker/daemon.json and set the following.
{
"storage-driver": "zfs"
}
Finally, restart the docker services or simply restart the container and everything should work just fine.
To verify it is working, docker info should have something similar to this under Storage Driver.
Storage Driver: zfs
Zpool: default
Zpool Health: ONLINE
Parent Dataset: default/containers/ubuntu
Space Used By Parent: 417035264
Space Available: 102805632000
Parent Quota: no
Compression: on