[LXD/LXC 4.1] Custom image from debootstrap

Hello.
I attempt to build my own debian buster image from debootsrap. I have difficulties to find lxc/lxd requirements to apply to this king of image. I understand that distrobuilder exist to make images but it is not the goal here. It is to make a full image from debootstrap…

For the moment I have just the default rootfs provided by debootstrap but I have no idea on what operations to do after. For example to have a bindable hostname from the lxc container name during instantation.

If someone have a link to a howto or a bullet point on what to do in order to get a valid image to use with lxd. this one is good but the chapter “Manually building an image” not explain in detail what step is required to do this at all : https://stgraber.org/2016/03/30/lxd-2-0-image-management-512/

thanks in advance :slight_smile:

https://linuxcontainers.org/lxd/docs/master/image-handling#image-format

This covers what LXD needs in the tarballs.

Ok. I had read this but I was actually looking to find out if what is explained here at a linux conference was good practice: https://youtu.be/OLFH4Ov6bJQ?t=525

For example remove the /etc/hostname file provided by debootstrap to hope that the hostname pongo2 template recreate it correctly… :thinking:

You’d need to include those templates in your metadata but if you do, then yeah, you’d want at least /etc/hostname and /etc/hosts to be templated.

Ok. Thank you for your answer. It cover all the question :slight_smile: