fix: support ssh:// DOCKER_HOST via connhelper#82
Open
aroberts wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DOCKER_HOST=ssh://... fails with:
cdebug isn't wiring up
connhelper, so the docker SDK has no SSH dialer and falls back to a TCP dial against the literaluser@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.connhelperis already in the module graph viagithub.com/docker/cli, no new deps.Tested against a Docker Swarm —
cdebug execoverssh://now connects, negotiates the API, and injects the sidecar.