Containers not showing in Docker Desktop

Hi all.

Ive recently set up a Ubuntu 22.04 server and installed docker.

I have two docker containers running at present, pi hole and home assistant but they dont show up n docker desktop or portainer.

Can anyone help please?

ash@AshServer:~$ docker context ls
NAME TYPE DESCRIPTION DOCKER ENDPOINT KUBERNETES ENDPOINT ORCHESTRATOR
default moby Current DOCKER_HOST based configuration unix:///var/run/docker.sock
desktop-linux * moby unix:///home/ash/.docker/desktop/docker.sock

ash@AshServer:~$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
986e54a4acd7 pihole/pihole:latest ā€œ/s6-initā€ 2 hours ago Up About an hour (healthy) 0.0.0.0:53->53/udp, :::53->53/udp, 0.0.0.0:53->53/tcp, :::53->53/tcp, 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:67->67/udp, :::443->443/tcp, :::67->67/udp pihole
881cb250ec4c homeassistant/home-assistant:stable ā€œ/initā€ 13 hours ago Up About an hour homeassistant

You donā€™t see your containers in Docker Desktop, because they are running in a different docker engine.

Execute sudo docker context ls and you will notice the context ist set to `defaultĀ“, which is a different docker engine on your host.

1 Like

hi @basher91, I found the same problem as you, in my case you just need to change the docker context to docker-linux or default.

docker context use desktop-linux

or

docker context use default
1 Like

Still this step hasnā€™t worked. The error is ā€œ(Details: [13] Access denied)ā€ check on both Docker Desktop and Intellij RustRover environments.
Solution for the problem found at Intellij forum:

sudo chmod a+rwx /var/run/docker.sock
sudo chmod a+rwx /var/run/docker.pid

Immediately the connection works and builder is available.

Bad idea. The Docker socket is protected for a reason. If you run the commands you found, you make it available to anyone, including every single software even if not running as root. To be honest I donā€™t know what a user could do with that when using Docker Desktop, but it still feels bad. It would be definitely bad when using Docker CE.

JetBrains by the way allows you to choose a context. The one you choose in the terminal will not affect the IDE. I checked it on my Linux machine, but I can share the screenshot easier on my Mac:


Then you donā€™t need the default socket and the socket in the desktop-linux context will be owned by you.

I guess assigning a common group to you and the linux socket would also work as it works with Docker CE where the socket is owned by the group called ā€œdockerā€.