Commit Graph

18 Commits

Author SHA1 Message Date
Daisuke Taniwaki f8f59ea4c6 Add insecure-registry and tls-skip-verify-registry flags (#537) 2019-01-29 13:29:47 -06:00
dlorenc 996bec885f
Refactor our credential fetching to only get k8s credentials if we are on k8s. (#522) 2019-01-11 11:36:43 -07:00
dlorenc 170e0a2d94
Add a lot more timing data. (#518) 2019-01-10 13:27:55 -07:00
Sharif Elgamal 29b7c3e879
Adding TTL to caching (#488)
* Adding TTL to caching

* uncomment added lines

* cache TTL works for layers now

* remove debugging

* parse booleans correctly

* parse booleans correctly everywhere

* fix boolean parsing condition

* refactor benchmarking calls

* defer file properly
2018-12-13 14:20:25 -08:00
dlorenc 8408c53aa8
Improve cache layer uploads. (#443)
This change only uploads layers that were created from cache misses on RUN commands.
It also improves the cache-checking logic to handle this case.
Finally, it makes cache layer uploads happen in parallel with the rest of the build, logging
a warning if any fail.
2018-11-12 16:22:04 -06:00
Carlos Sanchez 5ed45ed2fb Preserve options when doing a cache push (#423)
* Preserve options when doing a cache push

Otherwise options like `insecure` are lost

* Do not override original object
2018-11-06 15:44:44 -06:00
Daisuke Taniwaki 05e3250043 Support insecure pull (#401) 2018-10-22 14:33:41 -07:00
Jason Hall 5a0c9b2a13 Update go-containerregistry dep and remove unnecessary Options 2018-10-01 14:11:26 -04:00
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
Priya Wadhwa 99ab68e7f4 Replace gometalinter with GolangCI-Lint
gometalinter is broken @ HEAD, and I looked into why that was. During
that process, I remembered that we took the linting scripts from
skaffold, and found that in skaffold gometalinter was replaced with
GolangCI-Lint:

https://github.com/GoogleContainerTools/skaffold/pull/619

The change made linting in skaffold faster, so I figured instead of
fixing gometalinter it made more sense to remove it and replace it with
GolangCI-Lint for kaniko as well.
2018-09-11 13:30:42 -07:00
Priya Wadhwa 0636fe6040 Merge branch 'master' of github.com:GoogleContainerTools/kaniko into stages 2018-08-30 16:17:44 -07:00
Priya Wadhwa 1db7fc2a61 Rebased 2018-08-30 10:16:08 -07:00
Sebastian Jackel 1a7de69f3e Rename DockerInsecure field to InsecurePush 2018-08-30 09:36:12 +02:00
Sebastian Jackel 4ba6148621 Implement separation between Insecure (HTTP) registry and skipping TLS verification into two separate command line parameters 2018-08-30 09:34:31 +02:00
sharifelgamal 493344e438
support multiple tags when writing to a tarfile 2018-08-28 18:14:03 -07:00
Priya Wadhwa 64a0b1d75f Added a KanikoStage type for each stage of a Dockerfile
I added a KanikoStage to hold each stage of the Dockerfile along with
information about each stage that would be useful later on.

The new KanikoStage type holds the stage itself, along with some
additional information:

1. FinalStage -- whether the current stage is the final stage
2. BaseImageStoredLocally/BaseImageIndex -- whether the base image for
this stage is stored locally, and if so what the index of the base image
is
3. SaveStage -- whether this stage needs to be saved for use in a future
stage

This is the first part of a larger refactor for building stages, which
will later make it easier to add layer caching.
2018-08-27 14:15:04 -07:00
Priya Wadhwa d867eadbb0 Review code comments; improved error messages for push 2018-08-23 14:27:13 -07:00
Priya Wadhwa cfa822f178 Refactor command line arguments and the executor
In this refactor I:

1. Created KanikoOptions to make it easier to pass around arguments
passed in through the command line
2. Reorganized executor.go by putting the logic for pushing the image in
a new file push.go
3. Made some error messages clearer
4. Fixed a mistake in the README for pushing to AWS
5. Marked the --bucket flag as hidden since we want people to use
--context instead, and marked an aws flag as hidden which is set in a
vendored directorya
2018-08-23 13:30:36 -07:00