Skip to content
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

Extract intermediate stages to filesystem #266

Merged
merged 3 commits into from
Aug 2, 2018

Conversation

priyawadhwa
Copy link
Collaborator

Right now, when hitting the end of an intermediary stage kaniko will go through all future stages to gather dependencies on the current stage. It saves these dependencies in the /kaniko/buildcontexts directory to use during later builds.

This bug occurred because one of the future stages depended on a stage that hadn't been built yet, so the tarball for that stage didn't exist yet.

For example:

FROM xxx as first
RUN xxx

FROM xxx as second
RUN xxx

FROM second
COPY --from=first x x

would break because after building stage 0, kaniko would try to get the dependencies for stage 2 but the second stage image doesn't exist yet.

I removed getting dependencies ahead of time altogether and instead save the stage tarball and extract it to fs if there are any references to it later in the Dockerfile.

Should fix #233

@priyawadhwa priyawadhwa merged commit 954b612 into GoogleContainerTools:master Aug 2, 2018
@priyawadhwa priyawadhwa deleted the bug branch August 2, 2018 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

multi-stage error when referencing earlier stage
2 participants