mirror of
https://github.com/moby/buildkit.git
synced 2026-11-06 05:16:45 +00:00
The rootless spec conversion removes the /sys mount, so the runtime never creates its mount point in the rootfs. A rootful build gets that empty directory, which meant the same LLB left different mount points behind depending on whether the worker was rootless. Recreate the mount points of the removed mounts after the container has exited, rather than cleaning them up from the rootful result, which would change existing output and need a compatibility version bump. Creating them up front would instead turn a mount point that the image does not ship into a directory the build can write to. Nested destinations are skipped: the runtime creates those inside the parent mount, where they never reach the rootfs. Fixes #6686 Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>