3

I've installed docker engine followed by Docker Desktop following the steps mentioned at https://docs.docker.com/engine/install/ubuntu/ and https://docs.docker.com/desktop/linux/install/ubuntu/.

After the completion of installation process, I started docker desktop using command -

$ systemctl --user start docker-desktop

It stuck for hours at "Docker Desktop starting..."

Docker-Desktop

Issue when connection to docker socket

priyeshy@AMGBLR1682-LT:~$ docker run hello-world docker: Cannot connect to the Docker daemon at
unix:///home/priyeshy/.docker/desktop/docker.sock. Is the docker daemon running?. See 'docker run --help'.

priyeshy@AMGBLR1682-LT:~$ sudo docker run --rm -it hello-world [sudo] password for priyeshy: Hello from Docker! This message shows that your installation appears to be working correctly. .....

I've added my $USER in docker group and restarted using newgrp docker. Still docker run command throws same error cannot connect to docker daemon. I might be doing silly mistake but I'm unable to find.

Simon Sudler
  • 3,931
  • 3
  • 21
  • 34
Priyesh
  • 31
  • 1
  • 1
  • 2
  • have you tried starting a container? e.g. docker run --rm -it ubuntu:22.04 sleep 600 – Simon Sudler Jun 21 '22 at 11:06
  • priyeshy@AMGBLR1682-LT:~$ docker run hello-world docker: Cannot connect to the Docker daemon at unix:///home/priyeshy/.docker/desktop/docker.sock. Is the docker daemon running?. See 'docker run --help'. priyeshy@AMGBLR1682-LT:~$ – Priyesh Jun 21 '22 at 11:19
  • priyeshy@AMGBLR1682-LT:~$ sudo docker run --rm -it hello-world [sudo] password for priyeshy:

    Hello from Docker! This message shows that your installation appears to be working correctly. .....

    – Priyesh Jun 21 '22 at 11:20
  • I've added my $USER in docker group and restarted using newgrp docker. Still "docker run" command throws same error "cannot connect to docker daemon". I might be doing silly mistake but I'm unable to find. – Priyesh Jun 21 '22 at 11:21
  • 1
    Check this post: https://stackoverflow.com/questions/48568172/docker-sock-permission-denied – Simon Sudler Jun 21 '22 at 11:42
  • ... and edit your question with these details. – Simon Sudler Jun 21 '22 at 11:45

1 Answers1

6

The solution is

You need to create 2 files /etc/subuid and /etc/subgid with ranges for user and group id mapping. An example:

$ echo <USER>:10000:65536 >> /etc/subuid
$ echo <USER>:10000:65536 >> /etc/subgid

I found out the solution with this GitHub issue https://github.com/docker/desktop-linux/issues/51

The solution above worked for my Manjaro system

Deji
  • 61
  • Thank you! Worked for me. Off course restart the service with systemctl restart docker.service and wait a while. Log can be accessed here: $HOME/.docker/desktop/log/host/com.docker.driver.amd64-linux.log – gaucib Nov 21 '22 at 04:03
  • For some weird reason, those commands didn't work even with SUDO... But it worked editing the files on VSCode, and then using SUDO password. Go figure... – Borjovsky Mar 21 '23 at 13:16