In order to run Docker inside a LXD container the security.nesting property of the container should be set to true.
lxc config set security.nesting true
Note that LXD containers cannot load kernel modules, so depending on your Docker configuration you may need to have the needed extra kernel modules loaded by the host.
You can do so by setting a comma separate list of kernel modules that your container needs with:
lxc config set linux.kernel_modules
We have also received some reports that creating a /.dockerenv file in your container can help Docker ignore some errors it's getting due to running in a nested environment.
In the Documentation Section:
https://docs.netmaker.org/server-installation.html#linux-install-without-docker
It currently states:
However, Docker can certainly be run Nested inside an LXD container.
Refer to the following in the LXD Documentation: https://lxd.readthedocs.io/en/latest/