Getting advantage of docker image cache on 1.13

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 --cache-from

For example:

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.

See also:

Go Top