Skip to content

ssh options env var #1505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

ssh options env var #1505

wants to merge 1 commit into from

Conversation

andrevtg
Copy link

@andrevtg andrevtg commented Nov 8, 2018

Signed-off-by: Andre Fernandes andre@vertigo.com.br

Proposal: DOCKER_HOST_SSH_OPTIONS environment variable

  • What I did
    The new "ssh://" protocol for DOCKER_HOST is great, but sometimes we need to use different ssh options than the default. A common scenario if the need to point to a project-specific ssh config file instead of the default one at "~/.ssh/config".

  • How I did it
    An environment variable DOCKER_HOST_SSH_OPTIONS that can hold options for the ssh command docker uses when DOCKER_HOST contains the "ssh://" prefix.

  • How to verify it
    export DOCKER_HOST_SSH_OPTIONS="-F /my/own/ssh.cfg"
    export DOCKER_HOST="ssh://somehost"
    docker version

  • Description for the changelog
    DOCKER_HOST_SSH_OPTIONS to change ssh options when using "ssh://" protocol.

Signed-off-by: Andre Fernandes <andre@vertigo.com.br>
@andrevtg
Copy link
Author

andrevtg commented Nov 8, 2018

Resubmitted after major screwup on original PR.

@codecov-io
Copy link

Codecov Report

Merging #1505 into master will decrease coverage by <.01%.
The diff coverage is 33.33%.

@@            Coverage Diff             @@
##           master    #1505      +/-   ##
==========================================
- Coverage   55.14%   55.14%   -0.01%     
==========================================
  Files         289      289              
  Lines       19371    19374       +3     
==========================================
+ Hits        10683    10684       +1     
- Misses       7996     7997       +1     
- Partials      692      693       +1

@@ -65,6 +74,9 @@ func (sp *sshSpec) Args() []string {
if sp.port != "" {
args = append(args, "-p", sp.port)
}
if sp.options != "" {
args = append(args, strings.Split(sp.options, " ")...)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants