microsoft / vscode-docker

Docker Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker
Other
1.18k stars 508 forks source link

[SOLVED] Linux Mint: Failed to connect. Is Docker installed? // Docker is not installed. #4279

Closed xtiang7c0 closed 2 months ago

xtiang7c0 commented 2 months ago

Does this occur consistently? Yes Repro steps:

  1. Installed Linux Mint Cinnamon Edge 21.3
  2. Installed Docker Desktop
  3. Installed Visual Studio Code
  4. Installed Docker Extension for Visual Studio Code

error

Saw the request to execute in VS code bash terminal in another issue, so here it is:

PC:~/projectx$ docker -v bash: docker: command not found

In the Linux Mint Terminal I get:

PC:~$ docker -v Docker version 26.0.0, build 2ae903e

When I compose in the Mint terminal everything works great so it seems the connection is some how bugged.

I did set docker.dockerPath to "/usr/local/bin/docker" in the vs code setting as this is what I get when entering: which docker

Let me know if you need anything else.

Version: 1.29.0 OS: linux OS Release: 6.5.0-26-generic Product: Visual Studio Code Product Version: 1.87.2 Language: en

Edit: Maybe just found a hint. Opened in VS Code: F1 --> "Preferences: Open Default Settings (JSON)" and saw this:

// Absolute path to Docker client executable (`docker` command). If the path contains whitespace, it needs to be quoted appropriately.
"docker.dockerPath": "",

--> cannot edit in read-only editor, otherwise I could have added the path.

Edit2: Uninstalled VS Code, rebooted, installed and it works...

bwateratmsft commented 2 months ago

Glad it's working for you now! I'm guessing that the environment variables weren't populating that contained the Docker executable, PATH in particular. Upon rebooting they would likely populate as expected.