Skip to content

Conversation

@dvdksn
Copy link
Contributor

@dvdksn dvdksn commented Oct 27, 2025

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:

  • The filter field in daemon.json uses a single = to assign filters, whereas builder uses ==, for example: type==source.git.checkout
  • The size values in daemon.json are 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)

Screenshot 2025-10-27 at 14 43 05

@dvdksn dvdksn requested review from a team and thaJeztah as code owners October 27, 2025 13:47
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@thaJeztah
Copy link
Member

@crazy-max was this one good to go, or changes needed?

"gc": {
"enabled": true,
"defaultKeepStorage": "10GB",
"reservedSpace": "10GB",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

afaics this is called defaultReservedSpace

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The struct doesn't set an explicit JSON name; does that mean it's technically with a capital D? Is that something we should change in moby to be explicit if we want it to be lowercase?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parsing is case-insensitive

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parsing is case-insensitive

Yes, and no; the default is to do fuzzy matching, and Go will pick the best match, but in a struct like this, case matters;

type Foo struct {
	Hello string
	HELLO string `json:"hello"`
}

If no name is given, the default name used when marshaling is CamelCase, so without explicitly specifying the JSON label, it means that it would be fune unmarshaling defaultReservedSpace, but when marshaling, it would use DefaultReservedSpace, which could happen if the daemon would either print its config, or write it to disk.

JSON-schema also isn't case-insensitive, so if we'd wanted to provide a schema for these files, we should be explicit, and same for Go's JSON "v2" that's currently being worked on; https://go.dev/blog/jsonv2-exp

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
@dvdksn dvdksn force-pushed the doc-daemon-buildc-example branch from f26ef87 to e0d30db Compare November 27, 2025 15:24
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah merged commit 8fc15ea into docker:master Nov 27, 2025
106 of 107 checks passed
@dvdksn dvdksn deleted the doc-daemon-buildc-example branch November 27, 2025 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants