Posts tagged 'travis'

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 …

Docker cache on Travis and Docker 1.12


2016-09-12 Edited to prevent caching of builds in pull requests.
2017-07-07 Edited to point to exact git commit b/c we don't use Travis for Snippets Service anymore.

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 …

Build and Test against Docker Images in Travis

The road towards the absolute CI/CD pipeline goes through building Docker images and deploying them to production. The code included in the images gets unit tested, both locally during development and after merging in master branch using Travis.

But Travis builds its own environment to run the tests on which could be different from the environment of the docker image. For example Travis may be running tests in a Debian based VM with libjpeg version X and our to-be-deployed docker image runs code on-top of Alpine with libjpeg version Y.

To ensure that the image to be deployed to …