You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/manuals/build/cache/garbage-collection.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ The default GC policies are (approximately):
57
57
been used for more than 48 hours.
58
58
2. Remove cache that hasn't been used in a build for more than 60 days.
59
59
3. Remove unshared cache that exceeds the build cache size limit. Unshared
60
-
cache records refers to layer blobs that are not used by other resources
60
+
cache records refer to layer blobs that are not used by other resources
61
61
(typically, as image layers).
62
62
4. Remove any build cache that exceeds the build cache size limit.
63
63
@@ -69,7 +69,7 @@ depending on what kind of builder you're using. Refer to
69
69
70
70
> [!NOTE]
71
71
> If you're satisfied with the default garbage collection behavior and don't
72
-
> need to fine-tune its settings, you can skip this section. Default
72
+
> need to fine-tune its settings, you can skip this section. The default
73
73
> configurations work well for most use cases and require no additional setup.
74
74
75
75
Depending on the type of [build driver](../builders/drivers/_index.md) you use,
@@ -137,16 +137,16 @@ default GC policies resolve to:
137
137
The easiest way to tweak the build cache configuration for the `docker` driver
138
138
is to adjust the `defaultKeepStorage` option:
139
139
140
-
- Increase the limit if you feel like you think the GC is too aggressive.
140
+
- Increase the limit if you feel like the GC is too aggressive.
141
141
- Decrease the limit if you need to preserve space.
142
142
143
143
If you need even more control, you can define your own GC policies directly.
144
144
The following example defines a more conservative GC configuration with the
145
145
following policies:
146
146
147
-
1. Remove unused cache entries older than 1440 hours, or 60 days, if build cache exceeds 50GB.
148
-
2. Remove unshared cache entries if build cache exceeds 50GB.
149
-
3. Remove any cache entries if build cache exceeds 100GB.
147
+
1. Remove unused cache entries older than 1440 hours, or 60 days, if the build cache exceeds 50GB.
148
+
2. Remove unshared cache entries if the build cache exceeds 50GB.
149
+
3. Remove any cache entries if the build cache exceeds 100GB.
150
150
151
151
```json
152
152
{
@@ -180,7 +180,7 @@ tweak the thresholds for how much disk space BuildKit should use for cache:
180
180
|`maxUsedSpace`| The maximum amount of disk space that BuildKit is allowed to use. Usage above this threshold will be reclaimed during garbage collection. | 60% of total disk space or 100GB (whichever is lower) |
181
181
|`minFreeSpace`| The amount of disk space that must be kept free. | 20GB |
182
182
183
-
You can set these options either as number of bytes, a unit string (for
183
+
You can set these options either as a number of bytes, a unit string (for
184
184
example, `512MB`), or as a percentage of the total disk size. Changing these
185
185
options influences the default GC policies used by the BuildKit worker. With
186
186
the default thresholds, the GC policies resolve as follows:
@@ -245,14 +245,14 @@ policy is allowed to prune.
245
245
246
246
#### Custom GC policies in BuildKit
247
247
248
-
Custom GC policies let you fine-tune how BuildKit manages its cache, and gives
248
+
Custom GC policies let you fine-tune how BuildKit manages its cache, and give
249
249
you full control over cache retention based on criteria such as cache type,
250
250
duration, or disk space thresholds. If you need full control over the cache
251
251
thresholds and how cache records should be prioritized, defining custom GC
252
252
policies is the way to go.
253
253
254
254
To define a custom GC policy, use the `[[worker.oci.gcpolicy]]` configuration
255
-
block in `buildkitd.toml`. Each policy define the thresholds that will be used
255
+
block in `buildkitd.toml`. Each policy defines the thresholds that will be used
256
256
for that policy. The global values for `reservedSpace`, `maxUsedSpace`, and
257
257
`minFreeSpace` do not apply if you use custom policies.
258
258
@@ -280,7 +280,7 @@ Here’s an example configuration:
280
280
maxUsedSpace = "90GB"
281
281
```
282
282
283
-
In addition to the `reservedSpace`, `maxUsedSpace`, and `minFreeSpace`threshold,
283
+
In addition to the `reservedSpace`, `maxUsedSpace`, and `minFreeSpace`thresholds,
284
284
when defining a GC policy you have two additional configuration options:
285
285
286
286
-`all`: By default, BuildKit will exclude some cache records from being pruned
0 commit comments