https://github.com/jtrim/docker-ci-cache
A script for caching docker images on CI and other ephemeral docker environments.
https://github.com/jtrim/docker-ci-cache
caching ci circle-ci docker
Last synced: 3 months ago
JSON representation
A script for caching docker images on CI and other ephemeral docker environments.
- Host: GitHub
- URL: https://github.com/jtrim/docker-ci-cache
- Owner: jtrim
- Created: 2017-04-12T19:26:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-12T19:42:42.000Z (over 8 years ago)
- Last Synced: 2025-01-09T20:32:27.325Z (9 months ago)
- Topics: caching, ci, circle-ci, docker
- Language: Shell
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker CI Cache
When running builds inside of docker on services like CirceCI, the docker environment is ephemeral. This means that, between CI builds, the images build by docker in the last CI job don't persist. This script seeks to alleviate that problem.
```shell
Usage:docker-ci-cache.sh :: --
, - images that can be downloaded automatically by docker
:: - An image to cache that is built locally by the CI build. Note the usage
of '::' after the image name. This is important
- The command that, upon running, will build local images specified by the cache
This script uses 'docker load' to load any tar image archives found in the cache directory, runs either
'docker run echo -' or the specified command to download and/or prepare the images for archiving,
then uses 'docker save' to export a tar image to the cache directory for each specified image.
The cache directory is ~/docker-cacheExample:
In the following example, we're caching the postgres 9.3.15 image and the ruby 2.3.0
image from docker hub, as well as an image based on a Dockerfile in the 'myapp' directory.docker-ci-cache.sh postgres:9.3.15 ruby:2.3.0 my-app:latest:: -- 'cd my-app && docker build --tag my-app .'
```