Add support for --cache-from parameter#217
Add support for --cache-from parameter#217davidxia merged 1 commit intospotify:masterfrom martinberanek:cache-from
Conversation
davidxia
left a comment
There was a problem hiding this comment.
Thanks for this PR. Could you also update the usage docs here (add a row for cacheFrom in the "Build Phase")? https://github.com/spotify/dockerfile-maven/blob/master/docs/usage.md#build-phase
| } | ||
| buildParameters.add(new DockerClient.BuildParam("cache-from", cacheFrom)); | ||
| } catch (ImageNotFoundException e) { | ||
| log.warn("Imange for cache-from not found and will not be used for build"); |
|
Typo fixed and documentation added ;) |
davidxia
left a comment
There was a problem hiding this comment.
Thanks for the fixes.
I just noticed docker build --help says the following --cache-from strings Images to consider as cache sources. Notice the plural. I see that you can specify multiple --cache-from images like docker build -t test:latest --cache-from test:latest --cache-from test-builder:latest . Could you update the PR to accept multiple cache-froms? :)
|
I have added support for multiple cache-from images. |
|
This is great. Thanks @martinberanek! |
|
The pull output is not formatted nicely. Guessing |
| } | ||
| } | ||
| if (!cacheFromExistLocally.isEmpty()) { | ||
| buildParameters.add(new DockerClient.BuildParam("cache-from", |
There was a problem hiding this comment.
this should be "cachefrom" not "cache-from" @martinberanek
https://docs.docker.com/engine/api/v1.40/#operation/ImageBuild
#202 please review my pull request