Commit Graph

34 Commits

Author SHA1 Message Date
Manish Giri 7bfc73c3ad
fix: Remove references to deprecated io/ioutil pkg (#2867)
* Update benchmark_test

* Updae tar.go

* Update further refs

* Commit next set of replacements

* Reverting changes in vendor folder

* Update integreation_with_context_test.go

* Update k8s_test.go

* Update remaining usages

* Replace conflicting usage of fs local variable
2023-11-28 13:02:53 -08:00
Kraev Sergei eea12bd025
Fix multistage caching with COPY --from (#2559)
* Removed block on use --cache-copy-layers with multistage builds
* Removed using digest in composite key with command COPY --from
* COPY --from command uses src as file context (only changed files will be reason for change hash)
* ARG and ENV changed before COPY dont change composite key
* Add and fix some tests
* Caching work same as caching in docker buildx

Co-authored-by: Sergei Kraev <skraev@tradingview.com>
2023-06-16 10:56:05 -07:00
Aaron Prindle 0b53835c0f
fix: use debian buster to fix tests using no longer supported stretch which had broken apt-get urls (#2485) 2023-04-27 22:05:37 -04:00
Joe Kimmel 906cc96b59
Upgrade docker (#2440)
* somehow now the only thing that doesnt work is devices.Device

Signed-off-by: Joe Kimmel <jkimmel@vmware.com>

* this gets rid of all the compiler errors in the vendored code

Signed-off-by: Joe Kimmel <jkimmel@vmware.com>

* fixed some things but a bunch of tests and maybe some compiler steps are still failing

Signed-off-by: Joe Kimmel <jkimmel@vmware.com>

* all the things i figured out how to fix so far

Signed-off-by: Joe Kimmel <jkimmel@vmware.com>

* guess i had to redo go mods after rebasing again

Signed-off-by: Joe Kimmel <jkimmel@vmware.com>

* update docker constants to be SHOUTY CASE now

Signed-off-by: Joe Kimmel <jkimmel@vmware.com>

* include DestPath in resolveEnv

Signed-off-by: Joe Kimmel <jkimmel@vmware.com>

* fix one mistake in Docker lib upgrade and some typos/deprecations in the file

Signed-off-by: Joe Kimmel <jkimmel@vmware.com>

* last changes (hopefully) to update to new docker libs

Signed-off-by: Joe Kimmel <jkimmel@vmware.com>

---------

Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
2023-03-23 20:34:25 -04:00
dmr 239d16cd1c
feat: disable cache-copy-layers in multistage builds; closes 2065 (#2227) 2022-08-25 21:36:56 -04:00
François JACQUES f9c5745c63
Fixes #2046: make target stage lookup case insensitive (#2047) 2022-04-12 09:54:14 -04:00
Jason Hall 76624697df
Bump github.com/docker/docker to latest release (#1866)
* Bump github.com/docker/docker to latest release

* Pin deps to docker/docker's requirements

fix build breakages
fix unit test
Trying to see whether am-i-in-a-container checks are broken for integration tests...
2022-01-14 15:58:32 -05:00
Tejal Desai 2303e47aad
Merge pull request #1260 from ljakimczuk/master
Resolving nested meta ARGs
2020-06-04 13:24:34 -07:00
Tejal Desai 8a585829b8
Update pkg/dockerfile/dockerfile_test.go 2020-06-04 12:28:51 -07:00
Tejal Desai cbf3073fda rename whitelist to ignorelist 2020-06-02 15:56:27 -07:00
Lukasz Jakimczuk 3dcac1b906 Resolving nested meta ARGs against themselves and build ARGs 2020-05-09 01:23:02 +02:00
Jordan Goasdoué 8cbc7a8ca2 feat: multistages is now built without unusued stages 2020-04-17 09:59:56 +02:00
Dani Raznikov 8d6a75a745 merge conflict fixes 2020-04-15 16:10:45 +03:00
Dani Raznikov e8323441ab resolve conflict with PR #1160 2020-04-15 15:58:43 +03:00
Dani Raznikov f720c817c7 add unit tests 2020-04-12 20:17:40 +03:00
Dani Raznikov 70eb7ebcfa suport multistage onbuild 2020-04-10 18:30:25 +03:00
Jordan Goasdoué ed883b9015 feat: can now resolves args from stage 2020-03-27 18:42:46 +01:00
Ben Einaudi d22a7608c2 Fix failure when using capital letters in image alias in 'FROM ... AS' instruction
The third library moby/buildkit lowers the image alias used in 'FROM .. AS' instruction.
This change fixes this issue by making the resolve of dependencies agnostic to case.

Fixes #592
Fixes #770
2019-12-06 12:04:26 +01:00
Cole Wippern 006b4996cb Fix quote strip behavior for ARG values
* fixes issue 847
* previous implementation did not properly parse blank
values which were enclosed in quotes
2019-11-08 14:28:31 -08:00
Cole Wippern ec2e7705c8 Issue #439 add additional tests for quotes
Add additional tests to ensure that ARG values with quotes
are handled properly
2019-10-25 16:08:57 -07:00
Cole Wippern 79649a1614 Issue #439 double quotes in ARG value
* Strip out double quotes enclosing ARG value after parsing
dockerfile
2019-10-24 16:30:25 -07: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
Sharif Elgamal 224b7e2b41
parse arg commands at the top of dockerfiles (#404)
* parse arg commands at the top of dockerfiles

* fix pointer reference bug and remove debugging

* fixing tests

* account for meta args with no value

* don't take fs snapshot if / is the only changed path

* move metaArgs inside KanikoStage

* removing unused property

* check for any directory instead of just /

* remove unnecessary check
2018-11-06 15:27:09 -08:00
Priya Wadhwa ccb6259b06 More linting errors 2018-09-11 14:58:25 -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 5e5623e5a4 Fix bug in SaveStage function for multistage builds
This change should fix the bug in #294, where kaniko wasn't recognizing
that a stage would be used in a later build and so wasn't saving it as a
tarball.

Each stage of the Dockerfile has a Name and a BaseName (FROM BaseName as
Name), but if a Name isn't specified then it's set to the same value as
BaseName. Our test cases weren't complete enough to catch this
distinction, which is why this bug occurred.

I added more test cases to the unit tests to make sure this fix works.
2018-08-20 15:10:17 -07:00
priyawadhwa 954b6129d6
Extract intermediate stages to filesystem (#266)
* WIP

* save and extract stage tarballs if there are dependencies
2018-08-02 09:40:24 -07:00
Nick Kubala e45d1f6aac
Update deps 2018-07-31 16:23:23 -07:00
priyawadhwa cac00b9cb2
Add --target flag for multistage builds (#255)
* Add --target flag for multistage builds

* change validate to validateTarget
2018-07-30 09:43:23 -07:00
priyawadhwa eb6faa05a0
Save each stage in multistage dockerfiles as a tarball (#244)
* resolve basenames in dockerfile to fix multistage bug

* WIP

* WIP

* Save dockerfile stages as tarballs

* added unit tests

* fix unit tests
2018-07-19 11:27:49 -07:00
Priya Wadhwa 459ddffb3c
Updated tests 2018-05-11 16:19:33 -07:00
Priya Wadhwa 48688df7a6
Fixed merge conflicts, support multistage builds 2018-04-26 16:39:02 -07:00
Priya Wadhwa 904575d0cb
support multi stage builds 2018-04-26 15:40:41 -07:00
Priya Wadhwa 7dbc7a04a7
Support multi stage builds 2018-04-23 17:25:12 -07:00