Docker to PVE-LXC conversion steps/tool?

dlasher

Renowned Member
Mar 23, 2011
236
27
93
Wondering if anyone has a script/directions/etc to convert docker images into Proxmox Compatible LXC containers? Several projects I use are only available as docker containers, and I'd rather run it in an LXC than run docker JUST for them.

I've found a few resources online that deal with individual pieces, but haven't found someone doing the whole chain.

Anyone?


RESOURCES:
* https://www.reddit.com/r/Proxmox/comments/hagkvu/more_lxc_templates/
* https://www.buzzwrd.me/index.php/2021/03/10/creating-lxc-containers-from-docker-and-oci-images/
* https://github.com/chriswayg/proxmox-templates
 
Why not set up a VM and run all of your docker images there?
doing that already.

KVM has:
more disk space overhead
more cpu overhead
more ram overhead
doesn't directly offer peripheral reuse (shared gpus)

especially on smaller boxes (4-8 cores) running a thin LXC is much preferred to a fat KVM.

That being said, that's how I'm running Frigate right now, in it's own KVM. I'd like to get away from that model.
 
Running Frigate as a docker container inside an LXC is also an option. Not recommended, but works.
 
KVM has:
more disk space overhead
more cpu overhead
more ram overhead
doesn't directly offer peripheral reuse (shared gpus)
But does it really?
  • More disk space? You can run Alpine Linux as a VM in a couple hundred MB.
  • More CPU overhead? A few 10ths of a percent. Assuming your docker actually does something this is very small.
  • More RAM? Not really. Again, Alpine uses just a couple of MB for itself, much less than your app will use.
Peripheral reuse is the only one that is actually significant on any but the most absurdly small machines. If you run multiple dockers in the same VM then the overhead gets amortized over all of them and is really quite trivial. I know people here obsess over chasing "efficiency" but it is almost never worth the effort expended.

Just my opinion.
 
B
Running Frigate as a docker container inside an LXC is also an option. Not recommended, but works.
Been down that road. Got docker-swarm working in LXC-priv containers. Preferred it to KVM, but you can't snapshot them to back them up (long story) so moving away from that as well.

99.9% of what is running in my lab & home clusters are LXC containers. (even moved plex/jellyfin into containers) - frigate is my holdout, so trying to find a way to move it as well.
 
But does it really?
  • More disk space? You can run Alpine Linux as a VM in a couple hundred MB.
  • More CPU overhead? A few 10ths of a percent. Assuming your docker actually does something this is very small.
  • More RAM? Not really. Again, Alpine uses just a couple of MB for itself, much less than your app will use.
Peripheral reuse is the only one that is actually significant on any but the most absurdly small machines. If you run multiple dockers in the same VM then the overhead gets amortized over all of them and is really quite trivial. I know people here obsess over chasing "efficiency" but it is almost never worth the effort expended.

Just my opinion.

I appreciate your viewpoint, and when it's other people's network, money, and datacenter space, I agree, it's not as big of a deal. When you have cores to burn, there's not as much difference between the two.

In my case, I'm moving my home lab from 5 machines, 160 cores, 1280G of ram, and 40 OSD's on CEPH to ... something a bit smaller. So now the difference between KVM containers that don't share cpu or ram very well, and don't share hardware at all... to LXC containers that do, is a bigger deal than when I was throwing CPU & RAM at everything.

( as an aside, there's a 5-node proxmox cluster likely to be for sale at some point.. Is there a for-sale forum? )
 
Last edited:

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!