Skip to content

cli-plugins: add build-time system plugin directory - #7339

Open
HeroCC wants to merge 2 commits into
docker:masterfrom
HeroCC:extra-cli-search-dir
Open

HeroCC wants to merge 2 commits into
docker:masterfrom
HeroCC:extra-cli-search-dir

Conversation

@HeroCC

@HeroCC HeroCC commented Sep 28, 2026 •

Copy link
Copy Markdown

Summary

Adds an optional system CLI plugin directory that downstream builds can set with the Go linker -X flag. This lets downstream packagers expose package-managed CLI plugins without requiring users to modify their Docker configuration.

If accepted, I plan on using this in homebrew's docker formula to avoid needing caveats (like this) for plugins.

Testing

  • go test github.com/docker/cli/cli-plugins/manager
  • go test -ldflags='-X github.com/docker/cli/cli-plugins/manager.additionalSystemPluginDir=/test/cli-plugins' github.com/docker/cli/cli-plugins/manager
  • Built and installed a downstream package with the linker setting and confirmed its packaged Compose plugin is discovered.
$ docker info
Client: Docker Engine - Community
 Version:    HEAD-9eaf761
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.37.1
    Path:     /opt/homebrew/lib/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  5.5.1
    Path:     /opt/homebrew/lib/docker/cli-plugins/docker-compose

Release notes (optional)

Add support for configuring an additional system CLI plugin directory at build time.

A picture of a cute animal (not mandatory but encouraged)

Rex :)

rexy-noface

Signed-off-by: Conlan Cesar <conlan.cesar@datadoghq.com>
Signed-off-by: Conlan Cesar <conlan.cesar@datadoghq.com>
@HeroCC
HeroCC force-pushed the extra-cli-search-dir branch from bd1dbc2 to 1229201 Compare September 28, 2026 19:54
@HeroCC
HeroCC marked this pull request as ready for review September 28, 2026 20:30

@vvoland vvoland left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me!

@thaJeztah WDYT?

@vvoland

vvoland commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

One nit though - could you please squash these commits into 1?

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

3 participants