Open EricHripko opened 3 years ago
I'm assuming here that the cache-from
can point to a local image as well with behaviour similar to docker run
where it will pull it if it doesn't exist. I'm basing this theory based on this statement on the docs
BuildKit automatically pulls the image from the registry if needed.
I'm thinking about the rebuild scenario:
docker build -t my-app .
docker build -t my-app --cache-from my-app .
Overview
Buildpacks can use a (previously published) remote image to speed up the build. As per https://github.com/moby/buildkit/issues/2097#issuecomment-830755638, this is conceptually similar to --cache-from functionality.
We should be able to lean on GetCacheImports API to enable specifying the remote image. UX will be roughly as follows:
build
section:Since Buildpacks only support analysing a single image, only the first entry of
registry
type will be picked up.CC @jromero for awareness