Skip to content

Instantly share code, notes, and snippets.

@hraban hraban/.travis.yml forked from hc2p/.travis.yml
Created May 24, 2017

What would you like to do?
This is a prove of concept for leveraging the travis directory caching for speeding up docker builds. It works by configuring the docker deamon to use a folder under current user's (travis) control. That way you have the privileges to use the caching feature of travis ci.
sudo: false
- docker
- sudo service docker stop
- if [ "$(ls -A /home/travis/docker)" ]; then echo "/home/travis/docker already set"; else sudo mv /var/lib/docker /home/travis/docker; fi
- sudo bash -c "echo 'DOCKER_OPTS=\"-H tcp:// -H unix:///var/run/docker.sock -g /home/travis/docker\"' > /etc/default/docker"
- sudo service docker start
- docker build -f Dockerfile-testenv -t testenv .
- docker run testenv
- sudo service docker stop
- sudo chown -R travis ~/docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.