Docker cache on Travis and Docker 1.12
I blogged before about building Docker images on Travis and suggested uploading images after successful test runs to Docker Hub and use them as Cache after downloading them in next Travis runs.
Travis upgraded recently to Docker version 1.12 (from 1.9) and since version 1.10 Docker features Content Addressability for layers. This change breaks caching and we need to implement a workaround using Travis cache.
Changes need to be made in .travis.yml:
Enable cache
cache:
directories:
- /home/travis/docker/
Start by requesting Travis to cache /home/travis/docker directory.
Load Docker images previously cached
before_install:
- if ...