custom lxc container for QNAP NAS

# download the template from source
lxc-create -t download -n test -- -a arm64 -d debian -r stretch --flush-cache

Setting up the GPG keyring
Downloading the image index

---
DIST RELEASE ARCH VARIANT BUILD
---
debian stretch arm64 default 20190105_05:26
---

Downloading the image index
Downloading the rootfs
Downloading the metadata
The image cache is now ready
Unpacking the rootfs

---
You just created a Debian stretch arm64 (20190105_05:26) container.

To enable SSH, run: apt install openssh-server
No default root or user password are set by LXC.

# attach to the lxc
lxc-attach -n test

# reset the root password in lxc
root@test:~# passwd root

# update apt and install openssh-server in lxc 
apt update
apt install openssh-server

The help-info

LXC container image downloader

Special arguments:
[ -h | --help ]: Print this help message and exit.
[ -l | --list ]: List all available images and exit.

Required arguments:
[ -d | --dist <distribution> ]: The name of the distribution
[ -r | --release <release> ]: Release name/version
[ -a | --arch <architecture> ]: Architecture of the container

Optional arguments:
[ --variant <variant> ]: Variant of the image (default: "default")
[ --server <server> ]: Image server (default: "images.linuxcontainers.org")
[ --keyid <keyid> ]: GPG keyid (default: 0x...)
[ --keyserver <keyserver> ]: GPG keyserver to use
[ --no-validate ]: Disable GPG validation (not recommended)
[ --flush-cache ]: Flush the local copy (if present)
[ --force-cache ]: Force the use of the local copy even if expired

LXC internal arguments (do not pass manually!):
[ --name <name> ]: The container name
[ --path <path> ]: The path to the container
[ --rootfs <rootfs> ]: The path to the container's rootfs
[ --mapped-uid <map> ]: A uid map (user namespaces)
[ --mapped-gid <map> ]: A gid map (user namespaces)

If you like alpine, you can use the following command:

sudo MIRROR=http://mirrors.ustc.edu.cn/alpine lxc-create -t download -n alpine -- -a arm64 -d alpine -r 3.9  --flush-cache