kaniko/integration/dockerfiles
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
..
Dockerfile_hardlink_base Extract filesystem in order rather than in reverse 2018-08-29 15:44:38 -07:00
Dockerfile_onbuild_base Fully qualify images in dockerfile tests (#257) 2018-07-25 17:56:17 -07:00
Dockerfile_test_add fix add command bug when adding remote URLs (#277) 2018-08-07 17:10:27 -07:00
Dockerfile_test_cache Add layer caching to kaniko 2018-09-13 18:32:53 -07:00
Dockerfile_test_cache_install Add layer caching to kaniko 2018-09-13 18:32:53 -07:00
Dockerfile_test_copy Don't copy same files twice in copy integration tests (#273) 2018-08-03 10:01:29 -07:00
Dockerfile_test_copy_bucket Don't copy same files twice in copy integration tests (#273) 2018-08-03 10:01:29 -07:00
Dockerfile_test_copy_reproducible Don't copy same files twice in copy integration tests (#273) 2018-08-03 10:01:29 -07:00
Dockerfile_test_copy_same_file_many_times Always snapshot files in COPY and RUN commands 2018-08-23 18:23:39 -07:00
Dockerfile_test_daemons reproduced 247 with integration test 2018-07-26 11:16:26 -07:00
Dockerfile_test_env Environment variables with multiple '=' are not parsed correctly (#278) 2018-08-07 10:22:48 -07:00
Dockerfile_test_expose Fully qualify images in dockerfile tests (#257) 2018-07-25 17:56:17 -07:00
Dockerfile_test_extract_fs Fully qualify images in dockerfile tests (#257) 2018-07-25 17:56:17 -07:00
Dockerfile_test_hardlink Extract filesystem in order rather than in reverse 2018-08-29 15:44:38 -07:00
Dockerfile_test_label Fully qualify images in dockerfile tests (#257) 2018-07-25 17:56:17 -07:00
Dockerfile_test_metadata Fully qualify images in dockerfile tests (#257) 2018-07-25 17:56:17 -07:00
Dockerfile_test_multistage Get absolute path of file before checking whitelist 2018-08-17 18:29:11 -04:00
Dockerfile_test_mv_add Extract filesystem in order rather than in reverse 2018-08-29 15:44:38 -07:00
Dockerfile_test_onbuild Integration test refactoring (#126) 2018-05-15 13:42:35 -07:00
Dockerfile_test_registry Fully qualify images in dockerfile tests (#257) 2018-07-25 17:56:17 -07:00
Dockerfile_test_run Set default home value (#281) 2018-08-10 12:58:07 -07:00
Dockerfile_test_run_2 Fully qualify images in dockerfile tests (#257) 2018-07-25 17:56:17 -07:00
Dockerfile_test_scratch Resolve env replacement for FROM command 2018-06-04 11:51:33 -07:00
Dockerfile_test_target Add --target flag for multistage builds (#255) 2018-07-30 09:43:23 -07:00
Dockerfile_test_user_run Set default home value (#281) 2018-08-10 12:58:07 -07:00
Dockerfile_test_volume Fully qualify images in dockerfile tests (#257) 2018-07-25 17:56:17 -07:00
Dockerfile_test_workdir Integration test refactoring (#126) 2018-05-15 13:42:35 -07:00