Skip to content
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

Supporting multiple cache exports #2818

Closed
mortargrind opened this issue Apr 20, 2022 · 2 comments · Fixed by #3024
Closed

Supporting multiple cache exports #2818

mortargrind opened this issue Apr 20, 2022 · 2 comments · Fixed by #3024

Comments

@mortargrind
Copy link

mortargrind commented Apr 20, 2022

Hello. I've noticed that specifying multiple --cache-to values in a docker buildx build command is not supported directly. Found this comment: https://github.com/moby/buildkit/blob/master/control/control.go#L283 and this convo #615 (comment). Is this still fairly easy to have or is there no plan supporting it in the near future?

My use-case is: I am trying to utilize new BuildKit caching capabilities in my CI pipeline to speed things up and if I am able to export 2 caches for a single Dockerfile stage (like one tagged/named as latest and other one as GITHUB_SHA or branch_name) then I think I can maximize the cache hit ratio for a lot of different scenarios. Basically a CI job for a fresh PR would first use the latest cache but on subsequent re-runs of the same job would be able to use GITHUB_SHA/branch_name one since using multiple cache-from is allowed already.

@tonistiigi
Copy link
Member

Is this still fairly easy to have or is there no plan supporting it in the near future?

There shouldn't be big technical issues with adding this. But still somebody needs to implement it.

(like one tagged/named as latest and other one as GITHUB_SHA) then I think I can maximize the cache hit ratio for a lot of different scenarios

Looks like in your case you don't even need the multiple exports but ability to set multiple ref names for registry export.

@remidebette
Copy link

Hi, I have the same usecase. (export-cache on buildctl to multiple refs)
What would need to be done to implement this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants