Commit Graph

2266 Commits

Author SHA1 Message Date
Luke Wood 80421f2a73 Update version of go-containerregistry. (#724)
Brings in a change from upstream to resolve ports to well-known values when comparing Host values to decide whether or not to send the Bearer Authorization header when pushing an image.

Upstream issue is https://github.com/google/go-containerregistry/issues/472.
2019-07-24 13:09:18 -07:00
v.rul 7750094ec1 Add checking image presence in cache prior to downloading it
This changes allow to use kaniko-warmer multiple times without unnecessary docker image downloads.
To check image presence in cache directory I'm using existing cache function that is used by kaniko-executor.
I've considered building separate function to only check image presence, but it will have pretty much the same code.
Questionable decision is to embed CacheOptions type to KanikoOptions and WarmerOptions. Probably this should be resolved by creating interface providing needed options and implement it both mentioned structs. But I've struggled to get a meaningfull name to it.
To replicate previous behaviour of downloading regardless of cache state I've added --force(-f) option.

This changes provides crucial speed-up when downloading images from remote registry is slow.

Closes #722
2019-07-24 18:09:21 +03:00
Taylor Barrella 3422d5572a Misc. small changes/refactoring (#712) 2019-07-23 15:10:22 -07:00
Tejal Desai 19fb253e9c
Merge pull request #680 from tbarrella/go-containerregistry-upgrade
Update go-containerregistry
2019-07-23 14:35:19 -07:00
Роман Небалуев be0dac2823 fix unpacking archives via ADD 2019-07-19 18:47:18 +05:00
priyawadhwa 32b3b4f604
Merge pull request #703 from caarlos0/git-branch
feat: support specifying branch for cloning
2019-07-16 15:02:00 -07:00
Carlos Alexandro Becker 35bff80fda
chore: empty commit
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2019-07-14 16:13:42 -03:00
Matthew Dawson 619fc5e59b Make container layers captured using FS snapshots reproducible
When a Dockerfile command requires using the TakeSnapshotFS function,
the resulting layer has a random ordering of files.  This causes the
layer to have a non-deterministic hash defeating the reproducible flag.
Issue #710 appears to document this issue as well.

To fix, always sort the list of files to be added in scanFullFilesystem.
This avoids trying to sort the file list during execution, and takes
almost no time to complete.
2019-07-11 21:58:42 -04:00
Carlos Alexandro Becker 46a738f2b2
fix: integration tests
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2019-06-22 12:18:42 -03:00
Carlos Alexandro Becker f578b09846
fix: remove single branch option
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2019-06-22 12:17:46 -03:00
Carlos Alexandro Becker c45e05f668
clean: remove debug msg
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2019-06-22 11:45:42 -03:00
Carlos Alexandro Becker f0b9ad3a57
feat: support specifying branch for cloning
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2019-06-22 11:45:07 -03:00
Priya Wadhwa e2a4098b8e fixed dockerfile path 2019-06-19 11:06:59 -07:00
priyawadhwa baba32c308
Merge pull request #701 from priyawadhwa/release
Release v0.10.0
2019-06-19 11:56:22 -06:00
Priya Wadhwa 7ed6fec424 Release v0.10.0 2019-06-19 10:41:35 -07:00
Andreas Bergmeier 7cc899b09e Add SkipVerify support to CheckPushPermissions. (#663)
Extract makeTransport, which allows using the current mechanism used for
pushing.

Fixes #628.
2019-06-14 12:34:55 -07:00
Takeaki Matsumoto 35bb350a49 Add support for S3 custom endpoint
For S3-compatible object storage (like minio),
this patch enable to use custom endpoint-url.

Fix #531
2019-06-13 12:42:52 +09:00
tralexa 66a052255f
Insecure is now honored 2019-06-02 12:24:22 +03:00
Taylor Barrella 5c0603a967 Update go-containerregistry
Resolves #607

* Deleted a duplicate Gopkg.lock block for github.com/otiai10/copy to
  prevent `dep ensure` from deleting it from vendor/

* Searched for breaking changes. Only found ones for
  remote.Delete/List/Write/WriteIndex. Searched for those and fixed

* Noticed that NewInsecureRegistry was deprecated and replaced it
2019-05-25 15:56:20 -07:00
Priya Wadhwa 317d1b7017 Improve git buildcontext integration test
Build a dockerfile that will copy the LICENSE from the kaniko github repository into the image to make sure the git buildcontext works as expected.
2019-05-23 16:12:20 +02:00
priyawadhwa 2fc8a7f4bc
Merge pull request #665 from orisano/chore-fix-typo
chore: fix typo
2019-05-23 16:06:11 +02:00
priyawadhwa 1723613e8f
Merge pull request #672 from vkartik97/issue#269
Creating  github Build Context
2019-05-23 16:05:27 +02:00
Kartik Verma f137f81884
Resolved Merge Conflicts
Signed-off-by: Kartik Verma <vkartik97@gmail.com>
2019-05-21 01:52:14 +05:30
Andreas Bergmeier 0a3a280e8f Correct CheckPushPermission comment. 2019-05-20 09:36:25 +02:00
Nao YONASHIRO 75fdad7319 chore: fix typo 2019-05-17 03:17:08 +09:00
priyawadhwa 38c1735d92
Merge pull request #655 from GijsWeterings/master
Add `--digest-file` flag to output built digest to file.
2019-05-14 12:37:14 -07:00
Gijs 1c13829cda Update README to reflect flag name change 2019-05-14 10:23:50 +02:00
Gijs 3686b65426 Process feedback of priyawadhwa regarding naming/nilcheck.
Changes the argument flag from `--digestfile` to `--digest-file`.
Skips an unneeded nil check.
2019-05-11 15:14:25 +02:00
Johannes 'fish' Ziemke 8c732f6f52 Fix kaniko caching (#639)
* Revert "Change cache key calculation to be more reproducible. (#525)"

This reverts commit 1ffae47fdd.

* Add logging of composition key back

* Do not include build args in cache key

This should be save, given that the commands will have the args included
when the cache key gets built.
2019-05-10 09:57:03 -05:00
Jake Shadle abd21669f8 Improve changelog dates (#657)
Use ISO-8601 date format for all the dates in the changelog.
2019-05-10 09:55:12 -05:00
Gijs a6e3ddfc79 Add `--digestfile` flag to output built digest to file.
This flag, when set, takes a file in the container and writes the image digest to it. This can be used to extract the exact digest of the built image by surrounding tooling without having to parse the logs from Kaniko, for example by pointing the file to a mounted volume or to a file used durint exit status, such as with Kubernetes' [Termination message policy](https://kubernetes.io/docs/tasks/debug-application-cluster/determine-reason-pod-failure/)]

When the flag is not set, the digest is not written to file and the executor behaves as before. The digest is also written to file in case of a tarball or a `--no-push`.

Closes #654
2019-05-02 14:57:44 +02:00
Thao-Nguyen Do 75e6c9b66c
Update golang to 1.12 in warmer image 2019-04-29 09:17:19 +02:00
Thao-Nguyen Do e7fd0d4db5
Update golang to 1.12 in debug image 2019-04-29 09:16:48 +02:00
Thao-Nguyen Do 0183405c11
Update base image for main image to golang:1.12 2019-04-29 09:16:13 +02:00
Akihiro Suda 404af20f7c README.md: update BuildKit/img comparison (#642)
Latest BuildKit/img no longer necessarily requires procMount to be unmasked, by
 not unsharing PID namespaces.

The current drawback of BuildKit/img compared to kaniko is that BuildKit/img
requires seccomp and AppArmor to be disabled so as to create nested containers.

https://github.com/moby/buildkit/pull/768
https://github.com/genuinetools/img/pull/221

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2019-04-25 10:41:38 -07:00
Balint Pato 7901c76127
Update README.md 2019-04-16 15:53:20 -07:00
Johan Hernandez 841cfb3f53 Add documentation for --verbosity flag (#634) 2019-04-15 13:32:44 -07:00
Dirk Gustke dd9d081447 this is quite spammy in my multistage build (#640)
.. and as i am surely not the only one, move it down to debug.
2019-04-15 13:22:46 -07:00
Kartik Verma fa2a2c803b
Updated PR Branch with master 2019-04-09 02:18:28 +05:30
Johannes 'fish' Ziemke 8f863213b8
Remove cruft 2019-04-01 11:13:10 +02:00
Fred Cox 82f4179ba6
Reduce log level for adding file message
This makes for massive logs and with it at debug level will be simpler to look at the output of kaniko
2019-03-25 22:14:47 +02:00
dlorenc c8fabdf6e4
Fix arg handling for multi-stage images in COPY instructions. (#621) 2019-03-22 12:24:43 -05:00
Daisuke Taniwaki 1bf4421047 Fix parent directory permissions (#619)
* Add parent directories of adding files

* Add integration Dockerfile to test parent directory permissions

* Remove unnecessary helper method

* Use a file on the internet for integration Dockerfile
2019-03-19 12:40:15 -05:00
Jason Hall 3fa411ceb9 Check push permissions before building images (#622)
* Check push permissions before building images

* Fix doc comment

* improve error messages
2019-03-19 12:39:59 -05:00
Daisuke Taniwaki 28bfb75a31 Fix file mode bug (#618)
* Fix file mode

* Add Dockerfile for special file permission test
2019-03-18 13:28:24 -05:00
Warren Seymour 319bfde932 Include warmer in debug image
When using Kaniko with certain build systems, such as GitLab CI, it is necessary to use the 'debug' image and override the entrypoint, so that an arbitrary build script can be executed within the container.  Unfortunately, the 'warmer' binary is not available in the 'debug' image, making it impossible to perform a base image cache warmup using such build systems.

This patch addresses this by ensuring that the 'out/warmer' target is made in the initial stage, and that all 'out' files are copied to '/kaniko' in the final stage.
2019-03-15 10:20:13 +00:00
dlorenc 246cc92a33
Optimize file copying and stage saving between stages. (#605)
This change calculates the exact files and directories needed between
stages used in the COPY command. Instead of saving the entire
stage as a tarball, we now save only the necessary files.
2019-03-13 07:47:28 -07:00
Vincent Demeester 6ce3dfb93a Bump go-containerregistry to 8c1640add99804503b4126abc718931a4d93c31a (#609)
The main reason is to include the fixes from
https://github.com/google/go-containerregistry/pull/401. This should
fix the build+push to quay.io (with v2 schema enabled) cases.

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
2019-03-11 13:44:32 -07:00
Jason Hall a916b72169
Add license header 2019-03-07 10:33:23 -05:00
dlorenc 9912ccbf8d
Fix USER handling. There were two issues: (#600)
- We were validating usernames/groupnames existed in etc/passwd. Docker does not do this
- We were incorrectly caching USER commands. This was fixed automatically by fixing the first part.
2019-03-07 07:05:24 -08:00