-
Notifications
You must be signed in to change notification settings - Fork 5.6k
only use attestation when building image outside the development inner loop #12853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e6a82a0 to
ac7dc8b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From build tool standpoint, provenance flag is a shorthand that can either be a bool (to enable/disable) or provenance attributes (atm only mode attribute exists): https://docs.docker.com/build/metadata/attestations/slsa-provenance/#create-provenance-attestations
By default provenance flag is empty: https://github.com/docker/buildx/blob/ea2b7020a4645bff395eb49e4e87ef08ba24eb93/commands/build.go#L648
And it defaults to min: https://github.com/docker/buildx/blob/ea2b7020a4645bff395eb49e4e87ef08ba24eb93/build/opt.go#L153
If compose wants to use this shorthand then I think it should have the same behavior as build provenance flag.
So to summarize provenance field should be bool/string type:
--provenance=true: enable provenance--provenance=false: disable provenance--provenance=mode=xxx: set mode (xxx can beminormax)
And defaults to empty so build.Build handles the default behavior.
In the case of your fix to disable provenance in the inner loop you would just need to set Attests["provenance"] = nil to disable provenance.
Maybe it would be better to handle that first to fix the issue and implement the provenance field in another PR as ti might need more thoughts?
…r loop when building a image, by default attestation are generated and modify the image ID which trigger a container recreation on up, run command even if there isn't any changes on the image content itself Signed-off-by: Guillaume Lours <[email protected]>
e3605e9 to
e3c481b
Compare
Signed-off-by: Guillaume Lours <[email protected]>
e3c481b to
0225aed
Compare
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [docker/compose](https://github.com/docker/compose) | patch | `v2.36.1` -> `v2.36.2` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>docker/compose (docker/compose)</summary> ### [`v2.36.2`](https://github.com/docker/compose/releases/tag/v2.36.2) [Compare Source](docker/compose@v2.36.1...v2.36.2) #### What's Changed ##### 🐛 Fixes - Run ContainerStart sequentially by [@​ndeloof](https://github.com/ndeloof) in docker/compose#12851 - Only use attestation when building image outside the development inner loop by [@​glours](https://github.com/glours) in docker/compose#12853 - Report error (re)creating container by [@​ndeloof](https://github.com/ndeloof) in docker/compose#12859 - Fix `up --build` with additional_context dependency by [@​ndeloof](https://github.com/ndeloof) in docker/compose#12863 ##### 🔧 Internal - Add example provider implementation by [@​ndeloof](https://github.com/ndeloof) in docker/compose#12848 - Add `up --build` e2e test by [@​ndeloof](https://github.com/ndeloof) in docker/compose#12864 ##### ⚙️ Dependencies - Build(deps): bump github.com/containerd/containerd/v2 from 2.1.0 to 2.1.1 by [@​dependabot](https://github.com/dependabot) in docker/compose#12857 - Bump compose-go to v2.6.4 by [@​glours](https://github.com/glours) in docker/compose#12867 - Bump buildkit v0.22.0 and buildx v0.24.0 by [@​glours](https://github.com/glours) in docker/compose#12868 **Full Changelog**: docker/compose@v2.36.1...v2.36.2 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC4yNi4xIiwidXBkYXRlZEluVmVyIjoiNDAuMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
When building a image, by default attestation are generated and modify the image ID which trigger a container recreation on up and run command even if there isn't any changes on the image content itself
What I did
provenanceattribute to the build options, which is set to true only when build command is usednonemode from thebuildcommand lineRelated issue
(not mandatory) A picture of a cute animal, if possible in relation to what you did
