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

Enable specifying a remote image for analysis #7

Open
EricHripko opened this issue May 2, 2021 · 1 comment
Open

Enable specifying a remote image for analysis #7

EricHripko opened this issue May 2, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@EricHripko
Copy link
Owner

Overview

Buildpacks can use a (previously published) remote image to speed up the build. As per moby/buildkit#2097 (comment), 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:

  • Docker CLI will need an extra argument:
$ docker build --cache-from myregistry/myimage .
  • Compose will need an extra attribute in the build section:
services:
  webapp:
    build:
      context: .
      cache_from:
        - myregistry/myimage

Since Buildpacks only support analysing a single image, only the first entry of registry type will be picked up.

CC @jromero for awareness

@EricHripko EricHripko added the enhancement New feature or request label May 2, 2021
@jromero
Copy link
Contributor

jromero commented May 13, 2021

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 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants