-
Notifications
You must be signed in to change notification settings - Fork 522
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
Add support for ssh #646
Comments
Would you like this to be a host-daemon setting in the extension, so that we add |
Yes, I think that's what I would want as I do currently have my DOCKER_HOST environment variable set to:
and I get the desired behavior at the command line, but the vscode-docker extension doesn't seem to be honoring it. |
Agreed, SSH support brings secure authentication in a commonly installed/maintained manner. The old-school custom CA/cert method is quite complex. Currently, from WSL I can use
On the output tab, in the (mysterious two duplicate) Docker pulldown choice is...nothing. There is no output or diagnostic information. SOP for docker commands are to first honor the DOCKER_HOST env variable. Then if a Some minor refactoring will be needed to allow ssh connection strings at
|
I see that this is on the road map, but wanted to point out that on Microsoft Windows 10 pro 1809 [Version 10.0.17763.253], VSC 1.31.0 and vscode-docker 0.5.2 when the env variable is set for ssh the extension does not work at all. For example DOCKER_HOST=ssh://user@server allows me to connect from the VSC terminal or cmd console but the docker extension does not load properly. The items under DOCKER: EXPLORER are missing and no IntelliSense. There is an error that command 'vscode-docker.explorer.refresh' not found. Dev Tools Console:
|
The underlying docker module dockerode doesn't seem to support ssh connections. |
@steve28 I did some work related to this in 0.7.0, but this issue has not been fixed yet. As @x13machine mentioned, we need one of our underlying dependencies to implement ssh support - tracked in apocas/docker-modem#99 and apocas/docker-modem#102 |
I personally have moved my workflow to remote-ssh once it became available in the regular channel and set the docker plugin to work remotely. I love the workflow now. The setup requires using SSH keys so logon is not a hassle. Also had to set the docker extension to remote. By adding the below to settings.json "remote.extensionKind": { It used to be "peterjausovec.vscode-docker": "workspace", but the publisher name got updated in June. |
@RobTiki - thanks for the pointer! works great! will the docker extension "break" at each update since the above was manually added? |
@steve28 it should update just fine, even with that setting |
@steve28 I have updated vscode and the extension several times with no issues. |
Ah, no wonder I could not get SSH to work :( Would be fantastic to get SSH working, I only have access to Docker on Ubuntu Server hosts over SSH with keys. Please do try to share, or improve (key management), the implementation with the ms-vscode-remote.remote-ssh extension, such that I can use key based authentication, and not have to enter passwords. Btw, it looks like the dependencies mentioned by @EricJizbaMSFT in docker-modem have been implemented. |
SSH support was recently added in docker-modem, and we have updated our reference to it. I think more changes are needed on this side, but I'll check it out and see. |
Ok, so good news, this is actually possible now! You need the Remote Development extension pack.
NOTE: If you are using the Extension to build Docker images, etc. (and thus you have source code for something)--the above approach probably means you have to have your source enlistment on the remote host, rather than your local machine. If you are just using the extension for the Explorer features then you can disregard this. It is also probably possible in the next release of this extension to do it via |
Nice ! It's work on me. Is Remote-WSL not support? |
@mcauto WSL will work automatically in the next release (see #1199). Unfortunately it cannot be configured to work in 0.8.1, as the version of Dockerode in use has a now-fixed issue where it disallows |
Support that is not via the Remote - SSL extension is EDIT: no longer blocked |
DISCLAIMER: There are two "flavors" of using the Docker extension with a remote daemon over SSH:
|
I still can't get remote docker over SSH working, but remote workspaces over SSH works fine. My docker.host user config is:
My SSH config is:
I'm running:
Any more help on how to debug? Can the remote docker be enhanced to use the same configuration as the remote workspaces, where the connection details is configured in the ssh targets config file, that I know works? |
@ptr727 the error you're seeing is an issue with docker-modem. We have an updated version of it that will release with 0.9.0. That said, if you can use Remote - SSH instead, we recommend that over using DOCKER_HOST. |
I am a bit confused with the version nomenclature, i.e. version 0.9.0 vs. 1.41? At my desk VM development over SSH is not an issue, problem is that the docker hosts in our cloud are just for docker, they are not for source, thus the need for remote docker but local code. This could get more interesting in code server style development, where e.g. VSCode is over HTTP on a docker container with source access, but docker server (the one where we want to test deploy code) is over SSH in a different environment where source code is not allowed, but network connectivity to other services is available. But, I agree that the complexity may not be warranted, especially when considering the rights required to manipulate docker server, vs. the threat model of such access in a production environment. |
@ptr727 the version 0.9.0 @bwateratmsft mentioned is the version of the VS Code Docker extension. We are very close to releasing it. |
As of Docker 18.09, you can now connect to remote daemons via SSH. For example:
docker -H ssh://server.example.com ps
Also setting
DOCKER_HOST
works as well:More info here at the end of the Examples->Daemon socket option section.
At present, you cannot enter the protocol portion of the DOCKER_HOST setting in vscode-docker. Also, setting the environment variable DOCKER_HOST outside of vscode does not work either.
This is a request to add support for ssh in DOCKER_HOST.
The text was updated successfully, but these errors were encountered: