Creating an Alpine container in LXC on top of Ubuntu

Solution 1:

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.