can't connect to docker daemon, tho it's started

373 Views Asked by At

I run

systemctl status docker

and get

 docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2021-05-22 01:13:39 EDT; 2min 58s ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 29937 (dockerd)
      Tasks: 16
     Memory: 44.2M
     CGroup: /system.slice/docker.service
             └─29937 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

May 22 01:13:38 mbfgdell dockerd[29937]: time="2021-05-22T01:13:38.546418221-04:00" level=warning msg="Your kernel>
May 22 01:13:38 mbfgdell dockerd[29937]: time="2021-05-22T01:13:38.546439612-04:00" level=warning msg="Your kernel>
May 22 01:13:38 mbfgdell dockerd[29937]: time="2021-05-22T01:13:38.546456513-04:00" level=warning msg="Your kernel>
May 22 01:13:38 mbfgdell dockerd[29937]: time="2021-05-22T01:13:38.546810704-04:00" level=info msg="Loading contai>
May 22 01:13:38 mbfgdell dockerd[29937]: time="2021-05-22T01:13:38.865868481-04:00" level=info msg="Default bridge>
May 22 01:13:39 mbfgdell dockerd[29937]: time="2021-05-22T01:13:39.027302568-04:00" level=info msg="Loading contai>
May 22 01:13:39 mbfgdell dockerd[29937]: time="2021-05-22T01:13:39.173496789-04:00" level=info msg="Docker daemon">
May 22 01:13:39 mbfgdell dockerd[29937]: time="2021-05-22T01:13:39.173625360-04:00" level=info msg="Daemon has com>
May 22 01:13:39 mbfgdell systemd[1]: Started Docker Application Container Engine.
May 22 01:13:39 mbfgdell dockerd[29937]: time="2021-05-22T01:13:39.258181088-04:00" level=info msg="API listen on >

but when i do

docker info

I get

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
  scan: Docker Scan (Docker Inc., v0.7.0)

Server:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
errors pretty printing info

Does anyone know what's wrong here?

(i do see a docker.pid in /var/run, however i do NOT see a docker.sock in /var/run)

After further discovery, the socket file is here /run/docker.sock not /var/run/docker.sock

the systemd unit file for docker.socket looks like

cat docker.socket 
[Unit]
Description=Docker Socket for the API

[Socket]
ListenStream=/var/run/docker.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker

[Install]
WantedBy=sockets.target

not sure if the daemon or the client is wrong, and how to fix it???

UPDATE: hmm it seems if i create a symlink from /var/run/docker.sock to /run/docker.sock it works. Not great, but i guess i'll live with it

0

There are 0 best solutions below