-
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
Second multistage build in same container fails because cross stage deps are not cleaned up #1217
Comments
With v0.17.1 it works. With v0.19.0 it's broken. |
I verified this on latest master and this is no longer an issue. Looks like #1214 fixed it.
Here is the full log
|
Resolved by #1225 |
I can still reproduce this with v0.20.0. I eventually managed to make the test case much simpler: FROM alpine:3.9 AS builder
RUN mkdir -p /opt/foo/bar
RUN touch /opt/foo/bar/a
RUN ln -s a /opt/foo/bar/s
FROM alpine:3.9
COPY --from=builder /opt/foo/bar /opt/baz/ And here is the full log: The error is:
|
I have updated the repro repo to kaniko v1.6.0 and the issue persists. |
v1.9.1-debug, issue still there |
I have the same issue with 1.9.1 |
Dupe of #1406, if you are encountering this issue or want to continue the discussion please do so there thanks! |
I'm using kaniko with GitLab CI to build several images in one go. While this might not be the recommended way to run kaniko, it is something that many people do. When using GitLab CI we use the kaniko debug image and use the builtin shell to run a script. The script contains two (in this example identical)
executor
runs:The problem is that the second build fails because there are still files in
/kaniko/0
from the first build.Here is a Dockerfile that reproduces the issue. It's slightly less simple than I'd hoped for because the issue only surfaces when there are certain symlinks among the cross-stage dependencies.
Here is the full log output of both builds as well as directory listings of
/kaniko
. I believe the relevant parts are:The end of the first (working) build:
The directory listing after this build:
A closer look at the contents of
/kaniko/0/opt/mozjpeg/lib64
:And then the end of the second (identical, but failing) build:
Obviously the expected result would be that the second build finishes without errors. I would expect either
--cleanup
to clean up those saved dependencies or I would expect the "Saving file ... for later use" step to overwrite the files from the previous build.Triage Notes for the Maintainers
--cache
flagThe text was updated successfully, but these errors were encountered: