Skip to content

cli/registry: support password dash stdin#7029

Merged
vvoland merged 1 commit into
docker:masterfrom
agirault:login-password-dash-stdin
Jun 12, 2026
Merged

cli/registry: support password dash stdin#7029
vvoland merged 1 commit into
docker:masterfrom
agirault:login-password-dash-stdin

Conversation

@agirault

@agirault agirault commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

What

Support for docker login --password - and docker login -p - to read the password or PAT from stdin, matching the existing --password-stdin behavior, and following the common CLI convention that - means stdin.

The tradeoff is that - can no longer be used as a literal password value through --password.

Validation

make -f docker.Makefile test-unit

&

docker run --rm -v "$PWD":/src -w /src golang:1.25 ./scripts/with-go-mod.sh go test -mod=mod ./cli/command/registry -run 'TestRunLogin/password_dash|TestLoginHelpDocumentsPasswordDash|TestLoginValidateFlags/(password_dash|short_password_dash|password_stdin_and_password_dash|conflicting_options)'

Note

  • I searched for prior Docker CLI issues and PRs rejecting this behavior and did not find one.
  • Figured an issue was not needed for this and that it could be discussed in an MR instead given the low cost to just write it.
  • No strong feelings if rejected.

- Human readable description for the release notes

The `--password` flag on `docker login` now accepts `-` to pass the password through STDIN as alternative to `--password-stdin`
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Signed-off-by: Alexis Girault <agirault@nvidia.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the login-password-dash-stdin branch from eeedf80 to 450df79 Compare June 12, 2026 14:15

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

this was something I was considering for a while (but probably never opened a ticket for) 😂

I did a quick rebase, and regenerated the markdown (which was the failure in CI)

@thaJeztah thaJeztah requested a review from vvoland June 12, 2026 14:29
@vvoland vvoland requested a review from docker-agent June 12, 2026 16:55
@vvoland vvoland merged commit 1d1562e into docker:master Jun 12, 2026
117 of 120 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment