mirror of
https://github.com/games-on-whales/LXC2Docker.git
synced 2026-10-16 13:22:02 +00:00
[PR #6] [MERGED] Generic daemon: safe GC, per-container config, tag ownership, ZFS-only templates #9
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
games-on-whales/LXC2Docker#9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/games-on-whales/LXC2Docker/pull/6
Author: @JBailes
Created: 4/17/2026
Status: ✅ Merged
Merged: 4/17/2026
Merged by: @JBailes
Base:
docker-lxc-daemon← Head:aimee/session/ce19f10a📝 Commits (4)
83d076eGenericize: safe ephemeral GC, per-container storage/bridge, vendor-neutral labelsbd0b705Default to permanent PVE CTs; route apps through OCI in PVE mode5565559Tag-based ownership: ManagedTag identifies daemon-visible PVE CTs744e374ZFS-only OCI templates; stop polluting the PVE UI📊 Changes
11 files changed (+833 additions, -255 deletions)
View changed files
📝
Makefile(+0 -3)📝
cmd/docker-lxc-daemon/main.go(+92 -10)📝
internal/api/containers.go(+109 -6)📝
internal/api/system.go(+4 -3)📝
internal/api/types.go(+4 -0)📝
internal/image/resolver.go(+29 -19)📝
internal/lxc/config.go(+58 -8)📝
internal/lxc/manager.go(+515 -183)📝
internal/store/store.go(+21 -10)📝
systemd/docker-lxc-daemon.service(+1 -1)➖
systemd/wolf-run-dirs.conf(+0 -12)📄 Description
Summary
Five-step refactor turning the daemon into a vendor-neutral, Docker-API-compatible front-end for LXC on Proxmox, validated end-to-end against Portainer.
1. Safe ephemeral GC
Positive identification only. The GC reaps a container only when all of these are true:
Ephemeral == trueVMID == 0# docker-lxc-daemon: ephemeralStartedAt != nil(never reap a container that hasn't started)exitedDrops the previous Wolf-specific orphan-detection (PulseAudio/Wolf-UI naming heuristics).
2. Per-container storage / bridge / ISOs
dld.storage,dld.bridge,dld.iso=storage:volid[:dest](comma-separated)--bridge name=prefix/subnet:gatewayflag for multi-bridge daemons--lan-bridge/--lan-prefix/etc. retained as backwards-compat default3. Vendor-neutral labels
dld.pve,dld.lan,dld.ephemeralgow.pve/gow.lanaccepted with a one-time deprecation log per processsystemd/wolf-run-dirs.conftmpfiles drop-in and Wolf-specific comments4. Permanent default + tag-based ownership
--rm-off semantics)--rm(HostConfig.AutoRemove) ordld.ephemeral=truedld-managedreconcile()backfills the tag on daemon-created CTs that pre-date this changenginx→ alpine + nginx package) is bypassed in PVE mode so standard Docker image names get standard Docker semantics (real OCI pull, eligible to be permanent CTs)5. ZFS-only OCI templates
OCI image pulls no longer register a Proxmox CT template (which would clutter the PVE UI). Templates live as raw ZFS datasets at
<storage>/dld-templates/<name>with an@tmplsnapshot. Permanent CT creation useszfs clone <snap> → subvol-<vmid>-disk-0+ direct<vmid>.confwrite. Existing legacy-template records keep working until the operator re-pulls.Test plan (executed on real Proxmox host with ~50 unrelated PVE CTs)
go build,go vet,make build)docker create nginx:alpine(no labels) → PVE CT in UI, GC ignores it across multiple intervalsdocker create --label dld.ephemeral=true→ invisible in PVE UI, GC reaps within 30s ofexiteddld-managedtag to a PVE CT → surfaces in Portainer immediately, lifecycle ops route throughpctnginx:alpinebecomes a real Docker image (not the legacy app template)pct listclean oftmpl-*entries)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.