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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant