How to deploy containers in a similar way to docker recipes.
For example how to:
From doing research there appears to be an option to configure the containers using a yaml file: https://askubuntu.com/questions/617865/is-there-a-way-to-configure-lxd-containers-with-cloud-config-at-provision-time
The yaml file was also mentioned in this tutorial under the "Image metadata" heading: https://stgraber.org/2016/03/30/lxd-2-0-image-management-512/
Unfortunately that tutorial did not cover how to deploy the lxc containers using yaml files (and how to format the files).
The above are related to deploying lxd containers as mentioned here: https://stackoverflow.com/questions/44456522/how-to-automate-application-deployment-when-using-lxd-containers
I've noticed the documentation shows the configuration format: https://github.com/lxc/lxd/blob/master/doc/preseed.md
How to specify which commands to run when the container is first created and initiated?
You're welcome to script around "lxc exec" and the various "lxc file" commands. There is however no way in LXD to have it run the equivalent of a DockerFile. Most people will use their own deployment tools for such things, be it Ansible, Puppet, ...
To roll your own thing from a clean host, you could:
The yaml that's valid for "lxc config edit" is the same you'd see when doing "lxc config show" against an existing container.
Most helpful comment
You're welcome to script around "lxc exec" and the various "lxc file" commands. There is however no way in LXD to have it run the equivalent of a DockerFile. Most people will use their own deployment tools for such things, be it Ansible, Puppet, ...
To roll your own thing from a clean host, you could: