docker: support DOCKER_HOST=ssh://... remotes #4607
Merged
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 18.09+ added support for SSH remote Docker connections.
The code to handle this isn't actually in the Moby client portions
that we use, but in the Docker CLI (which we already have a
dependency on).
This adapts some of the code from the Docker CLI that attempts
to create a
ConnectionHelper
if the host value is set. Currently,the logic only creates a helper for
ssh://
hosts and returns nilotherwise, in which case the former logic is used (i.e. pass the
host as-is to Moby). If a connection helper is created, it's used
to create a custom HTTP client/transport that will use SSH under
the hood.
Fixes #4603.