Permit use of Remote Container using SSH transport
Recent versions of docker (1809+) can work with remotes by setting a value for DOCKER_HOST that looks like this.
PS > $env:DOCKER_HOST='ssh://[email protected]'
PS > docker system info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
...
PS > docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
...
If you run VSCode with verbose mode I get an error about my DOCKER_HOST.
PS > code --verbose
...
[24784:0610/141325.224:INFO:CONSOLE(3187)] "Activating extension 'ms-vscode-remote.remote-containers' failed: DOCKER_HOST env variable should be something like tcp://localhost:1234.", source: file:///C:/Users/zoredache/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js (3187)
Using SSH as a transport for remote docker usage tends to be far easier to configure compared with tls/tcp transports. Please add this functionality to the extension.
@chrmarti @zoredache This is coming from one our dependencies docker-modem here: https://github.com/apocas/docker-modem/blob/0d07517d3f684d7d151ec06e090041a936b4ff67/lib/modem.js#L35
This is a dependency of dockerode, so to fix both would need to rev so we can pick up the updated dependency.
Tracked in docker-modem: https://github.com/apocas/docker-modem/issues/99
There is already a PR.
Would this merged PR for it be enoguh ? https://github.com/apocas/docker-modem/pull/102
@igorbb Yes, we need a new version of dockerode to pick up the latest from docker-modem from what I see.
This works with the latest version of docker-modem when used with the ssh-agent for authentication. Ideally it would also support reading from the user's ssh config. I have filed https://github.com/apocas/docker-modem/issues/113 for this.
Still need to check using DOCKER_HOST and authentication on Windows (https://github.com/microsoft/vscode-docker/blob/836a76500c1e3edaadccdea944dec31b3e586c2c/src/utils/refreshDockerode.ts#L77).