Vscode-docker: docker ssh : docker_host does not support ipv6 ssh addresses

Created on 9 Jan 2020  路  11Comments  路  Source: microsoft/vscode-docker

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

fix released

Most helpful comment

@bwateratmsft I think there is a good chance that https://github.com/microsoft/vscode-docker/pull/1790 will fix this. Will try to verify next week.

All 11 comments

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.

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

image

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

This works from CLI:

image
image

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.

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

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

@bwateratmsft I think there is a good chance that https://github.com/microsoft/vscode-docker/pull/1790 will fix this. Will try to verify next week.

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...

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.

(VSCode Docker extension version 1.1.0 or later)

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.

Was this page helpful?
0 / 5 - 0 ratings