When i try to run a docker-compose up i get the error : ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
or a simple docker pull hello-world i get the error :
root@debian-s-1vcpu-1gb-ams3-01:~# docker pull hello-world
Using default tag: latest
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
I've read the main thread on this issue here Docker-Compose can't connect to Docker Daemon but in my case it's about docker-compose AND docker and i am running the machine as root so it's not about groups.
Docker was running well before but now it is not anymore. I dont know why.
I've tried to reinstall docker but i get an error when the installation finishes :
Process: 57915 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
...
May 29 14:39:27 debian-s-1vcpu-1gb-ams3-01 systemd[1]: Failed to start Docker Application Container Engine.
I've tried sudo, i've tried to set up groups, i've tried chmod 777 /var/run/docker.sock but it's the same...
Apparently, when i run sudo dockerd, i get an error saying
unable to configure the Docker daemon with file /etc/docker/daemon.json: invalid character '}' looking for beginning of object key string
I indeed tried to set docker proxy to false in dameon.json however when i look at the file it seems alright: GNU nano 5.4 /etc/docker/daemon.json
{"debug": true,
"userland-proxy":false,
"iptables":true,}
It was a typo for the last comma!