I've got a new server spun up with Ubuntu Server and LXC installed for apt. I've been reading the docs and trying to understand how to import images/templates. I'm having a hard time understanding how to import a list of public images and specifically how to setup a new instance with Alpine. I believe this can be done with a tarball of the ISO (from the man page) but there's also a remote option.

The LXC container list here: https://us.images.linuxcontainers.org/ says these are available via lxc-download template which I assumed was a command to trigger a template but now I'm just more confused.


If using LXC, typically you would set up a new container with a command like this:

lxc-create -n ${c} -t download -- -d ${d} -r ${r} -a amd64

where c is the container name of your choosing, d is the distro such as 'alpine', and r is the version number of the release. Here is an example:

# lxc-create -n test -t download -- -d alpine -r 3.12 -a amd64
The cached copy has expired, re-downloading...
Setting up the GPG keyring
Downloading the image index
Downloading the rootfs
Downloading the metadata
The image cache is now ready
Unpacking the rootfs

You just created an Alpinelinux 3.12 x86_64 (20201213_13:00) container.
  • Doesn't matter what combination I use it keeps throwing errors. I recently tried sudo lxc-create --name container-one -t alpine -- --release edge and it failed to create because of unknown template "alpine". – ddibiase Dec 13 '20 at 13:52
  • This command is not using the syntax in the answer. – tater Dec 13 '20 at 14:20
  • I managed to get the command you recommended working. Thanks. – ddibiase Dec 13 '20 at 15:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.