Skip to content

fix: support ssh:// DOCKER_HOST via connhelper#82

Open
aroberts wants to merge 1 commit into
iximiuz:mainfrom
aroberts:fix-ssh-docker-host
Open

fix: support ssh:// DOCKER_HOST via connhelper#82
aroberts wants to merge 1 commit into
iximiuz:mainfrom
aroberts:fix-ssh-docker-host

Conversation

@aroberts

Copy link
Copy Markdown

DOCKER_HOST=ssh://... fails with:

Get "http://user%!j(MISSING)host/v1.51/...": dial tcp: lookup user@host: no such host

cdebug isn't wiring up connhelper, so the docker SDK has no SSH dialer and falls back to a TCP dial against the literal user@host. (The %!j(MISSING) is a downstream fmt bug — @ gets percent-encoded to %40, then the encoded URL is later used as a format string.)

This adds the connhelper handshake from docker/cli's cli/command/cli.go. connhelper is already in the module graph via github.com/docker/cli, no new deps.

Tested against a Docker Swarm — cdebug exec over ssh:// now connects, negotiates the API, and injects the sidecar.

The Docker Go SDK alone cannot dial ssh:// transports — that requires github.com/docker/cli/cli/connhelper, which the docker CLI wires up but cdebug was missing. Without it, DOCKER_HOST=ssh://user@host fails with `dial tcp: lookup user@host: no such host`. This resolves the effective host from opts.Host or DOCKER_HOST, runs it through connhelper.GetConnectionHelper, and wires up the SSH dialer when present.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant