Skip to content

Commit cf70580

Browse files
authored
Add example that shows the stated "default" settings in json
(also fix an errant . )
1 parent f4891a8 commit cf70580

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

content/manuals/build/cache/garbage-collection.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Depending on the [driver](../builders/drivers/_index.md) used by your builder in
2626
the garbage collection will use a different configuration file.
2727

2828
If you're using the [`docker` driver](../builders/drivers/docker.md), garbage collection
29-
can be configured in the [Docker Daemon configuration](/reference/cli/dockerd.md#daemon-configuration-file).
29+
can be configured in the [Docker Daemon configuration](/reference/cli/dockerd.md#daemon-configuration-file)
3030
file:
3131

3232
```json
@@ -94,3 +94,37 @@ GC Policy rule#3:
9494
>
9595
> `Keep Bytes` defaults to 10% of the size of the disk. If the disk size cannot
9696
> be determined, it uses 2GB as a fallback.
97+
98+
The policies above can be represented in the [Docker Daemon configuration](/reference/cli/dockerd.md#daemon-configuration-file) file with the following json:
99+
100+
```
101+
{
102+
"builder": {
103+
"gc": {
104+
"enabled": true,
105+
"policy": [
106+
{
107+
"filter": [
108+
"unused-for=48h",
109+
"type=source.local,type=exec.cachemount,type=source.git.checkout"
110+
],
111+
"keepStorage": "512MB"
112+
},
113+
{
114+
"filter": [
115+
"unused-for=1440h"
116+
],
117+
"keepStorage": "26GB"
118+
},
119+
{
120+
"all": true,
121+
"keepStorage": "26GB"
122+
},
123+
{
124+
"keepStorage": "26GB"
125+
}
126+
]
127+
}
128+
}
129+
}
130+
```

0 commit comments

Comments
 (0)