EricHripko / cnbp

BuildKit frontend for Cloud Native Buildpacks
Apache License 2.0
5 stars 3 forks source link

Enable specifying a remote image for analysis #7

Open EricHripko opened 3 years ago

EricHripko commented 3 years ago

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:

CC @jromero for awareness

jromero commented 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:

  1. docker build -t my-app .
  2. docker build -t my-app --cache-from my-app .