Last week's release of Docker (v1.13) added the
cache-from build flag which
allows the use of local images as build cache and solves the
layer caching issue created by Content Addressability
as I've blogged before.
To use the new feature and take advantage of the caching for faster image builds
first pull the image that you want to base you build upon and then build using
docker pull myimage:v1.0 docker build --cache-from myimage:v1.0 -t myimage:v1.1 .
You should always keep in mind though that you must fully trust the registry you're pulling from or that you have ways to verify that the layers you're reusing are the ones to intended to include.
- GitHub Issue: Implement build cache based on history array #26839
- Docker build Documentation