Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

Enable support for build --cache-from #202

Closed
martinberanek opened this issue Jul 31, 2018 · 5 comments
Closed

Enable support for build --cache-from #202

martinberanek opened this issue Jul 31, 2018 · 5 comments

Comments

@martinberanek
Copy link

Is this a BUG REPORT or FEATURE REQUEST?:

FEATURE REQUEST

Description

Introduce new cacheFrom parametr that (if specified) firstly pulls specified image and than use docker build --cache-from. This can significantly speed up image build and reduce space consumption in docker registry.

@pbillen
Copy link

pbillen commented Sep 1, 2018

+1

I believe you explicitly need to do docker pull in advance (unless you already have the latest in your local registry) or --cache-from has no effect. That is, I believe that --cache-from only considers the local registry.

So ideally, to do everything via Maven, we also need a pull mojo? Or another flag on top of --cache-from to denote that we want a pull first? I would say that the mojo is preferred, as the second option introduces some custom flag which is not possible via the regular Docker CLI/API.

@pbillen
Copy link

pbillen commented Sep 2, 2018

Also, we must allow that the pull could fail. This happens if the image was never pushed before.

I believe the general flow of usage of --cache-from is:

docker pull <image> || true
docker build --cache-from <image> --tag <image> .
docker push <image>

@martinberanek
Copy link
Author

I have created pull request for this feature. Can anybody review/merge it?

@davidxia
Copy link
Contributor

davidxia commented Oct 1, 2018

Added in #217

@seanwang-okta
Copy link

seanwang-okta commented Aug 30, 2019

is this working? i'm using this in a project but it still doesn't use the image pulled as a cache @martinberanek

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants