-
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
Disable cache after first miss #880
Disable cache after first miss #880
Conversation
d629777
to
f76ef8d
Compare
Not quite sure if this is what its doing already - but i guess ideally the cache will be disabled from the point where the previous stage is included. FROM a as a
RUN break-the-cache
FROM b as b
RUN something <-- this will still be cached
COPY --from a a/file <--here the cache is disabled |
Also is this much the same as #853 ? |
@mcfedr unfortunately that is not the outcome this PR would produce (though I think what you are suggesting may be the ideal behavior). This PR would result in the following behavior FROM a as a
RUN break-the-cache
FROM b as b <--here the cache is disabled
RUN something
COPY --from a a/file Without computing a full dependency tree or having behavior specific to Open to other thoughts As a side note I'm not sure I will be submitting this PR as I have an idea for what I think is a better implementation. |
Somewhat surprised that Kaniko doesn't have a dependency DAG internally. |
Doesn't everything else defeat the purpose of multi-stage Dockerfiles? At least for us it is to a certain degree as bad as disabling caching completely. |
In your opinion is it preferable to leave caching broken (as it currently is) until a true dependency tree is implemented vs making an incremental fix that would prevent stale data from being retrieved from the cache though not producing ideal caching behavior? |
Not arguing against that. |
Thank you @abergmeier . I appreciate that feedback and I will share it with the rest of the team to help prioritize work. |
Going in a different direction to fix this one |
broken caching is clearly worse - but no caching isnt good, anyway it looks like you already found a better fix in #883 |
Fixes #870
Description
Disable the cache after the first miss as following layers may depend on it. Kaniko already did this within a single stage, but not across stages.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Reviewer Notes
Release Notes
Describe any changes here so maintainer can include it in the release notes, or delete this block.