I have installed docker on rhel 8.3 from docker binaries by using command /usr/bin/dockerd & .
every month or after 2 months I get Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? this issue but meanwhile in the background my all containers & services are working only I can’t use the docker command. so in a such case, I kill dockerd process & then restart the docker daemon. is there any other solution instead of the killing process? because of this, I go through data loss issue. I also added a user in the docker group, all binaries have 777 permission as well docker.sock file also. please help me with the solution
2
Answers
I had this problem, Docker was working but I couldn’t execute Docker commands.
This was because the symlink of the docker.sock was not correct.
The path /var/run/docker.sock points to /Users/user1/.docker/run/docker.sock instead of /Users/admin/.docker/run/docker.sock
To solve the problem I deleted the bad symlink and recreated it correctly.
make sure you change the path in the example by your actual path.
Try to run all your docker commands with prefix sudo, like:
Or try below command to avoid using sudo every time, if you have are running on a Linux system or change commands accordingly
Create the docker group
Add your user to the docker group.
Make sure to restart your system once you run these commands.