Skip to content

Best way to cache multi-stage + multi-platform image builds #1382

Answered by jedevc
AngellusMortis asked this question in Q&A
Discussion options

You must be logged in to vote

👋 Heya, sorry it took so long to get to this!

This issue sounds a lot like this: #1044. Essentially, while buildx has special logic for linking together separate outputs again after push, there's no similar logic for linking the caches. We also discussed this on the community slack some time back.

As a workaround in the meantime, you could perform multiple builds - because buildkit's own cache will apply for the first build, you can do your whole build + export, then have a special build step just to export linux/amd64 cache, then another special build step just to export the linux/arm64 cache. As long as these are on the same set of builders, the special steps won't need to rebuild the c…

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
3 replies
@AngellusMortis
Comment options

@AngellusMortis
Comment options

@pecigonzalo
Comment options

Answer selected by AngellusMortis
Comment options

You must be logged in to vote
4 replies
@AngellusMortis
Comment options

@masip85
Comment options

@AngellusMortis
Comment options

@pecigonzalo
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants