-
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
caching with COPY --from #1348
Comments
I can see a similar issue with kaniko 0.24.0 and 0.23.0. 0.18.0 seems to work as expected (but maybe it's just the case of it missing the cache more in general) |
@virth, theoretically, in case of the 2nd dockerfile,
Can you provide us with trace logs? |
We are encountering this problem now. Here is a sample Dockerfile:
Changing the value of /some_changing_file does not change the output of the I've attached trace logs indicating the problem below. See lines 47 for the some_changing_file to not be cached, and line 806 for using the cached version of the I think this is clearly a bug, since I'd be happy to attempt to solve this. |
We are experiencing the same problem as described above when building a Go project, which led us to deactivating the Our example:
Additionally we ran a script to create a version number within the build for every new image. The ouput of this script showed that a new version was indeed created and saved into a file, but when loading it in the second stage suddenly the first ever cached version was used, matching the experience of the devs posting above me. This was tested with the latest executor version (1.6.0). |
Still happening? Is there going to be a fix for this? |
Hi all! I recently ran into this issue. It seems this was fixed in #1735 and then regressed. I downgraded my kaniko from 1.8 => 1.7 and it seemed to work for me. |
I believe this has been fixed with #2559. I attempted the repro here: with caching enabled and was seeing my changes represented in each created image, ex:
|
If anyone in the thread here can confirm this has been fixed w/ Kaniko |
I'm experiencing what I think is the same issue with I'm building two images within, one after the other with the following command (repeated twice with different PROJ, TARGET and TAG): /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/packages/${PROJ}/Dockerfile"
--target "$TARGET"
--destination "${TAG}" Both Dockerfiles are very similar, and have a FROM base AS prune
WORKDIR /app
COPY . .
RUN pnpm dlx turbo prune --scope=@rico-technologies/${PROJ} --docker The second build is using the first Also, note that this is WITHOUT any cache flags enabled! |
Actual behavior
Kaniko uses a the cached version of a
COPY --from
command although the copied source has changes in it and shouldn't be cached.Disclaimer: I'm not entirely sure if this is a bug or if the "correct" caching of a
COPY --from ...
command is simply a feature that's not supported yet.In a first step we build a "base" docker image with all our dependencies that gets pushed to GCR so we can use this image for multiple steps later. When we pull the previously built image as the base for our next step, we copy the content of the base image into another stage uf the multistage docker build. Kaniko detects that there is a cached Layer for this and uses this instead of the actual new, changed source.
Expected behavior
A clear and concise description of what you expected to happen.
To Reproduce
Steps to reproduce the behavior:
--cache
for all your builds.COPY --from base ./app .
to copy the content of the first image.COPY --from base ./app .
altough there were changesAdditional Information
Triage Notes for the Maintainers
--cache
flagPlease let me know if you need anything else !
The text was updated successfully, but these errors were encountered: