[PR #38] [MERGED] Installable .deb + make it run on modern Proxmox (7.0-pve) kernels #39

Closed
opened 2026-10-15 12:51:32 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/games-on-whales/LXC2Docker/pull/38
Author: @JBailes
Created: 5/30/2026
Status: ✅ Merged
Merged: 5/30/2026
Merged by: @JBailes

Base: main ← Head: feat/deb-packaging


📝 Commits (5)

  • 37276ab feat(packaging): ship an installable .deb; end users need no build toolchain
  • a4c1224 fix(lxc): clone legacy containers by directory copy, not lxc-copy
  • 7c5621e fix(lxc): daemonize lxc-start (-d) so container start returns
  • ebc55eb fix(api): make statusRecorder pass through Hijack so exec/attach stream
  • af2927f Merge remote-tracking branch 'origin/main' into tmpmerge

📊 Changes

8 files changed (+160 additions, -21 deletions)

View changed files

📝 .github/workflows/ci.yml (+42 -0)
📝 Makefile (+26 -1)
📝 internal/api/containers.go (+3 -1)
📝 internal/api/system.go (+14 -0)
📝 internal/lxc/manager.go (+18 -16)
➕ packaging/postinst (+22 -0)
➕ packaging/prerm (+14 -0)
📝 readme.md (+21 -3)

📄 Description

Summary

Two things: give docker-lxc-daemon a real binary install path (no build toolchain on the target), and fix three issues that prevented it from running containers on a current Proxmox 9 / 7.0-pve host (kernel 7.0-pve + AppArmor 4.1 tightened mount/socket mediation).

Packaging — install without liblxc-dev

Previously make install built from source on the target, dragging in Go + liblxc-dev. Those are build-time deps; the daemon only needs the runtime liblxc.

  • make deb produces a .deb that Depends: nftables, lxc-pve | lxc (Recommends skopeo/umoci/pve-container), installs the binary to /usr/bin + the systemd unit, creates the docker group, and Conflicts: the real docker packages so it cleanly replaces them on the socket.
  • CI builds the .deb every run, uploads it as an artifact, and attaches it to releases on tags — so apt install ./docker-lxc-daemon_*.deb is the supported install.
  • readme documents the .deb as primary; build-from-source flagged maintainer/CI-only.

Runtime fixes (verified on a 7.0-pve host)

  • clone by directory copy, not lxc-copy — lxc-copy's directory-backed clone rsyncs through the new mount API (move_detached_mount), which 7.0-pve denies in the daemon's context, hanging then failing container creation. Plain copy works regardless. (create → 201 fast.)
  • daemonize lxc-start -d — modern lxc-start runs in the foreground by default, so the start call blocked until the container exited. Daemonize so it returns and the wait-for-RUNNING loop completes.
  • pass-through Hijack on the logging statusRecorder — the embedded http.ResponseWriter interface hides Hijack, so docker exec/attach's Upgrade: tcp connection hijack returned 500 ("unable to upgrade to tcp"). Add a pass-through.

Bug surfaced by packaging

  • archivePathStatHeader rendered mtime in local time — the Portainer-compat stat test failed on any non-UTC host (CI is UTC, which hid it). Format mtime as UTC.

Validation

On a Proxmox 9 / 7.0-pve host: docker create + docker start bring an LXC container Up in <0.5s, docker exec streams, OCI pulls work, and postgres runs with its AF_UNIX socket bound (database system is ready to accept connections) — the exact case the kernel denies for Docker's apparmor-confined containers. go vet clean; make test-build + make test-unit green.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/games-on-whales/LXC2Docker/pull/38 **Author:** [@JBailes](https://github.com/JBailes) **Created:** 5/30/2026 **Status:** ✅ Merged **Merged:** 5/30/2026 **Merged by:** [@JBailes](https://github.com/JBailes) **Base:** `main` ← **Head:** `feat/deb-packaging` --- ### 📝 Commits (5) - [`37276ab`](https://github.com/games-on-whales/LXC2Docker/commit/37276ab0ac94727d4622af730e85d51258f06b3e) feat(packaging): ship an installable .deb; end users need no build toolchain - [`a4c1224`](https://github.com/games-on-whales/LXC2Docker/commit/a4c122479ded8eede86d684c96ce83f716d8fd70) fix(lxc): clone legacy containers by directory copy, not lxc-copy - [`7c5621e`](https://github.com/games-on-whales/LXC2Docker/commit/7c5621e6118f6596f98b896d56b0c59088f690a6) fix(lxc): daemonize lxc-start (-d) so container start returns - [`ebc55eb`](https://github.com/games-on-whales/LXC2Docker/commit/ebc55ebd5f1dc45307afe07830249203a8555981) fix(api): make statusRecorder pass through Hijack so exec/attach stream - [`af2927f`](https://github.com/games-on-whales/LXC2Docker/commit/af2927f9582cf22fc7c6f92bc8e92afaa3e22b5b) Merge remote-tracking branch 'origin/main' into tmpmerge ### 📊 Changes **8 files changed** (+160 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+42 -0) 📝 `Makefile` (+26 -1) 📝 `internal/api/containers.go` (+3 -1) 📝 `internal/api/system.go` (+14 -0) 📝 `internal/lxc/manager.go` (+18 -16) ➕ `packaging/postinst` (+22 -0) ➕ `packaging/prerm` (+14 -0) 📝 `readme.md` (+21 -3) </details> ### 📄 Description ## Summary Two things: give docker-lxc-daemon a real **binary install path** (no build toolchain on the target), and fix three issues that prevented it from running containers on a current **Proxmox 9 / 7.0-pve** host (kernel 7.0-pve + AppArmor 4.1 tightened mount/socket mediation). ## Packaging — install without `liblxc-dev` Previously `make install` built from source on the target, dragging in Go + `liblxc-dev`. Those are *build-time* deps; the daemon only needs the **runtime** liblxc. - `make deb` produces a `.deb` that `Depends: nftables, lxc-pve | lxc` (Recommends skopeo/umoci/pve-container), installs the binary to `/usr/bin` + the systemd unit, creates the `docker` group, and `Conflicts:` the real docker packages so it cleanly replaces them on the socket. - CI builds the `.deb` every run, uploads it as an artifact, and attaches it to releases on tags — so `apt install ./docker-lxc-daemon_*.deb` is the supported install. - readme documents the `.deb` as primary; build-from-source flagged maintainer/CI-only. ## Runtime fixes (verified on a 7.0-pve host) - **clone by directory copy, not `lxc-copy`** — `lxc-copy`'s directory-backed clone rsyncs through the new mount API (`move_detached_mount`), which 7.0-pve denies in the daemon's context, hanging then failing container creation. Plain copy works regardless. (`create → 201` fast.) - **daemonize `lxc-start -d`** — modern `lxc-start` runs in the foreground by default, so the start call blocked until the container exited. Daemonize so it returns and the wait-for-RUNNING loop completes. - **pass-through `Hijack` on the logging `statusRecorder`** — the embedded `http.ResponseWriter` interface hides `Hijack`, so `docker exec`/attach's `Upgrade: tcp` connection hijack returned 500 ("unable to upgrade to tcp"). Add a pass-through. ## Bug surfaced by packaging - **`archivePathStatHeader` rendered mtime in local time** — the Portainer-compat stat test failed on any non-UTC host (CI is UTC, which hid it). Format mtime as UTC. ## Validation On a Proxmox 9 / 7.0-pve host: `docker create` + `docker start` bring an LXC container Up in <0.5s, `docker exec` streams, OCI pulls work, and **postgres runs with its AF_UNIX socket bound** (`database system is ready to accept connections`) — the exact case the kernel denies for Docker's apparmor-confined containers. `go vet` clean; `make test-build` + `make test-unit` green. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-15 12:51:32 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
games-on-whales/LXC2Docker#39
No description provided.