[PR #39] [MERGED] fix(daemon): keep managed bridge up + run build chroots in a private mount namespace #40

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/39
Author: @JBailes
Created: 5/30/2026
Status: ✅ Merged
Merged: 5/30/2026
Merged by: @JBailes

Base: main ← Head: fix/bridge-autoup-and-unshare-builder


📝 Commits (1)

  • 5712d91 fix(daemon): keep managed bridge up + run build chroots in a private mount namespace

📊 Changes

2 files changed (+79 additions, -6 deletions)

View changed files

📝 internal/api/build.go (+69 -4)
📝 internal/lxc/network.go (+10 -2)

📄 Description

EnsureBridge only set veth0 up inside the bridge-creation block, so a daemon restart left an existing bridge DOWN and all container-to-container traffic failed with no route; it now always asserts the bridge up (verified C2C ping 0pct loss). The classic builder mounted proc/sys/dev in the host namespace with lazy umount -l after each RUN, racing across steps and breaking gcc/dpkg nondeterministically; RUN now runs the chroot in a private mount namespace via unshare --mount, so mounts tear down on step exit with no race. go build and internal/lxc + internal/api tests pass.


🔄 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/39 **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:** `fix/bridge-autoup-and-unshare-builder` --- ### 📝 Commits (1) - [`5712d91`](https://github.com/games-on-whales/LXC2Docker/commit/5712d91cf73386f70e668cb8757324713db6b9cd) fix(daemon): keep managed bridge up + run build chroots in a private mount namespace ### 📊 Changes **2 files changed** (+79 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `internal/api/build.go` (+69 -4) 📝 `internal/lxc/network.go` (+10 -2) </details> ### 📄 Description EnsureBridge only set veth0 up inside the bridge-creation block, so a daemon restart left an existing bridge DOWN and all container-to-container traffic failed with no route; it now always asserts the bridge up (verified C2C ping 0pct loss). The classic builder mounted proc/sys/dev in the host namespace with lazy umount -l after each RUN, racing across steps and breaking gcc/dpkg nondeterministically; RUN now runs the chroot in a private mount namespace via unshare --mount, so mounts tear down on step exit with no race. go build and internal/lxc + internal/api tests pass. --- <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#40
No description provided.