David
David

Reputation: 3066

Cannot connect to docker daemon in intellij in ubuntu with snap

In Intellij Ultimate docker is not detected automatically.

I choose "create new", but i get the message, that i cannot connect to docker daemon at unix /var/run/docker.sock

i started docker with: sudo snap docker start

The file docker.sock exists.

i added permission like it is said in other posts: sudo usermod -aG docker $USER and logged out and in again.

It does not help. What can i do?

Upvotes: 3

Views: 1665

Answers (2)

Dmitry Spikhalsky
Dmitry Spikhalsky

Reputation: 5850

For Ubuntu with Intellij IDEs installed from Snap store and Docker Desktop (UI) I was able to solve the problem by choosing a "desktop-linux" Unix Socket in Docker Settings instead of the default. default is unix:///var/run/docker.sock and desktop-linux is unix:///home/username/.docker/desktop/docker.sock.

Snap apps run in the sandbox and have access to the home dir, that's why it works.

If you run Docker Engine and don't have Docker Desktop installed, you should be able to create a symlink for /var/run/docker.sock in your home directory.

Preferences -> Build, Execution, Deployment -> Docker

Upvotes: 0

Janning Vygen
Janning Vygen

Reputation: 9222

I have the same problem. And I think that the snap package is not able to access /var/run/docker.sock See https://stackoverflow.com/a/69565328/351758

Upvotes: 1

Related Questions