Jeremy Davis's picture

I'm pretty sure that the "-t turnkey" bit of the lxc-create command is what calls the template script.

I haven't actually been closely involved in the development, nor maintenance of the TurnKey LXC appliance. My colleague Alon (who mostly works behind the scenes) created the original appliance and community member John Carver (aka Dude4Linux) has been the primary maintainer/developer since then. Also I don't actually use it myself (I use Proxmox VE on my home server - because it has support for both full VMs as well as containers; and a pretty web UI). So my contact with the TurnKey LXC host (and vanilla LXC itself) is limited to code review and testing (of TurnKey LXC appliance). FWIW Proxmox has it's own container management scripts.

Having said that, the lxc-create man page says:

       -t, --template template
              'template' is the short name of an existing 'lxc-template'
              script that is called by lxc-create, eg. busybox, debian,
              fedora, ubuntu or sshd.  Refer to the examples in
              /usr/local/share/lxc/templates for details of the expected
              script structure.  Alternatively, the full path to an
              executable template script can also be passed as a parameter.
              "none" can be used to force lxc-create to skip rootfs
              creation.

So that pretty much confirms my suspicions...

I have some suggestions for improving the documentation for new TurnKey LXC users and would love your input:

  1. put a comment right at the top of the template script to explicitly note that it should be called via
    lxc-create -t turnkey <other-lxc-options> -- <turnkey-template-options>
    rather than directly.
  2. move the link to the usage docs much higher on the doc page (and link directly to the usage doc itself, rather than the docs directory).
  3. perhaps even include an example command (using lxc-create) on the main appliance page (or at least a note about how to leverage the template as a dot point under the info about the turnkey template).

The current appliance page somewhat assumes users are already familiar with LXC. That seems to be a clear mistake on our behalf. Do any/all of the above suggestions sound like good ideas to you?

(PS - I hope you don't mind, I just adjusted the title of this thread and added some additional tags.)