`docker logout docker.io` does not remove Docker Hub credentials
まだ誰も着手していません。
評価
調査の方向性
CLI コードベース内のログインおよびログアウトコマンドの実装を調べてください。おそらく cli/command/registry の下にあります。ログイン時に docker.io が https://index.docker.io/v1/ に正規化される方法を比較します。修正は、ログアウトが同じ正規化を使用するようにすることです。まず、問題をローカルで再現して動作を確認し、次にログアウトのロジックを見つけて正規化を適用します。パッチ適用後のログアウトコマンドを実行した後、config.json ファイルをチェックして検証してください。
索引モデルが issue の本文から書いたものです。
説明
Description
For Docker Hub, docker login canonicalizes docker.io to https://index.docker.io/v1/, while docker logout does not appear to apply the same canonicalization logic.
For example, when a user explicitly logs in with:
docker login docker.io
the credentials are stored in config.json under the canonical Docker Hub key:
{
"auths": {
"https://index.docker.io/v1/": {
"auth": "..."
}
}
}
However, when the user explicitly logs out with:
docker logout docker.io
the logout logic attempts to remove credentials associated with docker.io from config.json.
Since the credentials were actually stored under https://index.docker.io/v1/, no matching docker.io entry exists, so the stored Docker Hub credentials are not removed.
In other words, docker login docker.io and docker logout docker.io use inconsistent registry host normalization for Docker Hub.
docker login docker.io and docker logout docker.io use inconsistent registry host normalization for Docker Hub.
Reproduce
- Run
docker login docker.ioand authenticate successfully. - Check
~/.docker/config.jsonand verify that the credentials are stored underhttps://index.docker.io/v1/. - Run
docker logout docker.io. - Check
~/.docker/config.jsonagain. - Observe that the Docker Hub credentials under
https://index.docker.io/v1/are still present.
Expected behavior
Running docker logout docker.io should remove the Docker Hub credentials stored under https://index.docker.io/v1/.
docker version
Client:
Version: 29.8.0
API version: 1.56
Go version: go1.26.8
Git commit: 88096ef
Built: Thu Sep 3 21:53:38 2026
OS/Arch: windows/amd64
Context: desktop-linux
failed to connect to the docker API at npipe:////./pipe/dockerDesktopLinuxEngine; check if the path is correct and if the daemon is running: open //./pipe/dockerDesktopLinuxEngine: The system cannot find the file specified.
docker info
Client:
Version: 29.8.0
Context: desktop-linux
Debug Mode: false
Plugins:
agent: Docker AI Agent Runner (Docker Inc.)
Version: v1.136.0
Path: C:\Users\yin2hao\.docker\cli-plugins\docker-agent.exe
ai: Docker AI Agent - Ask Gordon (Docker Inc.)
Version: v1.31.0
Path: C:\Users\yin2hao\.docker\cli-plugins\docker-ai.exe
buildx: Docker Buildx (Docker Inc.)
Version: v0.37.0
Path: C:\Users\yin2hao\.docker\cli-plugins\docker-buildx.exe
compose: Docker Compose (Docker Inc.)
Version: v5.5.1
Path: C:\Users\yin2hao\.docker\cli-plugins\docker-compose.exe
debug: Get a shell into any image or container (Docker Inc.)
Version: 0.0.47
Path: C:\Users\yin2hao\.docker\cli-plugins\docker-debug.exe
desktop: Docker Desktop commands (Docker Inc.)
Version: v0.4.4
Path: C:\Users\yin2hao\.docker\cli-plugins\docker-desktop.exe
dhi: CLI for managing Docker Hardened Images (Docker Inc.)
Version: v0.0.7
Path: C:\Users\yin2hao\.docker\cli-plugins\docker-dhi.exe
extension: Manages Docker extensions (Docker Inc.)
Version: v0.2.31
Path: C:\Users\yin2hao\.docker\cli-plugins\docker-extension.exe
init: Creates Docker-related starter files for your project (Docker Inc.)
Version: v1.4.0
Path: C:\Users\yin2hao\.docker\cli-plugins\docker-init.exe
mcp: Docker MCP Plugin (Docker Inc.)
Version: v0.43.3
Path: C:\Users\yin2hao\.docker\cli-plugins\docker-mcp.exe
model: Docker Model Runner (Docker Inc.)
Version: v1.2.6
Path: C:\Users\yin2hao\.docker\cli-plugins\docker-model.exe
offload: Docker Offload (Docker Inc.)
Version: v0.6.17
Path: C:\Users\yin2hao\.docker\cli-plugins\docker-offload.exe
pass: Docker Pass Secrets Manager Plugin (beta) (Docker Inc.)
Version: v0.2.2
Path: C:\Users\yin2hao\.docker\cli-plugins\docker-pass.exe
sandbox: "docker sandbox" is deprecated, use Docker Sandboxes instead (Docker Inc.)
Version: v0.13.0
Path: C:\Users\yin2hao\.docker\cli-plugins\docker-sandbox.exe
scout: Docker Scout (Docker Inc.)
Version: v1.24.0
Path: C:\Users\yin2hao\.docker\cli-plugins\docker-scout.exe
Server:
failed to connect to the docker API at npipe:////./pipe/dockerDesktopLinuxEngine; check if the path is correct and if the daemon is running: open //./pipe/dockerDesktopLinuxEngine: The system cannot find the file specified.
Additional Info
No response
- 主要言語
- Go
- スター
- 6.1k
- フォーク
- 2.2k
- 平均マージ
- 1日 10時間
- マージ済み PR(30日)
- 47
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
docker/cli のほかの issue
-
kind/bug status/0-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
kind/feature status/0-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
kind/bug status/0-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
kind/bug status/0-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
似ている issue
-
area/dev-productivity area/disaster-recovery area/ipcei kind/enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
🤔 refinement needed
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
equinor/radix-operator#1979 ·
-
help wanted kind/documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
liquidmetal-dev/flintlock#1239 ·