Docs about Templates


(Brian Mc Queen) #1

Are there any docs about templates? I’m just not sure what they do and how to use them. It looks like a shell script at first glance.


(Stéphane Graber) #2

LXC templates are indeed shell scripts which are run by lxc-create to generate a container root filesystem.

These days we’re not using them quite as much except for lxc-download and lxc-local combined with the images we publish at https://images.linuxcontainers.org and we’d generally recommend adding support for new distributions to distrobuilder rather than writing new template scripts.

If you do still want to write your own template script, lxc-busybox is probably a good place to start, write your script in /usr/share/lxc/templates and then call it with lxc-create -t NAME -n blah to create a blah container using your template.


(Brian Mc Queen) #3

I’m pretty new here. I didn’t know about distrobuilder. I see it up here and I’ll check it out too:

Thanks