Skip to content

Commit 6d7fa0d

Browse files
andrasbacsaiclaude
andcommitted
fix(builder): allow mnt + user namespaces for buildah layer extraction
RestrictNamespaces=yes denied every namespace syscall, which broke buildah's layer-extract path with "creating mount namespace before pivot: operation not permitted" on COPY steps. Narrow the restriction to allow mnt + user (the two buildah actually creates during `bud`) while still denying cgroup, net, uts, pid, ipc — none of which a static build needs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 090b554 commit 6d7fa0d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

coold/src/builder/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,11 @@ impl BuilderCtx {
242242
.arg("LockPersonality=yes")
243243
.arg("-p")
244244
.arg("RestrictRealtime=yes")
245+
// buildah creates mount + user namespaces to extract image layers
246+
// ("creating mount namespace before pivot"). Allow those two but
247+
// continue denying cgroup/net/uts/pid/ipc that builds never need.
245248
.arg("-p")
246-
.arg("RestrictNamespaces=yes")
249+
.arg("RestrictNamespaces=mnt user")
247250
.arg("-p")
248251
.arg("SystemCallArchitectures=native")
249252
.arg("--")

0 commit comments

Comments
 (0)