solver: infer builder id from user input for provenance in build record #4833
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
follow-up docker/buildx#2280 (comment)
Provenance set in build record does not currently set any builder id even if set through attestation attribute:
{ "builder": { "id": "" }, "buildType": "https://mobyproject.org/buildkit@v1", "materials": [ { "uri": "pkg:docker/docker/dockerfile@1", "digest": { "sha256": "ac85f380a63b13dfcefa89046420e1781752bab202122f8f50032edf31be0021" } }, { "uri": "pkg:docker/[email protected]?platform=linux%2Famd64", "digest": { "sha256": "cd5189337d797eac9e2299dc07096c598cd4f4f73f068a033402f3ded7a51714" } }, { "uri": "pkg:docker/tonistiigi/[email protected]?platform=linux%2Famd64", "digest": { "sha256": "0cd3f05c72d6c9b038eb135f91376ee1169ef3a330d34e418e65e2a5c2e9c0d4" } } ] }I think we can infer this value from user input and set it for the provenance in build record.
Tested in docker/buildx#2280:
{ "binaries": { "buildx.build.provenance": { "builder": { "id": "foo" }, "buildType": "https://mobyproject.org/buildkit@v1", "materials": [ { "uri": "pkg:docker/docker/dockerfile@1", "digest": { "sha256": "dbbd5e059e8a07ff7ea6233b213b36aa516b4c53c645f1817a4dd18b83cbea56" } }, { "uri": "pkg:docker/[email protected]?platform=linux%2Famd64", "digest": { "sha256": "ed8ce6c22dd111631c062218989d17ab4b46b503cbe9a9cfce1517836e65298a" } }, { "uri": "pkg:docker/tonistiigi/[email protected]?platform=linux%2Famd64", "digest": { "sha256": "0cd3f05c72d6c9b038eb135f91376ee1169ef3a330d34e418e65e2a5c2e9c0d4" } } ], "invocation": { "configSource": {}, "parameters": { "frontend": "gateway.v0", "args": { "build-arg:BUILDKIT_CONTEXT_KEEP_GIT_DIR": "1", "cmdline": "docker/dockerfile:1", "source": "docker/dockerfile:1", "target": "binaries" }, "locals": [ { "name": "context" }, { "name": "dockerfile" } ] }, "environment": { "platform": "linux/amd64" } } }, "buildx.build.ref": "builder/builder0/q0t86tpf1cn2tlzzfilcj1qa1" } }