-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multistage ONBUILD COPY Support #1190
Conversation
8e301b2
to
4134965
Compare
@dani29 the code flows looks good. |
pkg/executor/build.go
Outdated
@@ -52,6 +52,11 @@ import ( | |||
// This is the size of an empty tar in Go | |||
const emptyTarSize = 1024 | |||
|
|||
// for testing | |||
var ( | |||
InitializeConfig = initializeConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make this a local variable so only the tests in build
package can override this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, except 1 nit.
Also can you please mention, did you test this PR on the Dockerfile in #533
@JordanGoasdoue, I've had to manually fix conflicts since git wasn't able to digest the changes of both this PR and #1160. |
Done @dani29 , it's all good |
Thank you for making this fix. I’ve been playing around with Kaniko and ran into this issue today. And then I do a search and find that you fixed it 15 minutes ago. Serendipity! |
I tried the latest releases of the image. It fixed the issue that I was seeing with multi-stage ONBUILD. Thanks! |
Fixes #533.
Description
ONBUILD did not work correctly, because the
resolveOnBuild()
method occurred after theresolveStages()
method was called, so commands likeCOPY --from=builder
were not properly replaced with--from=0
. Moreover, because theCalculateDependency()
method were unaware of these dependencies, files copied onbuild weren't even registered to be kept beyond the stage they were used it.I had to break down
dockerfile.Stages(opts)
, which was a huge method, into smaller chunks doing the following:afterwards, adding the following:
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Reviewer Notes
Release Notes
Describe any changes here so maintainer can include it in the release notes, or delete this block.