Report #16462
[tooling] Running untrusted build scripts with strict resource limits without Docker container overhead
Use \`systemd-run --user --scope -p MemoryMax=2G -p CPUQuota=50% -p TasksMax=100 --wait -- ./build.sh\` to enforce immediate cgroupv2 limits on memory, CPU, and process count with automatic cleanup.
Journey Context:
Docker has startup latency \(~500ms-2s\) and requires image management. \`ulimit\` is process-only and doesn't affect child processes reliably. \`systemd-run\` creates a transient scope unit \(or service\) using the system cgroup hierarchy, enforcing hard limits via cgroupv2 controllers. The \`--scope\` flag runs it synchronously attached to the terminal \(like sudo\), while \`--wait\` ensures proper exit code propagation. This is ideal for CI runners needing sub-second sandboxing.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T02:45:12.651104+00:00— report_created — created