kaniko/pkg/util
Priya Wadhwa c216fbf91b Add layer caching to kaniko
To add layer caching to kaniko, I added two flags: --cache and
--use-cache.

If --use-cache is set, then the cache will be used, and if --cache is
specified then that repo will be used to store cached layers. If --cache
isn't set, a cache will be inferred from the destination provided.

Currently, caching only works for RUN commands. Before executing the
command, kaniko checks if the cached layer exists. If it does, it pulls
it and extracts it. It then adds those files to the snapshotter and
append a layer to the config history.  If the cached layer does not exist, kaniko executes the command and
pushes the newly created layer to the cache.

All cached layers are tagged with a stable key, which is built based off
of:

1. The base image digest
2. The current state of the filesystem
3. The current command being run
4. The current config file (to account for metadata changes)

I also added two integration tests to make sure caching works

1. Dockerfile_test_cache runs 'date', which should be exactly the same
the second time the image is built
2. Dockerfile_test_cache_install makes sure apt-get install can be
reproduced
2018-09-13 18:32:53 -07:00
..
bucket_util.go Replace gometalinter with GolangCI-Lint 2018-09-11 13:30:42 -07:00
command_util.go More linting errors 2018-09-11 14:58:25 -07:00
command_util_test.go Replace gometalinter with GolangCI-Lint 2018-09-11 13:30:42 -07:00
fs_util.go Add layer caching to kaniko 2018-09-13 18:32:53 -07:00
fs_util_test.go Merge pull request #347 from priyawadhwa/amazon 2018-09-12 16:08:12 -07:00
image_util.go Replace gometalinter with GolangCI-Lint 2018-09-11 13:30:42 -07:00
image_util_test.go Added a KanikoStage type for each stage of a Dockerfile 2018-08-27 14:15:04 -07:00
tar_util.go More linting errors 2018-09-11 14:58:25 -07:00
tar_util_test.go Separate snapshotting of parent dirs from files 2018-08-24 16:34:59 -07:00
util.go code review comments 2018-09-07 16:03:56 -07:00