mirror of
https://github.com/games-on-whales/LXC2Docker.git
synced 2026-10-16 05:12:04 +00:00
[PR #40] [MERGED] fix(build): run RUN steps in a real LXC container (reliable builds) #41
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#41
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/40
Author: @JBailes
Created: 5/30/2026
Status: ✅ Merged
Merged: 5/30/2026
Merged by: @JBailes
Base:
main← Head:fix/build-run-in-lxc-container📝 Commits (1)
94a090afix(build): run RUN steps in a real LXC container; exempt builders from GC; allow bridge forwarding📊 Changes
4 files changed (+97 additions, -80 deletions)
View changed files
📝
internal/api/build.go(+41 -70)📝
internal/api/build_portainer_test.go(+19 -10)📝
internal/lxc/manager.go(+9 -0)📝
internal/lxc/network.go(+28 -0)📄 Description
The classic image builder ran each RUN step via unshare+chroot. Under the 7.0-pve kernel, gcc/apt intermittently failed in the chroot with No such file or directory on exec (gcc could not exec its assembler), making aimee-kb builds fail ~50pct of the time. Proven not to be the clone (cp -a is deterministic and complete) and not LTO. Fix: run each RUN step inside a real ephemeral build- LXC container via lxc-attach, which has a proper /proc and reliable exec. This exposed two more bugs, also fixed here: (1) the Wolf-origin GC stopped the running builder mid-build (no underscore in build- names made it look like an orphaned support container) causing RUN failed exit 137 (SIGKILL) - builders are now GC-exempt; (2) container outbound NAT was blocked by a leftover FORWARD policy DROP from a purged docker (the chroot never hit this since it used the host netns) so apt could not reach mirrors - EnsureBridge now inserts idempotent iptables FORWARD ACCEPT rules for the bridge. Result: 6/6 consecutive aimee-kb builds succeeded (previously ~50-100pct failed). go build, go vet, and the full test suite pass.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.