Skip to content

dockerfile: fix Windows SBOM scanner temp mount#6941

Open
crazy-max wants to merge 1 commit into
moby:masterfrom
crazy-max:fix-windows-sbom-scanner-tmp
Open

dockerfile: fix Windows SBOM scanner temp mount#6941
crazy-max wants to merge 1 commit into
moby:masterfrom
crazy-max:fix-windows-sbom-scanner-tmp

Conversation

@crazy-max

Copy link
Copy Markdown
Member

needed for docker/buildkit-syft-scanner#201
carry and closes #6093

This carries the intent of #6093 with a mount shape that works for the Windows scanner image being added in docker/buildkit-syft-scanner#201. The SBOM scanner still gets writable temp space, but Windows no longer asks BuildKit to create a tmpfs mount that the platform cannot support.

The scanner image is now resolved and run with the target scan platform, so a Windows scan uses the Windows scanner image variant. Linux scans keep the existing tmpfs mount for /tmp, while Windows scans use a writable no-output bind mount sourced from the scanner image with /tmp created.

@crazy-max crazy-max force-pushed the fix-windows-sbom-scanner-tmp branch from 1207075 to 29730b4 Compare July 8, 2026 14:45
@crazy-max crazy-max added this to the v0.32.0 milestone Jul 8, 2026
@crazy-max crazy-max requested a review from tonistiigi July 8, 2026 15:11
@crazy-max crazy-max marked this pull request as ready for review July 8, 2026 15:11

scanPlatform := llb.NewConstraints(opts...).Platform
if scanPlatform != nil {
scannerImage = llb.Image(scanner, llb.Platform(*scanPlatform))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the intended behavior in here? Doesn't this switch to a scanner image of a different architecture (eg running via emulator), not just windows?

scanPlatform := llb.NewConstraints(opts...).Platform
if scanPlatform != nil {
scannerImage = llb.Image(scanner, llb.Platform(*scanPlatform))
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the config has already been resolved in ResolveImageConfig line 43 iiuc, so switching image later would get them out of sync.

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.

2 participants