Skip to content

executor: restore mount points removed for rootless - #7039

Open
tonistiigi wants to merge 2 commits into
moby:masterfrom
tonistiigi:restore-rootless-mountpoints
Open

executor: restore mount points removed for rootless#7039
tonistiigi wants to merge 2 commits into
moby:masterfrom
tonistiigi:restore-rootless-mountpoints

Conversation

@tonistiigi

Copy link
Copy Markdown
Member

replaces #7033

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

teamleaderleo and others added 2 commits August 12, 2026 08:58
BuildKit records mount-stub cleanup before rootless conversion finishes changing the mount list, which can leave rootful and rootless builds with different empty directories.

This change registers cleanup after rootless conversion, when the mount list is final, and uses that list for cleanup.

Signed-off-by: Leo Li <cheerleaderleo@outlook.com>
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 moby#6686

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@tonistiigi tonistiigi changed the title Restore rootless mountpoints executor: restore mount points removed for rootless Aug 13, 2026
@tonistiigi tonistiigi added this to the v0.33.0 milestone Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reproducible builds: rootless version produces different images

3 participants