-
Couldn't load subscription status.
- Fork 2.1k
docs: update buildgc example config to use new buildkit v0.17 options #6579
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
| { "maxUsedSpace": "512MB", "keepDuration": "48h", "filter": [ "type=source.local" ] }, | ||
| { "reservedSpace": "10GB", "maxUsedSpace": "100GB", "keepDuration": "1440h" }, | ||
| { "reservedSpace": "50GB", "minFreeSpace": "20GB", "maxUsedSpace": "200GB", "all": true } | ||
| ] |
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.
Perhaps @crazy-max or @jsternberg can help review 😅
These options always confuse me (e.g. in this case maxUsedSpace being 512MB, but other options having a larger size).
The filter field in daemon.json uses a single
=to assign filters, whereas builder uses==, for example:type==source.git.checkout
Is that something that should be aligned? I also recall the "single filter allowed" part on the daemon, and was confused by that (i.e., the daemon disallows multiple filters, but I couldn't find why it added that restriction); moby/moby#46864
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.
I think alignment would be great. I see no reason that the formats should be separate. Also for the size values.
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.
Was looking at related PR on moby moby/moby#48720 and your changes look good to me.
We should also update https://docs.docker.com/build/cache/garbage-collection/#docker-daemon-configuration-file and on this page we show filters with == in some cases:
{
"builder": {
"gc": {
"enabled": true,
"policy": [
{
"keepStorage": "2.764GB",
"filter": [
"unused-for=48h",
"type==source.local,type==exec.cachemount,type==source.git.checkout"
]
},
{ "keepStorage": "20GB", "filter": ["unused-for=1440h"] },
{ "keepStorage": "20GB" },
{ "keepStorage": "20GB", "all": true }
]
}
}
}I recall I made some changes in our buildx docs for the available filters: docker/buildx#3392. We define the operators = for equality, != for not equal and ~= for a regular expression.
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.
Yeah I will update there to use the new properties and correct delimiter as well 👍🏻
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.
Really nice filter addition to the docs btw ❤️
Signed-off-by: David Karlsson 35727626+dvdksn@users.noreply.github.com
- What I did
Updated the example builder gc config in the dockerd reference to use the new
options introduced in buildkit v0.17.
- How I did it
Tested manually
A couple small inconsistencies I noticed when doing this:
filterfield indaemon.jsonuses a single=to assign filters, whereas builder uses==, for example:type==source.git.checkoutdaemon.jsonare human-readable bytes. But BuildKit also allows percentage values. Attempting to set eg"minFreeSpace": "20%"results in config parse error.- A picture of a cute animal (not mandatory but encouraged)