-
Notifications
You must be signed in to change notification settings - Fork 7.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
Clarify when last-modified time is considered for caching #13702
Conversation
Before examining the contents of cached image file(s), the last-modified time of the file(s) is considered. The "basic rules" in the "Leverage build cache" section of the Dockerfile best practices guide are updated to make this explicit.
✔️ Deploy Preview for docsdocker ready! 🔨 Explore the source changes: 372b1ff 🔍 Inspect the deploy log: https://app.netlify.com/sites/docsdocker/deploys/616977f11b63af000787b040 😎 Browse the preview: https://deploy-preview-13702--docsdocker.netlify.app |
@usha-mandya Not sure if you are the right person to address this to, but I would like to know if there is anything I can do to help move this change along? I see there are some workflow actions requiring approval. Does it require any input at all from me? |
Ok I digged up a bit around that phrasing and the actual behavior in BuildKit vs the legacy builder. As we want to make BuildKit the default experience I'm good with this change but I think we could instead add an "info/warn block" under that paragraph about the current BuildKit caching behavior. We could also point to moby/buildkit#1058 to explain it could be handled when implemented at frontend level. |
Thanks for the pull request. We'd like to make our product docs better, but haven’t been able to review all the suggestions. If the updates are still relevant, review our contribution guidelines and rebase your pull request against the latest version of the docs, then mark it as fresh with a Prevent pull requests from auto-closing with a /lifecycle stale |
/remove-lifecycle stale |
This is an important piece of information and I would very much want to see this in the docs! cc: @rpygithub @crazy-max |
I think the current proposal is misunderstanding the behavior and the comment it links to. There are two completely separate topics: the build context upload from local directory to the daemon and then content-based cache checksumming for |
Proposed changes
This change updates the "Leverage build cache" section of the "Dockerfile best practices" to make it explicit that the last-modified time of image file(s) is considered first, before examining file content. Otherwise, the reader might form an impression that the last-modified time of file(s) is not considered and checksums are calculated in any case. See this comment on a BuildKit issue for an example where this caused confusion.