Skip to content
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

Add example that shows the stated "default" settings in json #21596

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion content/manuals/build/cache/garbage-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
the garbage collection will use a different configuration file.

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).
can be configured in the [Docker Daemon configuration](/reference/cli/dockerd.md#daemon-configuration-file)
file:

```json
Expand Down Expand Up @@ -94,3 +94,40 @@
>
> `Keep Bytes` defaults to 10% of the size of the disk. If the disk size cannot
> be determined, it uses 2GB as a fallback.

The policies above can be represented in the [Docker Daemon configuration](/reference/cli/dockerd.md#daemon-configuration-file) file with the following json:

Check warning on line 98 in content/manuals/build/cache/garbage-collection.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Docker.RecommendedWords] Consider using 'previous' instead of 'above' Raw Output: {"message": "[Docker.RecommendedWords] Consider using 'previous' instead of 'above'", "location": {"path": "content/manuals/build/cache/garbage-collection.md", "range": {"start": {"line": 98, "column": 14}}}, "severity": "INFO"}

Check failure on line 98 in content/manuals/build/cache/garbage-collection.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'json'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'json'?", "location": {"path": "content/manuals/build/cache/garbage-collection.md", "range": {"start": {"line": 98, "column": 153}}}, "severity": "ERROR"}

```json
{
"builder": {
"gc": {
"enabled": true,
"policy": [
{
"filter": [
"unused-for=48h",
"type=source.local,type==exec.cachemount,type==source.git.checkout"
],
"keepStorage": "512MB"
},
{
"filter": [
"unused-for=1440h"
],
"keepStorage": "26GB"
},
{
"all": true,
"keepStorage": "26GB"
},
{
"keepStorage": "26GB"
}
]
}
}
}
```
> [!NOTE]
> https://github.com/moby/buildkit/issues/5581 is currently opening asking why the second and third `type`
> in the filter requires two ='s.