-
Notifications
You must be signed in to change notification settings - Fork 455
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
Build OCI-compatible image cache #1119
Conversation
🤔 According to my tests this change should not break our CI. But I'm not sure what's the impact, to be honest. I fail to understand this part of the docs: https://docs.docker.com/build/cache/backends/
I am tempted not to merge this change, for the following reasons:
|
Hi Régis! |
Given the conversations above, are we good to close this PR @angonz? |
Yes. |
I opened PR #1161 not having checked for closed issues (sorry!), and @regisb asked me to look at this one and comment, so here goes:
This is pushing complexity to the downstream user, which I'd argue is always a bad idea. "We won't merge a one-liner because you can just as well write a plugin" is not a compelling proposition in my book. :) However, to illustrate why this should go in (not as a feature addition but rather a bug fix), let's address this question:
Buckle up, because it's about to get ugly. :) BuildKit had a long-standing issue (moby/buildkit#2251) which meant that the cache image index it was generating was essentially proprietary and not compliant with the relevant spec. In the comments on that issue, it was proposed that OCI-compliant manifests could be enabled with So, if (and only if) we specify Also, on this one:
I cannot corroborate the "slows the image building process" part. And yes, we do have to build from scratch every time we create a new tag. However, it is very helpful to be able to use cached builds for multiple builds of the same image tag, which tends to happen during stages of code review. |
Your explanations are very clear and helpful, thanks a lot. Now I understand why this proposed change should be a no-brainer -- on the condition that it doesn't break compatibility with docker.io. According to my superficial testing, EDIT: just realised that the answer to my question was here ("support across providers"). I assume that the reported issue for docker.io is now fixed. Not sure what's the status of Red Hat Quay.. |
Thanks to you both @angonz and @fghaas for bearing with me. I agree that we should merge this change. @angonz your PR did not include a changelog entry; @fghaas your PR has a changelog entry, but no |
I hesitate to take credit for the explanation, as it was @kcollasarundell who very helpfully explained this to me, all credit should go to him, and any misinterpretations of his explanation are mine. :)
Sure. I have updated #1161 with an extended changelog entry, and have also added |
Thank you all! I'm very happy to see that multiple visions on one problem end up in something much better. |
Fixes #1118
Add image-manifest=true to build context to support OCI-compatible image cache.
This allows using the registry cache in other registries, like AWS ECR.