But my use case is that I have one ZFS pool only and I want to delegate rpool/docker to the docker container mounted as /var/lib/docker - how to do it?
You can’t, Incus only sets up the delegation on the volumes that it controls.
With the above command, you’ve made it so that the container/docker dataset in whatever pool is used by the docker instance is now delegated to it. Running zfs list inside of the container should show it as such.
If you want to attach another volume to the instance and have that delegated too, then you’ll need to create a custom storage volume with incus storage volume create, set zfs.delegate=true on that too and then attach that volume to your container, it will then show up in its zfs list.
You created a new storage pool named docker in which you then created a new volume also called docker but then ask Incus to modify the volume named docker in the pool named default, that naturally fails with an error.
I guess you meant to run:
incus storage volume set docker docker zfs.delegate=true
OK, syntax is really getting multi-layered and complex, now I can understand. Thank you for help, I hope it will also help other people discovering delegation in Incus!