Add iso2lxc: convert TurnKey ISO to Proxmox LXC template#46
Add iso2lxc: convert TurnKey ISO to Proxmox LXC template#46marcos-mendez wants to merge 1 commit intoturnkeylinux-apps:masterfrom
Conversation
Extracts squashfs from product ISO and repackages as a Proxmox-compatible
LXC container template (.tar.gz), following TKL naming convention.
Removes device nodes, kernel modules, and mount points that break
unprivileged containers. Masks kernel-dependent systemd services.
Usage: run 'iso2lxc' from any product directory after 'make'.
Output: build/debian-{VER}-turnkey-{APP}_{TKLVER}-{REV}_{ARCH}.tar.gz
|
Thanks for your mate. But I'm guessing that you missed https://github.com/turnkeylinux/buildtasks? Explicitly FYI when we publish all apps, we use the top level The only caveat is that it expects an existing iso with our iso naming convention. E.g. TBH that repo has accumulated a lot of cruft over the years and ideally I'd like to consolidate, clean and update it all; then package it, but it works... I'm totally open to you building on those to make them more flexible for your needs, but I'd rather keep all the build stuff together. |
|
Thanks @JedMeister - and no worries at all, I appreciate you taking the time to point that out rather than just closing it. I did know about
That said, you're right that long-term this belongs in buildtasks rather than scattered across tkldev. I'm thinking of a two-step improvement:
Happy to close this PR and take a stab at that as a buildtasks contribution instead. Would that direction make sense to you? |
Ah ok, thanks for the explanation. That totally makes sense and I'm more than happy with that. Reducing dev friction for everyone is an awesome thing! FWIW we achieve a somewhat similar ends internally using
Despite the name, we all use podman rather than docker (as does Anyway, I'm rambling a bit...
That sounds good man! We should do something similar with that
Buldtasks is probably a better place for it - or it's own repo like our tkldev-docker (I'd be happy to pull a new repo into the It's definitely not a priority right now, but I'd really like to move away from including "helper scripts" in app overlays as much as possible. It makes providing users with updates & bugfixes a bit of a PITA. Ideally I've like to (deb) package them but having them in git repos is a decent middle ground - still less mucking around to update. TL;DR I'm open to merging this as-is but putting it in a separate repo (buildtasks or somewhere else tkldev related or it's own repo) is probably better... Let me know which way you'd like to go and we can either close this or I'll merge it. |
|
Thanks @JedMeister — great context on Why LXC is the right test target for TKLMy reasoning for building TKL appliances are full system images — they run systemd, real networking, real services, inithooks on firstboot, confconsole on login. An OCI container is a process isolation tool: no systemd, no real init, no actual network stack, no service management. When you smoke-test an appliance in Docker/Podman, you're testing in an environment that's fundamentally different from where it will actually run. I've seen this pattern a lot in production: docker-compose "works" on the dev's laptop, but the person deploying it has no idea what the declared infrastructure actually means — what ports are exposed, what volumes persist, what depends on what. The abstraction hides too much. For a project like TKL whose whole point is empowering people to understand and own their infrastructure, I think the test environment should match the deployment environment as closely as possible. An unprivileged LXC on the tkldev host is the deployment target. It runs the same init, the same networking, the same service lifecycle. If inithooks work there, they'll work on the user's Proxmox node. If they work in Docker, you still don't know. That said — Some context on how we got hereFor years our dev workflow at PopSolutions involved downloading published TKL templates from the Proxmox mirror, converting them to LXD with a [metadata.yaml + import dance](https://github.com/popsolutions/proxmox-2-lxd), testing locally, then exporting back to Proxmox for production. It worked, but it was a lot of friction and an extra moving part (LXD) that didn't need to be there.
Where should iso2lxc live?I think merging it into tkldev for now is the pragmatic choice. It's a single script, zero dependencies beyond what tkldev already has, and it directly serves the dev loop. If/when we extend I'm also happy to contribute the |
Summary
Add
iso2lxcutility to/usr/local/sbin/for converting TurnKey product ISOs into Proxmox-compatible LXC container templates.Usage
What it does
Tested
Built and deployed Moodle v19 as unprivileged LXC on Proxmox 6.8.