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

Failed to connect. Is Docker installed and running? #3483

Closed
tigeran2020 opened this issue Apr 7, 2022 · 8 comments
Closed

Failed to connect. Is Docker installed and running? #3483

tigeran2020 opened this issue Apr 7, 2022 · 8 comments

Comments

@tigeran2020
Copy link

I am using docker to develop on remote linux host, and I am using docker context to connect to the remote host.
But I got error Failed to connect. Is Docker installed and running? when I open the docker panel on vscode:

image

And the Docker CLI works :

image

@bwateratmsft
Copy link
Collaborator

This error usually occurs in SSH contexts when an ssh-agent has not been set up. Even though the Docker CLI does not require one, the ssh2 package used by dockerode does. There's more info on setting it up here: https://code.visualstudio.com/docs/containers/ssh#_set-up-ssh-tunneling

Once you have one going, does it work?

@tigeran2020
Copy link
Author

After I had restarted the remote linux, it worked.
I will try your way next time.

@bwateratmsft
Copy link
Collaborator

Glad to hear it's working now!

@Igorgro
Copy link

Igorgro commented Apr 27, 2022

@bwateratmsft Hi! I have the same issue, but I have ssh-agent running. It seems like vscode cannot detect it and shows the warning and cannot connect to remote context. I've everything is set up according to instruction you linked, but it still doesn't works.

@karolz-ms
Copy link
Contributor

@Igorgro please confirm you understood and followed the first tip in the instructions (the one about using only globally-resolvable DNS machine name or IP address in Docker endpoint definition) and that the remote Docker context is usable from command line (you can execute command such as run, images etc against that context).

If that is all true, maybe you can share the definition of your remote Docker context?

@Igorgro
Copy link

Igorgro commented Apr 27, 2022

Yes, I can run any docker commands from command line, but not from vscode. I'm creating the context with the following command: docker context create myserver --docker "host=ssh://[email protected]:22"

@karolz-ms
Copy link
Contributor

Igorgro thanks. Sorry, I have no other ideas why the Docker extension does not work; looks like you did everything right. 😞

@bwateratmsft
Copy link
Collaborator

Hopefully this will get fixed with #3263.

@microsoft microsoft locked and limited conversation to collaborators May 27, 2022
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

4 participants