Skip to content

Conversation

olljanat
Copy link

Windows does not support tmpfs so SBOM scanner create failed.

Related to docker/buildkit-syft-scanner#142


runscan := llb.Image(scanner).Run(runOpts...)
runscan.AddMount("/tmp", llb.Scratch(), llb.Tmpfs())
if runtime.GOOS != "windows" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's not use runtime, we created integration.UnixOrWindows() for this. I'd suggest something like this:

integration.UnixOrWindows(
	runscan.AddMount("/tmp", llb.Scratch(), llb.Tmpfs()),
	runscan.AddMount("/tmp", llb.Scratch()),
)

Copy link
Author

Choose a reason for hiding this comment

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

Ok, updated

Copy link
Member

Choose a reason for hiding this comment

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

Actually this is not good. /testutil/integration should only be used in the tests, not in this frontend code.

Copy link
Author

@olljanat olljanat Jul 18, 2025

Choose a reason for hiding this comment

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

Yes, I was thinking same but do you want it to be moved example to /util/… in this PR or refactor it later?

Copy link
Collaborator

Choose a reason for hiding this comment

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

oops, I thought this was a test. Must just been my foggy brain. If that's the case then your original code was correct, please revert and I approve.

Really sorry for going around...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Revert and then just add Tonis' recommendation on using a cache mount. I think other than doing a TODO, let's do it within this PR...

@tonistiigi
Copy link
Member

If we can't use llb.Tmpfs shouldn't we create a cache mount instead?

As follow-up (tracking issue) we should support llb.Tmpfs as well. If there is no native tmpfs then it should just create empty mount and discard it once it is done for windows.

Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
@olljanat
Copy link
Author

If we can't use llb.Tmpfs shouldn't we create a cache mount instead?

Maybe but not sure how to use it in this context?

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.

3 participants