Repository navigation
Replies: 1 comment
|
This is expected sandbox behavior rather than a BuildKit bug. The presence of BuildKit's opt-out is
For docker buildx create \
--name nix-insecure \
--driver docker-container \
--buildkitd-flags '--allow-insecure-entitlement security.insecure' \
--use \
--bootstrapMark only the Nix step that requires it: # syntax=docker/dockerfile:1.20
FROM ...
RUN --security=insecure \
nix ... run --option sandbox-fallback false ... /path/to/flakeThen request the entitlement for that build: docker buildx build \
--builder nix-insecure \
--allow=security.insecure \
--progress=plain \
.For standalone BuildKit, enable the daemon with either: insecure-entitlements = ["security.insecure"]or The security warning is material: BuildKit documents insecure mode as equivalent to A rootless or containerized daemon has an additional boundary: this entitlement can grant only privileges already available inside the daemon's outer user namespace and capability set. It cannot override an outer seccomp/AppArmor policy or host user-namespace restriction. If it still returns If the real requirement is only network isolation, a safer but behaviorally different option is References: matching maintainer answer, |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
brief
unshare(CLONE_NEWNS)failed inDockerfile RUN, is this a bug?background
When I try to run nix flake within
Dockerfile RUN... RUN nix ... run --option sandbox-fallback false ... /path/to/flakenixfailed, seems due toNixOS/nix#16186 (comment)
problem
unshare(CLONE_NEWNS)failed, is this a bug?If this is not a bug, is there a reason?
If this is not a bug, what extra steps are needed to have
unshare(CLONE_NEWNS)?All reactions