-
Notifications
You must be signed in to change notification settings - Fork 490
Add support for --cache-from parameter #217
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo in "Imange"
Typo fixed and documentation added ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be "cachefrom" not "cache-from" @martinberanek
https://docs.docker.com/engine/api/v1.40/#operation/ImageBuild
#202 please review my pull request