vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

Permit use of Remote Container using SSH transport

Open zoredache opened this issue 7 years ago • 6 comments

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.

zoredache avatar Jun 10 '19 21:06 zoredache

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

Chuxel avatar Jun 14 '19 21:06 Chuxel

Tracked in docker-modem: https://github.com/apocas/docker-modem/issues/99

There is already a PR.

chrmarti avatar Jun 17 '19 13:06 chrmarti

Would this merged PR for it be enoguh ? https://github.com/apocas/docker-modem/pull/102

igorbb avatar Oct 24 '19 16:10 igorbb

@igorbb Yes, we need a new version of dockerode to pick up the latest from docker-modem from what I see.

chrmarti avatar Oct 28 '19 21:10 chrmarti

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.

chrmarti avatar Nov 07 '19 19:11 chrmarti

Still need to check using DOCKER_HOST and authentication on Windows (https://github.com/microsoft/vscode-docker/blob/836a76500c1e3edaadccdea944dec31b3e586c2c/src/utils/refreshDockerode.ts#L77).

chrmarti avatar Nov 07 '19 19:11 chrmarti