Skip to content
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

docker ssh : docker_host does not support ipv6 ssh addresses #1533

Closed
afausttanasescu opened this issue Jan 8, 2020 · 11 comments
Closed

docker ssh : docker_host does not support ipv6 ssh addresses #1533

afausttanasescu opened this issue Jan 8, 2020 · 11 comments
Milestone

Comments

@afausttanasescu
Copy link

Docker host environment variable should support ipv6 as well.

VSCode Version: insiders build 1.42.0-insider
Local OS Version: win10
Remote OS Version: win10
Remote Extension/Connection Type: ssh+docker

Steps to Reproduce:

Configure environment variable to ssh://ec2-user@fda1:aadd:ef9b:7777::5.5.5.5:22
In the docker extension, under networks : Docker env variable should be something like ....

Does this issue occur when you try this locally?: Yes
Does this issue occur when you try this locally and all extensions are disabled?: Yes

@afausttanasescu
Copy link
Author

I should add that docker -H doesn't seem to accept the ipv6 address either. In the extension code, I only see a regex for something that starts with ssh://, so it should work.

@dbreshears dbreshears added this to the Future milestone Jan 10, 2020
@hholst80
Copy link

hholst80 commented Feb 8, 2020

I confirm that this does not work. I can only see this after 3 minutes of connecting.

image

@hholst80
Copy link

hholst80 commented Feb 8, 2020

Reproduce this by setting DOCKER_HOST=ssh://user@remote.

This works from CLI:

image
image

@hholst80
Copy link

hholst80 commented Feb 8, 2020

I should add that docker -H doesn't seem to accept the ipv6 address either. In the extension code, I only see a regex for something that starts with ssh://, so it should work.

DOCKER_HOST=ssh://... uses the remote docker.sock via client docker system dial-stdio call so that is not related to this issue.

@bwateratmsft
Copy link
Contributor

This could be an issue with the way dockerode consumes the DOCKER_HOST variable. Need to investigate.

@bwateratmsft
Copy link
Contributor

@karolz-ms do you think this might work with the docker context changes?

@karolz-ms karolz-ms self-assigned this Mar 27, 2020
@karolz-ms
Copy link
Contributor

@bwateratmsft I think there is a good chance that #1790 will fix this. Will try to verify next week.

@karolz-ms
Copy link
Contributor

Sorry for long delay, it was only last week that I was finally able to figure out how to create and SSH over IPv6 into an Azure VM, so I could test the scenario. Unfortunately it does not work, at leas on a Mac. Investigating...

@karolz-ms
Copy link
Contributor

OK, it actually works, one just needs to specify the username part of the SSH URL, even if the default works just fine with Docker CLI. So

docker context create mycontextname --docker "host=ssh://username@machine-name"

IPv6 address and/or machine name that represents the AAAA DNS record should work as machine-name part. The machine name has to be DNS-resolvable name (the Docker extension, or more precisely, the underlying docker-modem/ssh2 library combo, does not look into ~/.ssh/config for host aliases yet.

@karolz-ms
Copy link
Contributor

(VSCode Docker extension version 1.1.0 or later)

@hholst80
Copy link

OK, it actually works, one just needs to specify the username part of the SSH URL, even if the default works just fine with Docker CLI. So

docker context create mycontextname --docker "host=ssh://username@machine-name"

IPv6 address and/or machine name that represents the AAAA DNS record should work as machine-name part. The machine name has to be DNS-resolvable name (the Docker extension, or more precisely, the underlying docker-modem/ssh2 library combo, does not look into ~/.ssh/config for host aliases yet.

It's actually much more than aliases. There can be various proxy commands etc, that are setup in a ssh connection. Do not use ~/.ssh/config unless you support it natively.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants