cli/registry/login: Add the `--password-env` flag
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 50/100
Research direction
Start by locating the Docker CLI's login command and its existing --password-stdin handling. Trace how command-line flags reach authentication, then verify that --password-env reads the named environment variable and supports the GitLab CI example without exposing the password.
Written by the indexing model from the issue text.
Description
Description
Add support for providing registry passwords via environment variables, which is particularly useful in CI pipelines. For example, GitLab stores registry passwords in the CI_REGISTRY_PASSWORD environment variable.
With the --password-env flag, authenticating to a registry is as simple as:
docker login --username "${CI_REGISTRY_USER}" --password-env "CI_REGISTRY_PASSWORD" "${CI_REGISTRY}"
Alternatives Considered
-
Using
docker login -p "${VAR}"with warning suppression- Shell history concerns don't apply with variable substitution
- Tokens are often short-lived, reducing security concerns
- Could introduce a way to suppress warnings via environment variables
-
Passing passwords via STDIN (current recommended method):
echo "${CI_REGISTRY_PASSWORD}" | docker login --username "${CI_REGISTRY_USER}" --password-stdin "${CI_REGISTRY}"Avoids warnings but adds complexity to command chains
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 2.2k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 47
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from docker/cli
-
kind/bug status/0-triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
kind/bug status/0-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
kind/feature status/0-triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
kind/bug status/0-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 60/100
github/gh-aw-mcpg#13748 ·
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
googleapis/librarian#7670 · 2 comments ·