-
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
Cached layers duplicated some of the time #1138
Comments
Thanks @raijinsetsu I was able to reproduce this issue like this
I ran the I observed the cache layer corresponding to
The cached layer "gcr.io/tejal-test/test-cache-latest/cache:a6a737350f9f5578e3aa5c0fd024252a79a1f9ece9bd7272f9bb057a94ba3200" doubled in size (206 MB) and hence the image size doubled. I verified this on master and looks like the bug got fixed.
If you see the logs mentioned
creating the corresponding cache layer for "gcr.io/tejal-test/test-cache-edge/cache:ba4c47cafb2974c0220e883c181f93ba7e95c39f0f15515c071b056e934f2bd1" of size 35M |
I am going to keep this open with pending verification after |
I've switched my builds over to 0.19.0. I'll let you know how it goes. |
I have confirmed that 0.19.0 has corrected the issue for me. Thanks! |
Thanks a lot @raijinsetsu for confirming! |
Actual behavior
I noticed that my image size jumped from 1.1GB to over 2GB overnight. After reviewing the images, it looks like the new image has two versions of some of the layers. Most notably: there is a layer that is the entirety of the node_modules folder, which is ~900MB, for this large mono-repository and there appear to be two different versions of that layer in the new image as I can see docker download two >900MB layers. All other layers are 100KB or less, which makes this 900MB really stand out.
Clearing the cache corrects the issue and subsequent builds shrink in size.
Expected behavior
We expect the layers to only be included once.
To Reproduce
It is unclear how to reproduce this outside our repository.
Additional Information
Note that our Dockerfile is made from an EJS template.
Too many files to list...
gcr.io/kaniko-project/executor:v0.18.0
digest: sha256:2b54a743d46b5c4eff5772c68177958c6876bdf77b31bcda5a6af376b6c31428
Triage Notes for the Maintainers
--cache
flagThe text was updated successfully, but these errors were encountered: