docker / desktop-linux

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

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? #144

Closed tr4v3ler closed 1 year ago

tr4v3ler commented 1 year ago

Expected behavior

start with systemd or service:

sudo systemctl start docker # or
sudo service docker start

then check status:

● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2023-04-24 17:51:48 CST; 10s ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 3242399 (dockerd)
      Tasks: 28
     Memory: 33.7M
     CGroup: /system.slice/docker.service
             └─3242399 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

then run hello-world:

docker run hello-world

everything should be ok.

Actual behavior

start with systemd or service:

sudo systemctl start docker # or
sudo service docker start

then check status:

● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2023-04-24 17:51:48 CST; 10s ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 3242399 (dockerd)
      Tasks: 28
     Memory: 33.7M
     CGroup: /system.slice/docker.service
             └─3242399 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

then run hello-world:

docker run hello-world

then I saw:

docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.

but if I start the daemon manually instead of starting with systemd or service:

sudo dockerd

then run hello-world, everything is ok.

Information

aiordache commented 1 year ago

Hi @tr4v3ler. You are using a local installation of Docker Engine/CLI and not Docker Desktop for Linux. Please check the post-install docs for the Docker Engine on how to set up socket access for your non-root user. If you encounter issues, please raise them in the Docker CLI or Engine issue trackers.

docker-robot[bot] commented 1 year ago

Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

/lifecycle locked