-
Notifications
You must be signed in to change notification settings - Fork 8.1k
build: update gc documentation #21617
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
Conversation
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
| If you're using the [`docker` driver](../builders/drivers/docker.md), garbage collection | ||
| can be configured in the [Docker Daemon configuration](/reference/cli/dockerd.md#daemon-configuration-file). | ||
| file: | ||
| 1. Remove ephemeral, unused build cache older than 48 hours if it exceeds 10% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙃
| 1. Remove ephemeral, unused build cache older than 48 hours if it exceeds 10% | |
| 1. Remove ephemeral, unused build cache older than 48 hours if it exceeds 13.8% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should align moby with buildkit, doesn't make sense to have a different default GC policy. Moby could probably just call https://github.com/moby/buildkit/blob/f2092259de4a7fbdb05c84b1c8791c9a3ca578c4/cmd/buildkitd/config/gcpolicy.go#L71 and remove https://github.com/moby/moby/blob/d60e55d613a35a11d59310a1ec16eb06f2133eb1/builder/builder-next/worker/gc.go#L18
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// tempCachePercent represents the percentage ratio of the cache size in bytes to temporarily keep for a short period of time (couple of days)
// over the total cache size in bytes. Because there is no perfect value, a mathematically pleasing one was chosen.
// The value is approximately 13.8
const tempCachePercent = math.E * math.Pi * math.Philol
| } | ||
| ``` | ||
|
|
||
| The `defaultKeepStorage` option configures the size limit of the build cache, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From BuildKit v0.17 and moby/moby#48720 these defaults are different with reserved,free,max all being configured by default.
2911e0b to
87a4be8
Compare
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
87a4be8 to
841ca61
Compare
Revise the documentation for build GC and configuring GC policies.
Also updates the configuration to describe the new GC config options.
Preview: https://deploy-preview-21617--docsdocker.netlify.app/build/cache/garbage-collection/
Related issues