Repository navigation
Conversation
crazy-max
force-pushed
the
memorable-builder-names
branch
from
October 22, 2026 12:16
ea51ff6 to
c42bb43
Compare
crazy-max
requested review from
jsternberg,
thaJeztah,
tonistiigi and
vvoland
October 23, 2026 09:06
crazy-max
marked this pull request as ready for review
October 23, 2026 09:07
thaJeztah
reviewed
Oct 23, 2026
|
|
||
| "github.com/docker/docker/pkg/namesgenerator" | ||
| "github.com/pkg/errors" | ||
| "github.com/splode/fname" |
Member
There was a problem hiding this comment.
do we really need a new dependency for this? Old code was ... 10 lines or so?
Member
Author
There was a problem hiding this comment.
Yes the generation logic is small, agreed. What I'd like to avoid is maintaining another generator and its word lists ourselves, which was also a concern raised in #3354. That's why I went with a standalone external module rather than copying the implementation into Buildx. I'm not particularly attached to fname though, so if you have another lightweight module in mind, I'm open to it.
Member
Author
There was a problem hiding this comment.
I've switched this to golang-petname. It's smaller, has no external dependencies, and is already used by big projects like Terraform's random provider.
Replace the legacy Docker namesgenerator with golang-petname so builder naming no longer requires the github.com/docker/docker module. Generate two-word adjective and animal names while preserving underscore separation and six attempts to find an unused name in the local store. Use a standalone generator with no external dependencies instead of maintaining Buildx-specific word lists. Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
crazy-max
force-pushed
the
memorable-builder-names
branch
from
October 23, 2026 09:52
c42bb43 to
9734b78
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This removes the remaining
github.com/docker/dockerdependency by replacing itspkg/namesgeneratorpackage with golang-petname. Buildx has already migrated its client and API dependencies to the Moby modules, but generating random builder names still keeps the deprecated Docker module in its dependency graph and those of downstream consumers. The daemon CVEs reported in #3792 do not affect the naming code Buildx imports, as explained in #3792 (comment). This is dependency cleanup rather than a fix for a demonstrated Buildx vulnerability.The change preserves memorable, two-word names and the existing underscore separator, using adjectives and animal-oriented names instead of notable people's surnames. Existing builders and explicitly supplied names are unaffected, and generation still makes up to six attempts to find an unused name in the local store. This retains names that are convenient to recognize, remember, and type without maintaining Buildx-specific word lists as proposed in #3354 or switching to opaque identifiers as proposed in #3813.
The generation logic itself is small. The reason for using an external module is to avoid taking ownership of another generator and its vocabulary, which was also a concern raised in #3354 (comment). Petname provides a small API and implementation, supports the existing separator directly, and has no external module dependencies. The selected word lists contain only lowercase ASCII letters, so generated names need no additional sanitization.
I compared several standalone Go generators and initially implemented fname. Its broader vocabulary provides more combinations, but I ultimately preferred petname's smaller implementation, dependency-free module, and established use in projects such as Terraform's random provider, LXD and PhotoPrism.
The pinned petname version provides 448 adjectives and 448 names, giving 200,704 two-word combinations. That compares with 25,487 initial combinations in the legacy Docker generator, excluding its numeric retry suffixes. This increases the initial name space without adding a third word or a mandatory numeric suffix.
Petname could also be evaluated independently by Moby as an optional name-generator extension alongside the discussion in moby/moby#52097. That would allow reuse of the same standalone library without duplicating word lists, but this PR does not depend on Moby adopting it or changing its default naming scheme.
AI-assisted with Codex for researching name-generator alternatives, implementing the change, and running validation. Claude Code provided an independent review.