mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-10 15:56:03 +00:00
Compile nsjail 3.6 from source in a dedicated multi-stage build and carry only the binary plus its runtime libs (libprotobuf32, libnl-route-3-200) into the final image. This lets the Box runtime isolate sandboxed code via nsjail user/mount/pid/net namespaces without a host Docker socket — the prerequisite for running Box on LangBot Cloud (k8s), where mounting docker.sock would grant node root and is not acceptable for multi-tenant. The build toolchain (build-essential/bison/flex/protobuf-dev/libnl-dev) stays in the nsjail-build stage and is not present in the shipped image. Verified: image builds (583MB), nsjail --help exits 0, libraries resolve, and the real NsjailBackend executes an isolated command end-to-end on a v6.1/cgroup2 host matching LangBot Cloud prod (rlimit fallback path, since container /sys/fs/cgroup is read-only; PID-namespace isolation confirmed).
2.6 KiB
2.6 KiB