-
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
Multi-stage builds execute CI in the last stage context instead of reverting to the job image. #3325
Comments
Upvote for this report since I'm facing a very similar issue. |
could you be looking for the https://github.com/GoogleContainerTools/kaniko#flag---cleanup |
Just tried that and it doesn't help |
I have a similar problem. I observed that when using kaniko to build multiple levels, After executing COPY --from=, execute ADD . . |
Use kaniko to package, put the code in /kaniko/{code_dir} and kaniko/executor --context dir:///kaniko/{code_dir} .... This can be executed normally. But I don't know why it can't be placed in other directories |
Actual behavior
When executing a multi-stage build (particularly evident when the last stage is
FROM scratch
) after theexecutor
finishes, the rest of the script in the CI job maintains the context of the built image instead of reverting back to the context of the image defined at the job level. This causes unexpected errors when trying to do any parsing or log aggregation after running the exeuctor.Expected behavior
Expected behavior is after the executor completes, the shell would return to the context of the image specified in the CI job.
To Reproduce
Steps to reproduce the behavior:
FROM scratch
kaniko:1.23.2
where the executor is ran.kaniko:1.23.2
, but not in the final stage of the Dockerfile (for example:sed
). The command will fail with "sed
not found".Additional Information
Triage Notes for the Maintainers
--cache
flagThe text was updated successfully, but these errors were encountered: