Skip to content

Commit 7004efe

Browse files
committed
fix: use vfs storage + chroot isolation for unprivileged k3s pods
The overlay driver with fuse-overlayfs requires CLONE_NEWUSER which k3s pods don't allow without privileged mode. Switching to vfs driver and BUILDAH_ISOLATION=chroot avoids user namespaces entirely. Slower builds (no layer dedup) but works without any special pod security.
1 parent 2792db9 commit 7004efe

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
88
libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev \
99
build-essential pkg-config \
1010
lib32gcc-s1 \
11-
buildah fuse-overlayfs \
11+
buildah \
1212
&& rm -rf /var/lib/apt/lists/*
1313

1414
# Node.js 24
@@ -22,13 +22,12 @@ RUN npm install -g pnpm@latest
2222
# Runner user (UID 1000 to match k8s securityContext)
2323
RUN useradd -m -s /bin/bash -u 1000 runner
2424

25-
# Buildah rootless config
25+
# Buildah config for unprivileged k3s pods (no CLONE_NEWUSER available).
26+
# Uses vfs storage (no overlayfs) and chroot isolation (no user namespaces).
2627
RUN mkdir -p /home/runner/.config/containers && \
27-
echo '[storage]' > /home/runner/.config/containers/storage.conf && \
28-
echo 'driver = "overlay"' >> /home/runner/.config/containers/storage.conf && \
29-
echo '[storage.options.overlay]' >> /home/runner/.config/containers/storage.conf && \
30-
echo 'mount_program = "/usr/bin/fuse-overlayfs"' >> /home/runner/.config/containers/storage.conf && \
28+
printf '[storage]\ndriver = "vfs"\n' > /home/runner/.config/containers/storage.conf && \
3129
chown -R runner:runner /home/runner/.config
30+
ENV BUILDAH_ISOLATION=chroot
3231

3332
# Rust (installed as runner user)
3433
USER runner

0 commit comments

Comments
 (0)