Description
On a CI/CD pipeline is common to have an image built in a job and just on another job the image is pushed to the registry, between jobs you can have artifacts pushed and pulled. This can be accomplished by using docker save
and docker load
when working with single-arch images, but it's not possible to export multi-arch images to an artifact that can be reloaded later.
If you share the cache contents between jobs, you can use docker buildx build --push --cache-from
to push the image to the registry without having to rebuild the images. But this only works if you also share the exact same context that was used to build the image originally, and that is not always possible.
Given that, there should be a way to push the layers on cache without having to rely on the context to do it.