docker / desktop-linux

Bug reports for Docker Desktop for Linux
https://docs.docker.com/desktop/linux/
76 stars 5 forks source link

Cannot connect to the Docker daemon after installing docker desktop on Linux #20

Open M41doror opened 2 years ago

M41doror commented 2 years ago

Hello, I just installed Docker Desktop on my OS Fedora 35, I have been waited a while for this feature, I'm quite disappointed since it broke the Docker demon after I tried to uninstall it ! I have tried everything for the past hour, systemd status seems fine but every else commands are broken. Tried to reinstall, to stop and start, restart, erase my home ~/.docker/dekstop/docker.sock Also tried the procedure from the docker documentation : https://docs.docker.com/desktop/linux/install/ Changing context, clean packaging on my machine to purge necessary files. And after removing et reinstalling both engine and desktop nothing works now ! If anyone know a fix let me know ! Best regards.

Error : 

2637 ± : docker run -d -p 80:80 docker/getting-started                                                                                                                                                                     [176d7h22m] ✹ ✭
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.

2635 ± : docker ps                                                                                              ⏎ [176d7h17m] ✹ ✭
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

sudo systemctl status docker

● docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
     Active: active (running) since Fri 2022-05-13 23:24:42 CEST; 7min ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 459784 (dockerd)
      Tasks: 19
     Memory: 38.6M
        CPU: 377ms
     CGroup: /system.slice/docker.service
             └─459784 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

May 13 23:24:42 fedora dockerd[459784]: time="2022-05-13T23:24:42.432366216+02:00" level=info msg="Firewalld: interface docker0 already part of docker zone, returning"
May 13 23:24:42 fedora dockerd[459784]: time="2022-05-13T23:24:42.691614331+02:00" level=error msg="stream copy error: reading from a closed fifo"
May 13 23:24:42 fedora dockerd[459784]: time="2022-05-13T23:24:42.692266578+02:00" level=error msg="stream copy error: reading from a closed fifo"
May 13 23:24:42 fedora dockerd[459784]: time="2022-05-13T23:24:42.822133749+02:00" level=error msg="898530aad5dc0779a0e14de978164a1c9d8d174c19b0d42a4e748e20f2472525 cleanup: failed to delete container from containerd: no such containe>
May 13 23:24:42 fedora dockerd[459784]: time="2022-05-13T23:24:42.822163883+02:00" level=error msg="failed to start container" container=898530aad5dc0779a0e14de978164a1c9d8d174c19b0d42a4e748e20f2472525 error="failed to create shim tas>
May 13 23:24:42 fedora dockerd[459784]: time="2022-05-13T23:24:42.822764041+02:00" level=info msg="Loading containers: done."
May 13 23:24:42 fedora dockerd[459784]: time="2022-05-13T23:24:42.854118607+02:00" level=info msg="Docker daemon" commit=f756502 graphdriver(s)=overlay2 version=20.10.16
May 13 23:24:42 fedora dockerd[459784]: time="2022-05-13T23:24:42.854364744+02:00" level=info msg="Daemon has completed initialization"
May 13 23:24:42 fedora systemd[1]: Started Docker Application Container Engine.
May 13 23:24:42 fedora dockerd[459784]: time="2022-05-13T23:24:42.898428261+02:00" level=info msg="API listen on /run/docker.sock"
BlackElkX commented 2 years ago

I have the same problem. I have a debian 10 with docker 20.10.14, accessible as user. After installing docker-desktop, docker command as user does not connect any more to the daemon. I tried with root, with success, so after some test, I copied the .docker map to the users homedir. After that, the user can access again the docker daemon, but when starting docker-desktop, it is broken again.

The status of the daemon is like above, but the path is not the same as in the error message: unix:///srv/dev-disk-by-id-md/home/$userid/.docker/desktop/docker.sock

Now I try to find a way to set the correct path like in the status of the daemon: containerd=/run/containerd/containerd.sock

When I check the context, both are available. When I switch to the default (unix://var.run/docker.sock), the CLI docker works again, but Docker Desktop not.

Maybe I mix up docker daemon and containerd, but I guess this is the fault. I didn't find a solution yet.

Some screenshots:

thaJeztah commented 2 years ago

Let me move this one to the https://github.com/docker/desktop-linux issue tracker which is for Docker Desktop for Linux

p1-0tr commented 2 years ago

@M31MOTH - could you try following https://docs.docker.com/desktop/linux/install/#uninstall-docker-desktop, and failing that try to remove ~/.docker (of course, don't forget to back it up if you are worried about losing some aspect of your config)?

@BlackElkX - I am not sure if I follow, but if you copied the contents of .docker from root to your user (~/.docker) there is a good chance it would break Desktop (because it would lose state files it relies on, also I would be worried about if everything has the correct access rights). Also, do you mean that before doing that if you switched the context to default (docker context use default) while running Desktop, you would not be able to connect to the regular daemon?

dkress59 commented 2 years ago

for me, following the instructions linked by @p1-0tr did the trick. I uninstalled docker desktop and then removed the two lines from ~/.docker/config.json, now at least docker is working, again.

debian v11 (Kernel: Linux 5.10.0-15-amd64) docker v20.10.17 docker-dektop v4.10.0

elmaxe commented 2 years ago

@p1-0tr's solution worked for me too.

Ubuntu 22.04.1 LTS (Kernel: Linux 5.15.0-46-generic) docker v20.10.13

oktayderman commented 2 years ago

just switch to default context, after installed docker desktop docker cli commands is being forwarded to docker desktop instead of docker engine

docker context ls docker context use default

Fabricio-Joaquim commented 2 years ago

just switch to default context, after installed docker desktop docker cli commands is being forwarded to docker desktop instead of docker engine

docker context ls docker context use default

this worked for me thanks

vladimir-gal commented 1 year ago

just switch to default context, after installed docker desktop docker cli commands is being forwarded to docker desktop instead of docker engine

docker context ls docker context use default

Thanks, this did the trick !

kimmohito commented 1 year ago

just switch to default context, after installed docker desktop docker cli commands is being forwarded to docker desktop instead of docker engine

docker context ls docker context use default

This work for me, I've been looking for this solution all the places. But, after I restart the PC, it went back to desktop-linux

Dmaina5054 commented 1 year ago

Switching docker context with docker context use default worked for me

soodssr commented 1 year ago

just switch to default context, after installed docker desktop docker cli commands is being forwarded to docker desktop instead of docker engine

docker context ls docker context use default

Found this to be the simplest way to fix this issue.

thanks @oktaycekmez

quanhieu commented 1 year ago

just switch to default context, after installed docker desktop docker cli commands is being forwarded to docker desktop instead of docker engine

docker context ls docker context use default

Totally, that exactly answer I need

docker-robott commented 1 year ago

There hasn't been any activity on this issue for a long time. If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment. If not, this issue will be closed in 30 days.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

psilvaricardo commented 1 year ago

/remove-lifecycle stale

sonvirgo commented 1 year ago

Didn't work for me. I didn't install docker engine beforehand. Only Docker-desktop follow this guide https://docs.docker.com/desktop/install/ubuntu/ It works straight, build and run images. Someday after an apt upgrade, it stop working. I suspect something related to newly poped up keyring. But clueless.

XavierChevalier commented 1 year ago

Personally, I forget to unable the Enable default Docker socket. It's allows to creates /var/run/docker.sock which some third-party clients may use to communicate with Docker Desktop.

To solve this, go to Settings -> Advanced -> check the option Enable default Docker socket (Requires password). No need to restart Docker.

sonvirgo commented 1 year ago

Remove all docker-desktop and install docker-engine work for me.

jorgeas80 commented 11 months ago

Tried the

Personally, I forget to unable the Enable default Docker socket. It's allows to creates /var/run/docker.sock which some third-party clients may use to communicate with Docker Desktop.

To solve this, go to Settings -> Advanced -> check the option Enable default Docker socket (Requires password). No need to restart Docker.

This looks like the solution, but cannot find Advanced in Settings :-(

mleku commented 9 months ago

i just encountered this problem, and discovered that running docker as non-root with the presence of things in $HOME/.docker it expects to find the socket in there:

docker: Cannot connect to the Docker daemon at unix:///home/me/.docker/desktop/docker.sock. Is the docker daemon running?.

i just now solved this problem thusly:

[me@ip3 client]$ sudo rm -rf ~/.docker
[me@ip3 client]$ docker run -it --rm archlinux bash -c "echo hello world"
Unable to find image 'archlinux:latest' locally
latest: Pulling from library/archlinux
5f77560258b9: Pull complete 
d45fbe0d533b: Pull complete 
Digest: sha256:c104009b470ee7866c42cbfc491aba018efe5e157184302ed5dcffda569adbda
Status: Downloaded newer image for archlinux:latest
hello world
speller commented 9 months ago

I can not find the "Settings -> Advanced" configuration in the Ubuntu version of DD...

StilllHere commented 9 months ago

just switch to default context, after installed docker desktop docker cli commands is being forwarded to docker desktop instead of docker engine

docker context ls docker context use default

Thanks a lot. It helps me, but I cant understand whyyyyyyy

chadwick-yao commented 9 months ago

just switch to default context, after installed docker desktop docker cli commands is being forwarded to docker desktop instead of docker engine

docker context ls docker context use default

thanks it works

achepukov commented 8 months ago

This looks like the solution, but cannot find Advanced in Settings :-(

Neither did I, seems to no advanced settings in docker-desktop for debian. However this seems to helped me:

docker context use desktop-linux

dldutod4 commented 7 months ago

just switch to default context, after installed docker desktop docker cli commands is being forwarded to docker desktop instead of docker engine

docker context ls docker context use default

Thanks!! it works

tskxz commented 6 months ago

So i removed docker-desktop with sudo apt-get purge docker-desktop, but i still got the same error docker: Cannot connect to the Docker daemon at unix:///home/tanjil/.docker/desktop/docker.sock. Is the docker daemon running?.

tskxz commented 6 months ago

So i removed docker-desktop with sudo apt-get purge docker-desktop, but i still got the same error docker: Cannot connect to the Docker daemon at unix:///home/tanjil/.docker/desktop/docker.sock. Is the docker daemon running?.

Ok i just needed to run as sudo and it works

Aamirmuhammad91 commented 5 months ago

just switch to default context, after installed docker desktop docker cli commands is being forwarded to docker desktop instead of docker engine

docker context ls docker context use default

This worked for me as well.

mion-kr commented 5 months ago

docker context use default work for me

GausAlMunirTushar commented 3 months ago

I just solved this problem using run the command sudo rm -rf ~/.docker

NeuronioAzul commented 3 months ago

just switch to default context, after installed docker desktop docker cli commands is being forwarded to docker desktop instead of docker engine

docker context ls docker context use default

Thanks, that works for me.

rumus-bin commented 4 weeks ago

@p1-0tr's solution worked for me too.

Ubuntu 24.04.1 LTS Docker Engine v27.1.1