terminfo:
path: /etc/terminfo
readonly: "true"
source: /usr/share/terminfo
type: disk
So as to make the hosts terminfo, which is far more complete, available to containers. On debian images, there is an /etc/terminfo/README file which blocks mounting the disk device with the error
Failed to remove old /etc/terminfo: Directory not empty
This prevents the container from starting, entirely.
Is there a way I can run commands which modify the rootfs at provision time, before the container is started? Or is there a way to instruct lxc to bind-mount directly over existing files?
I’ve discovered the root of my issue: If source is not a directory, but a regular file, lxd first tries to delete the existing directory from the containers rootfs. This fails, because the directory is non-empty, producing the error message I reported.
This makes sense to me; I wouldn’t expect to be able to bind-mount a file onto a directory.
Ah yeah, indeed, then the error is correct as indeed we cannot bind-mount different types, so we attempt a delete in the off chance that the thing is empty.