Docker service starts before ZFS

I was able to solve this by doing two things. Note that one alone might be sufficient.

First, explicitly tell Docker to use ZFS as filesystem, by writing {"storage-driver": "zfs"} in the file /etc/docker/daemon.json. (If the file exists in your disk, then just add the storage-driver key)

Second, create the following systemd unit in the file /etc/systemd/system/docker-wait-zfs.service:

[Unit]
Description=Wait for ZFS before starting Docker
RequiredBy=docker.service
Before=docker.service
Requires=zfs.target
After=zfs.target

[Service]
Type=oneshot
ExecStart=/bin/true
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Then execute:

systemctl enable docker-wait-zfs.service