Commit Graph

41 Commits

Author SHA1 Message Date
Tejal Desai a17ad8e8e8
Merge pull request #882 from cvgw/u/cvgw/reuse-cached-layer
Do not recompute layers retrieved from cache
2020-02-07 13:37:39 -08:00
Tejal Desai 56125ff464 Rebase from master with some changes 2020-02-03 14:57:10 -08:00
xanonid e3b5a7b85d Support COPY --chown flag (Closes: #9) 2020-02-03 14:56:23 -08:00
Cole Wippern cd9be5d513 reuse cached layer 2020-01-23 16:48:26 -08:00
Tejal Desai 048de00c33 Fix home and group set for user command 2020-01-23 15:07:15 -08:00
Cole Wippern 876f24b0c9 update caching run and copy extracted files
Update caching run and copy commands to use the new
GetFSFromLayers method and include the whiteout option so that
whiteout files are extracted and included in extractedFiles
2020-01-17 14:19:58 -08:00
Cole Wippern 2aa481c15e add unit tests for caching run and copy 2019-12-10 09:29:10 -08:00
Tejal Desai b04d15db82 fix the issue now 2019-11-07 15:29:56 -08:00
Tejal Desai f36dd4013c only add tests 2019-11-07 15:17:25 -08:00
Tejal Desai b29431227a fix tests for default home 2019-11-07 15:07:50 -08:00
Don McCasland dbabcb1f5f
Adding CachingCopy command 2019-09-26 15:32:40 -07: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
dlorenc 063663e17b
Skip unpacking the base FS if there are no run commands (or only cached ones). (#440)
This is the final part of an optimization that I've been refactoring towards for awhile.
If the Dockerfile consists of no RUN commands, or cached RUN commands, followed by metadata-only
operations, we can skip downloading and unpacking the base image.
2018-11-12 12:51:45 -06:00
dlorenc 58b607b4d0
Fix caching for multi-step builds. (#441)
This change fixes that by properly "replaying" the Dockerfile and mutating the config when
calculating cache keys. Previously we were looking at the wrong cache key for each command
when there was more than one.
2018-11-09 12:28:18 -06:00
dlorenc 52a6ce6685
More cache cleanups: (#397)
- move the layer cache to an interface
- refactor the DockerCommand implementations to support Cached and non-cached implementations.
2018-11-01 09:11:21 -07:00
peter-evans 49b2fa5199 Set root user to default home 2018-10-18 17:59:07 +09:00
dlorenc 734ffe65ce
Rework cache key generation a bit. (#375)
* Rework cache key generation a bit.

Cache keys are now based on the previous commands, rather than the previous state
of the filesystem.

* Refactor command interface a bit, only cache the context for commands that use it.
2018-10-03 16:16:12 -05:00
Sharif Elgamal 49184c2114 set default HOME env properly (#341)
* set default HOME env properly

* set HOME to / if user is set by uid

* fix test

* continue to skip user_run test

* fix unit test to match new functionality
2018-09-27 07:31:51 -07:00
Priya Wadhwa 4f3ab61b96 Add CacheCommand to DockerCommand interface
CacheCommand returns true if the command should be cached. Currently,
it's only true for RUN but can be added to ADD/COPY later on (these are
different since the contents of files for ADD/COPY need to be included
in the cache key generation).

I also changed CreatedBy to String so that we can log each command
before cache extraction or regular execution takes place.
2018-09-04 13:16:05 -07:00
priyawadhwa 4e77fa000d
Set default home value (#281)
* Set default home value

* Apply  default home value based on user for run commands

* rename default home function
2018-08-10 12:58:07 -07:00
Dale Tristram 2261adca68 Ensure cmd.SysProcAttr is set before modifying it (#275) 2018-08-07 10:09:49 -07:00
dlorenc 8a2492d241
Fix process group handling. (#271)
Also add a makefile target to build the debug image.
2018-08-01 16:47:32 -07:00
Nick Kubala e45d1f6aac
Update deps 2018-07-31 16:23:23 -07:00
balopat 6fe9ea4248 fixes #247 killing grandchildren processes 2018-07-26 13:56:19 -07:00
Jon Johnson 8b0a1a7689 dep update go-containerregistry 2018-06-03 00:59:34 +00:00
Sharif Elgamal 5e6b60f46e
adding metadata tests back to integration tests (#185)
* adding metadata tests back to integration tests and fixing resulting bugs

* fix onbuild and default env

* removing old test files

* adding the ArgsEscaped boolean on CMD commands

* fix onbuild test

* ignore failing test until container-diff is fixed

* code comments

* adding todo to remove uncomment failing test
2018-05-24 11:28:32 -07:00
Maximilian Schrupp b6cb74b2be include stderr of RUN commands in log output (#187) 2018-05-17 07:47:59 -07:00
Priya Wadhwa 282f8abbee
Merge master, refactor to work with ARG 2018-05-11 15:53:11 -07:00
Priya Wadhwa 4de14c34dd
Wrap BuildArgs in our own type 2018-05-11 10:23:13 -07:00
Priya Wadhwa 26d8501489
Support BuildArgs for arg command 2018-05-09 12:24:38 -07:00
Christian Jantz 5af3645a83 added shell command (#158)
* added shell command input to commands prepending shell

* Added shell command and test
2018-04-30 10:59:10 -07:00
dlorenc cd5b744904
Switch from containers/image to go-containerregistry (#140)
* Vendor changes for go-containerregistry switch.

* Manual changes for go-containerregistry switch.

The biggest change is refactoring the tarball unpacking.

* Pull more of container-diff out.

* More vendor removals.

* More unit tests.
2018-04-25 19:21:05 -07:00
Cyrille Hemidy 44a97ae53f
Update run.go
fix comment
2018-04-17 10:52:35 +02:00
dlorenc 0438539cbc
Set env at command run time instead of in the process. (#91) 2018-04-15 18:05:21 -07:00
sharifelgamal 7ebc313974 Merge branch 'master' of github.com:GoogleCloudPlatform/k8s-container-builder into user-cmd 2018-03-30 13:43:56 -07:00
sharifelgamal bc78e2b838 adding USER command 2018-03-29 11:53:31 -07:00
Priya Wadhwa 0787a93372
Workdir command and unit tests 2018-03-26 11:37:50 -07:00
Priya Wadhwa 27b09f28be
Add config as point to ExecuteCommand, fix snapshots 2018-03-09 11:30:35 -08:00
Priya Wadhwa 75e7e47b76
Added integration test, minor changes to files 2018-03-08 11:49:56 -08:00
Priya Wadhwa 04cca43ce4
Merged master and fixed merge conflicts 2018-03-08 10:18:04 -08:00
Priya Wadhwa cefb4448b1
Integration tests for run cmd 2018-03-07 15:34:56 -08:00