-
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 Dockerfile with copy and glob uses cached layer when it shouldn't #589
Comments
seeing this issue as well |
We're actually seeing this behaviour as well without any globbing. Simply copying a file from a base image to another image makes it use an old cached layer. I'll attach the interesting part of our logs. Specifically the file Also worth noting that I'm running the DEBUG container on Google Conainer Builder. The debug is a workaround for not being able to set the USER properly otherwise.
|
We are seeing this issue as well. 🙈 Does anyone of you have a "workaround" or solved the problem? ⛑ |
My workaround is to not use --cache :( |
We have seen this too. Any updates? |
We too, any update for this? |
Seeing this issue too unfortunately. |
this completely breaks caching for multi-stage docker files. since we are pushing distroless so hard, this sucks. please fix <3 [edit] As noted by previous comments, globbing or not has no effect. Any copying of source code in previous stages will be cached and ignored. |
@afirth we've got some PRs in review that will hopefully fix this. Fingers crossed for getting this fixed in the next week or two |
This should be fixed as of master@a675098 Closing, but please reopen if it is not resolved |
@cvgw I tried with |
This bug seems to be fixed at least with kaniko v.1.3.0, but since v.1.5.0 this bug has appeared again, as I can reproduce the steps of the bug creator with version 1.5.0 and upwards, but not with v1.3.0 . I reproduced the bug slightly different with following Dockerfile:
Since v.1.5.0 the RUN command from the second stage always uses the cache, regardless of the content of version.txt . |
@cbartz You might need to open a new bug, not sure if they're looking at the old issues. |
We just ran into this with v1.6.0 as well and rolling back to v1.3.0 fixes it. In our case, we were building the "backstage.io" project. |
Actual behavior
When using multistage builds and with copy and globs, later layers that rely on the globbed files erroneously use the cache, leading to the wrong files being referenced in the final image.
Expected behavior
Should not use the cache for the later layer since the files in the previous layer have changed.
To Reproduce
Steps to reproduce the behavior:
See https://github.com/pselden/kaniko-cache-bug for full repro steps.
ls
in the container and observe that the symlink is still pointing tofile-1.txt
even thoughfile-2.txt
is in the filesystem.Additional Information
A versions.txt file with the following contents:
Note: this bug doesn't happen if I were to use a build arg for version instead of reading from a file.
The text was updated successfully, but these errors were encountered: