Skip to content

Don't regenerate attestation when image wasn't rebuilt #5894

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

Open
vvoland opened this issue Apr 8, 2025 · 4 comments
Open

Don't regenerate attestation when image wasn't rebuilt #5894

vvoland opened this issue Apr 8, 2025 · 4 comments

Comments

@vvoland
Copy link
Collaborator

vvoland commented Apr 8, 2025

Description

Currently attestations are always regenerated, even when the produced image doesn't change because the result is already in cache.
This causes the digest of the resulting image change for every build request.

On Docker side, this is an unexpected default behavior.
We need an option to instruct Buildkit to not regenerate the attestation for an image which wasn't rebuilt.

@tonistiigi
Copy link
Member

Provenance attestation is a record of invoking a build. Two completely different builds at completely different times can produce the same result. If the build was completely cached(in buildkit builds are never completely cached as every execution, eg. loading a Dockerfile is a build step), then that is what the provenance attestation is conveying.

@jsternberg jsternberg moved this from New to Needs author feedback in Issue Triage Apr 11, 2025
@vvoland
Copy link
Collaborator Author

vvoland commented Apr 17, 2025

Right, I'm not debating that. That's why this could be an optional flag.

@tonistiigi
Copy link
Member

We already have a flag for disabling attestations. Just set --provenance=false if you want to opt out.

@vvoland
Copy link
Collaborator Author

vvoland commented Apr 17, 2025

I don't want to opt-out of attestations completely - I just want to change it only when the image wasn't created from cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs author feedback
Development

No branches or pull requests

3 participants