My ARC post promised a follow-up on running Docker inside jobs, “without giving every job a way to escape to root on the host”. The chart’s built-in Docker-in-Docker mode runs a privileged sidecar, which any workflow can use to take over the node. Plain user namespaces didn’t fix that, Sysbox did.
Short version: install Sysbox on the runner nodes, remove privileged: true from the dind container and set runtimeClassName: sysbox-runc and hostUsers: false on the Pod. Sysbox runs every container in a user namespace and adds what Docker needs there; a DaemonSet installs it, and on NAP the NodePool labels new nodes for it and a startup taint holds runner Pods back until it’s ready.
Tested on AKS with Kubernetes 1.36, Ubuntu 24.04 (kernel 6.8), containerd 2.3, Sysbox v0.7.1 and ARC chart 0.14.
Start from the chart’s dind mode
ARC’s gha-runner-scale-set Helm chart deploys the runners and has a built-in Docker-in-Docker mode:
containerMode: type: "dind"That adds a Docker daemon as a native sidecar next to the runner, sharing the socket through an emptyDir volume. GitHub’s guide is blunt about the cost:
The Docker-in-Docker container requires privileged mode.
The chart sets privileged: true itself, and dind mode has no option to remove it. GitHub’s guide says what to do instead: unset containerMode.type and copy the expanded template into your values file so you can edit it. That’s what I do.
What the privileged sidecar allows
In this setup, a privileged container runs as root on the host and can see every device. To show what that allows, I ran a job on a throwaway node, with the checks inside docker run --privileged. Any workflow with access to this Docker daemon can do the same.
Container UID 0 maps to host UID 0 in both the runner and a nested privileged container:
$ cat /proc/self/uid_map0 0 4294967295$ docker run --rm --privileged alpine:3.21 cat /proc/self/uid_map0 0 4294967295From there, reaching the host is straightforward: mount the node’s disk and write a file, load a module into the host kernel or change a host sysctl:
$ # inside docker run --privileged, the node's disk is /dev/nvme0n1p1$ mount /dev/nvme0n1p1 /host && touch /host/ESCAPE-MARKER$ # in a second, separate privileged container:$ mount /dev/nvme0n1p1 /host && ls -la /host/ESCAPE-MARKER-rw-r--r-- 1 root root 0 Sep 25 08:08 /host/ESCAPE-MARKER$ chroot /host modprobe af_key && grep '^af_key ' /proc/modulesaf_key 45056 0 - Live 0xffffffffc121a000$ echo 1 > /proc/sys/kernel/unprivileged_bpf_disabled; echo $?0A workflow that can start a privileged container effectively owns the node it runs on. On a shared node, that also exposes other jobs’ secrets. ARC issue #1288 showed the same host-disk mount back in 2022.
Try user namespaces first
A user namespace maps the container’s root to an unprivileged host UID. User namespaces have been generally available since Kubernetes 1.36. Enabling them takes one line in the Pod spec: hostUsers: false. I tried this before Sysbox and retested the variations on 1.36 for this post. The daemon starts and pulls images, but the first container fails:
$ docker run alpine truedocker: Error response from daemon: failed to create task: runc create failed:unable to apply cgroup configuration: mkdir /sys/fs/cgroup/docker: permission deniedThe Pod’s cgroup isn’t delegated to the container’s root, so Docker can’t create a child cgroup for the nested container. Replacing privileged mode with capabilities, setting procMount: Unmasked and using rootless dind all fail too. The details are in Why user namespaces can’t run Docker-in-Docker yet. KEP-5474, targeted at alpha in 1.38, would add the delegation to the Pod spec.
How Sysbox works
Sysbox is a fork of runc that always runs containers in a user namespace and provides the support dockerd needs to work there. It has three components: sysbox-runc is the runtime containerd calls; sysbox-fs emulates parts of /proc and /sys for each container; and sysbox-mgr handles ID mappings and special mounts:
| Docker needs | Plain userns Pod | Sysbox |
|---|---|---|
| Create child cgroups | cgroupfs read-only or nobody-owned |
read-write, limited to the container’s own subtree |
/proc for inner containers |
masked by default | read-write; non-namespaced parts emulated, the rest read-only or masked |
mount, pivot_root, unshare |
refused | allowed; mount calls are trapped and checked |
| overlayfs for image layers | overlay-on-overlay doesn’t stack | host bind mounts on /var/lib/docker |
None of this weakens the user namespace. Loading a module or mounting a block device still fails in the kernel, and Sysbox refuses to start a container whose root maps to host root, because that “breaks container isolation”.
Why I chose Sysbox
I wanted jobs to keep using docker build, docker run and Docker Compose unchanged. That ruled out ARC’s kubernetes mode (no daemon), build-only tools like Kaniko or BuildKit and rootless dind (still privileged). I didn’t formally compare it with Pod Sandboxing, which uses Kata Containers to give each Pod its own VM on AKS. It requires Azure Linux nodes, and NAP support only started rolling out in September 2026.
Install Sysbox
Sysbox installs through a DaemonSet from its Kubernetes guide. On AKS with NAP, it needs one workaround and two patches.
Work around the containerd v2 bug
The current installer writes the runtime entry under containerd’s old config path, io.containerd.grpc.v1.cri, which containerd v2 silently ignores. The bug is tracked in nestybox/sysbox#997 and remains open as of v0.7.1. The workaround below should become unnecessary once a release fixes it.
Until then, I replace the installer’s command with a small wrapper. It uses dasel to write the entry under the v2 path, then runs the stock installer. The installer sees the existing sysbox-runc entry and leaves it alone. When it restarts containerd, the new entry takes effect:
[plugins."io.containerd.cri.v1.runtime".containerd.runtimes.sysbox-runc] runtime_type = "io.containerd.runc.v2" [plugins."io.containerd.cri.v1.runtime".containerd.runtimes.sysbox-runc.options] BinaryName = "/usr/bin/sysbox-runc" SystemdCgroup = trueLabel NAP nodes for the installer
My runner nodes come from NAP, which can’t bake a runtime into the node image, so each new node needs Sysbox installed when it boots. The installer only runs on nodes labelled sysbox-install=yes and keeps them tainted with sysbox-runtime=not-running:NoSchedule until Sysbox is running. The NodePool sets the label and adds the taint as a startup taint:
apiVersion: karpenter.sh/v1kind: NodePoolmetadata: name: sysboxspec: template: metadata: labels: purpose: github-actions sysbox-install: "yes" spec: # nodeClassRef, requirements and disruption as in the NAP post startupTaints: - key: sysbox-runtime value: not-running effect: NoSchedule taints: - key: github-actions value: "true" effect: NoSchedule - key: sysbox value: "true" effect: NoSchedulePods don’t need to tolerate a startup taint for Karpenter to create a node for them. The runner Pods wait until the installer removes it.
Patch the installer and the RuntimeClass
The upstream manifests need two patches. First, the DaemonSet only tolerates its own taint, so I add tolerations for the pool’s taints and Cilium’s startup taint.
Second, the RuntimeClass selects on sysbox-runtime: running, a label the installer sets when it finishes. Karpenter can’t predict that label, so it never creates a node for a waiting Pod (nestybox/sysbox#888). I change the RuntimeClass to select on the NodePool’s label instead. Kubernetes merges these scheduling settings into every Pod that uses the RuntimeClass:
apiVersion: node.k8s.io/v1kind: RuntimeClassmetadata: name: sysbox-runchandler: sysbox-runcscheduling: nodeSelector: sysbox-install: "yes" tolerations: - key: github-actions operator: Equal value: "true" effect: NoSchedule - key: sysbox operator: Equal value: "true" effect: NoSchedulePlan for failed installs and upgrades
A failed installation leaves the node tainted indefinitely: Karpenter has no timeout for this startup taint. Watch the installer’s logs, especially after a Kubernetes upgrade.
Restarting the installer leaves the node alone if the same Sysbox version is already installed. An installer carrying a new version, however, updates Sysbox and deletes every Sysbox Pod on the node with a one-second grace period, regardless of do-not-disrupt.
Switch the runners to Sysbox
In the expanded dind template, remove privileged: true from the dind container, since Sysbox doesn’t support privileged containers. Then add these fields to the Pod spec:
template: spec: runtimeClassName: sysbox-runc hostUsers: falseCheck that it holds
Running the same job on a Sysbox runner shows a high, bounded UID range in both the runner and the nested privileged container:
$ cat /proc/self/uid_map0 3183345664 65536$ docker run --rm --privileged alpine:3.21 cat /proc/self/uid_map0 3183345664 65536The disk mount fails. That also blocks the module-loading check, which depends on accessing the modules on the node’s disk. Writing a kernel sysctl is refused as well:
$ mount /dev/nvme0n1p1 /hostmount: permission denied (are you root?)$ echo 1 > /proc/sys/kernel/unprivileged_bpf_disabled 2>&1; echo $?1| Check | Privileged runner | Sysbox runner |
|---|---|---|
| uid_map | 0 0 4294967295 (host root) |
0 3183345664 65536 (userns) |
| Host-fs write | wrote to the host disk | permission denied |
| Kernel module load | loaded in host kernel | permission denied |
| Kernel sysctl write | hits the host | refused |
The workflows I tested still work: multi-platform Buildx builds with QEMU (kernel 6.7 or newer), --network=host, cache and secret mounts, plus docker run --privileged with another dockerd inside.
What Sysbox leaves open
A job now needs a kernel or Sysbox bug to reach the node; --privileged alone is no longer enough. Sysbox itself runs as root, so a bug in it can compromise the host.
The kernel is still shared. Sysbox allows mount and unshare, which Docker’s default seccomp profile restricts, so jobs can reach the kernel interfaces involved in bugs such as CVE-2022-0185. Sysbox also ignores per-container seccomp and AppArmor settings, leaving node patching as the only lever here. My runner nodes are short-lived, so each one boots the latest AKS node image.
The project is small. Since Docker bought Nestybox, Sysbox has mostly been maintained by one of Nestybox’s two founders. The README says it is “not officially supported by Docker”. Support for new Kubernetes versions lags behind AKS, so check the installer before upgrading a cluster.
References
- Sysboxgithub.com
- Install Sysbox on Kubernetesgithub.comthe installer DaemonSet, its label and taint
- nestybox/sysbox#997github.comthe containerd v2 config path
- Using Docker-in-Docker modedocs.github.comARC’s dind mode and its expanded template
- Karpenter NodePoolskarpenter.shstartup taints
- Kubernetes user namespaceskubernetes.io
- KEP-5474github.comwritable cgroups, targeted at alpha in 1.38