Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to connect. Is Docker running? (Vs Code)

I get this error in Ubuntu in vscode and I can't see my images in vscode.

I run sudo docker ps -a and everything is OK on terminal!

What should I do to solve this problem?

enter image description here

enter image description here

like image 417
Milad Avatar asked Nov 07 '22 00:11

Milad


2 Answers

I think it can be because your user is not in the docker group. Easily check the list of your user's groups using: groups <user>

And check in the output if you can see "docker".

If not, simply add the user to the docker group by typing:

sudo usermod -aG docker ${USER}

Don't forget to restart the VS Code and the system if necessary.

like image 163
themozel Avatar answered Nov 08 '22 14:11

themozel


I had to create docker group for themozel's solution to work.

Here is what worked for me:

Creates docker group

sudo groupadd docker

Add your user to the docker group

sudo usermod -aG docker $USER

like image 28
Alexander Shapiro Avatar answered Nov 08 '22 14:11

Alexander Shapiro