How to create a new CT / LXC container template ?

shodan

Member
Sep 1, 2022
49
20
13
Hi,

I wish to create an easily deployable, fully offline template service in proxmox.

I reviewed docker but I keep finding people having issues with using docker in CT containers.

And running docker in a VM feels wasteful.

Also I don't like the cloud-centric feel of docker in general, I want a single file, which contains my thing.

Let's say for the sake of example, that my thing is going to be a ready to go Zoneminder server, a common open source surveillance camera software.

So, I think what I would like is start with a debian 12.7 CT container, then install Zoneminder properly on it, leaving only the actual hardware configuration to be done.

Then run something like sysprep on windows, to wipe all encryption keys and unique trackers, I don't know how to do that on linux ? cloudinit ? Is that it ?

Then somehow package that as a CT template file like proxmox has

and finally, post that to some CT container repository ? Does such a thing even exist ? Should I check if someone in the world already made a Zoneminde CT container perhaps ?

Although, I suspect no such thing as a CT container repository exist,

I have asked this on the linuxcontainers forum and got the following answer.

You are not supposed to put applications in CT containers, they are system containers, so no Zoneminder or mailserver containers make sense and it doesn't make sense to have a repository

https://discuss.linuxcontainers.org/t/where-can-i-find-the-biggest-lxc-container-repository/14946

exact quote

"
LXC and LXD are meant to be used with system-containers, not application containers.
system-containers are to be treated like VMs, they just work differently under the hood.

That means you can simply launch a container using your favorite OS(e.g. Ubuntu) and install all the software that you want using the usual methods
"

So their perspective is "just install linux and do the whole she-bang by hand.

Which honestly sounds very dumb to me and like the people who make LXC container system don't understand what it is for ?!

Anyways....


Re-reading that thread I see that one year after I asked that, someone posted a link to "proxmox helper scripts"

https://tteck.github.io/Proxmox/

Code:
All Templates LXC
A script designed to allow for the creation of one of the many free LXC templates. Great for creating system LXCs.
The script creates a *.creds file in the Proxmox root directory with the password of the newly created LXC.
Please take note that if you plan to use this script for creating TurnKey LXCs, you'll need to modify the hostname after creation.
To create a new Proxmox VE Template LXC, run the command below in the Proxmox VE Shell.
bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/all-templates.sh)"

Well that is promising !

Publishing "LXD" images ? (does that work on proxmox ?)
https://ubuntu.com/blog/publishing-lxd-images

list of lxc container images (can I use these AS IS in my proxmox server ?)
https://images.linuxcontainers.org/


And then I would like to make, one click deployable desktop (debian/ubuntu/mint/nixos/gentoo and probably others) CT containers with GPU support (novnc+virgl+passthrough) but that looks like another big can of worms
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!