Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`DaemonHost()` returns `http://docker.example.com` for ssh transport

オープン
#6,164 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
go
領域
cli

調査の方向性

cli/connhelper/connhelper.go の getConnectionHelper と、cli/context/docker/load.go のクライアントホストの処理から始めます。DOCKER_HOST="ssh://user@1.2.3.4" で動作を再現し、DaemonHost() がどのように導出されるかを追跡します。CLI が ssh、unix、pipe を含む実際に設定された transport を公開し、呼び出し元がリモートホストとローカルホストを区別できるようになれば完了です。

索引モデルが issue の本文から書いたものです。

説明

kind/bug status/0-triage
Description

cli.DaemonHost() gives http://docker.example.com when docker host is set to ssh

the behavior comes from getConnectionHelper in https://github.com/docker/cli/blob/84038691220e7ba3329a177e4e3357b4ee0e3a52/cli/connhelper/connhelper.go#L64 the Host is set to http://docker.example.com in connection helper and later updated the host attribute in the cli.Client at https://github.com/docker/cli/blob/84038691220e7ba3329a177e4e3357b4ee0e3a52/cli/context/docker/load.go#L115

the daemon host is specially useful in docker compose when we want to know if the docker host it's remote or not, like you are doing here https://github.com/docker/cli/blob/84038691220e7ba3329a177e4e3357b4ee0e3a52/cli/context/docker/load.go#L127

Reproduce
DOCKER_HOST="ssh://user@1.2.3.4" docker 
Expected behavior

we should be able to know whenever the docker cli is accessing the docker host via ssh, unix, pipe, etc

basically we should be able to access docker host used

docker version
Client: Docker Engine - Community
 Version:           28.2.2
 API version:       1.50
 Go version:        go1.24.3
 Git commit:        e6534b4
 Built:             Fri May 30 12:07:26 2025
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          28.2.2
  API version:      1.50 (minimum version 1.24)
  Go version:       go1.24.3
  Git commit:       45873be
  Built:            Fri May 30 12:07:26 2025
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.27
  GitCommit:        05044ec0a9a75232cad458027ca83437aae3f4da
 runc:
  Version:          1.2.5
  GitCommit:        v1.2.5-0-g59923ef
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
docker info
Client: Docker Engine - Community
 Version:    28.2.2
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.24.0
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.36.2
    Path:     /usr/libexec/docker/cli-plugins/docker-compose
Additional Info

No response

主要言語
Go
スター
6.1k
フォーク
2.2k
平均マージ
1日 10時間
マージ済み PR(30日)
47

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

docker/cli のほかの issue

docker/cli の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。