镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

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

Open
HeroCC wants to merge 1 commit into
docker:masterfrom
HeroCC:extra-cli-search-dir
Open

HeroCC wants to merge 1 commit 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

@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 previously approved these changes Sep 29, 2026

@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!

@HeroCC
HeroCC force-pushed the extra-cli-search-dir branch from 1229201 to bbd8815 Compare September 29, 2026 13:15
Signed-off-by: Conlan Cesar <conlan.cesar@datadoghq.com>
@HeroCC

HeroCC commented Sep 29, 2026

Copy link
Copy Markdown
Author

@vvoland Done! Rebased into one commit. I also fixed the lint in the test.

@HeroCC
HeroCC requested a review from vvoland September 29, 2026 13:20
@vvoland
vvoland requested a review from thaJeztah September 29, 2026 14:24
@thaJeztah

Copy link
Copy Markdown
Member

I want to have a closer look; my concern is that some of this code may also be used in (eg) docker compose; which may mean that compose now gets a different view of the world than the CLI itself, so resolve to a different plugin; even if the same config-file is used.

@vvoland vvoland modified the milestones: 29.9.0, 29.10.0 Oct 1, 2026
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.

4 participants