Docker with overlay driver in LXD cluster not working

I have been trying to work docker inside lxc container to work with overlay driver. LXD cluster is setup on Ubuntu 18.04 VM with zfs pool. Each time I install docker it starts with vfs storage driver, but when I change with overlay (already added as linux module in lxd profile ) docker fails to start. I even tried setting docker storage driver to zfs which fails too. I am new with LXD technology and can’t figure out if it is possible to run docker with overlay storage driver on LXD cluster containers on ZFS pool.

The overlay kernel filesystem cannot be used on top of zfs.
That’s not a LXD limitation but a hard kernel one as the two filesystems are just incompatible.

For similar environments in the past, some have created a separate storage pool which is backed by something compatible with overlay (dir on top of ext4 is the most solid) and then assigned one storage volume per container, mounting that volume at /var/lib/docker.

1 Like

That’s exactly what I needed to know thanks.

Hello! I got what you said but have no idea on how to do it, can you give an idea on how to do this? Thank you!

Also might be worth pointing out that BTRFS backed storage also doesn’t play completely nicely with docker because docker then uses BTRFS’ native snapshotting functionality instead of overlay, which isn’t fully supported by LXD when transferring the container between hosts/pools.

See

I took your advice and created a dir based container.

# lxc storage list         
+----------+--------+--------------------------+-------------+---------+---------+
|   NAME   | DRIVER |          SOURCE          | DESCRIPTION | USED BY |  STATE  |
+----------+--------+--------------------------+-------------+---------+---------+
| ext4pool | dir    | /mnt/dockerssd/ext4pool/ |             | 1       | CREATED |

However, i still get errors when running docker instance.

[11817.859223] overlayfs: upper fs does not support file handles, falling back to index=off.
[11817.859229] overlayfs: fs on '/var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.overlayfs/userxattr-check/1099599710/lower2' does not support file handles, falling back to xino=off.
[11817.882061] overlayfs: upper fs does not support xattr, falling back to index=off,metacopy=off.
[11817.882064] overlayfs: upper fs does not support xattr, falling back to xino=off.

Any idea how to improve this?

Thanks