dockerfile: fix Windows SBOM scanner temp mount - #6941
Conversation
1207075 to
29730b4
Compare
|
|
||
| scanPlatform := llb.NewConstraints(opts...).Platform | ||
| if scanPlatform != nil { | ||
| scannerImage = llb.Image(scanner, llb.Platform(*scanPlatform)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Ah good catch. Updated so the scan platform is no longer passed as an LLB platform constraint for the scanner image or exec. It's now passed as plain data into the scanner callback so the scanner image stays consistent with the config resolved earlier in CreateSBOMScanner.
| scanPlatform := llb.NewConstraints(opts...).Platform | ||
| if scanPlatform != nil { | ||
| scannerImage = llb.Image(scanner, llb.Platform(*scanPlatform)) | ||
| } |
There was a problem hiding this comment.
Note that the config has already been resolved in ResolveImageConfig line 43 iiuc, so switching image later would get them out of sync.
29730b4 to
a4e7d52
Compare
tonistiigi
left a comment
There was a problem hiding this comment.
I still don't quite understand this. You seem to be keying this behavior on target platform but the behavior you are masking is that "there is no tmpfs support"? In that case that would depend on the build platform?
Yes I mixed up target and build platform 🙈 |
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
a4e7d52 to
7351945
Compare
needed for docker/buildkit-syft-scanner#201
carry and closes #6093
This carries the intent of #6093 and closes it 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.