I just installed Discourse in a Docker container inside an LXD container, which may seem weird but it’s something LXD was intentionally designed to support.
How to Install Discourse in an LXD / Docker Container
If you encounter problems with Docker / Discourse failing to run in LXD then you’ll likely need to tweak some settings in your host’s /etc/sysctl.conf namely:
kernel.keys.maxkeys=2000
kernel.keys.maxbytes=200000
net.ipv4.tcp_mem=182757 243679 365514
net.core.netdev_max_backlog=182757
These are production values for LXD and for me they were neccessary to get Discourse running.