Docker daemon fails - docker

I am using Ubuntu 14.04 on Dell Latitude E6430 and have installed docker.io package. Now whenever I restart my system, first docker command fails with message
Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
Hence to fix this i run below command and daemon works like charm
ps -ef |grep docker
kill -9 *pid found* | rm /var/run/docker.pid
I have check previous questions and none answer this behaviour
Any idea why is breaking ?

Related

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

Even though my user is on docker group and I can launch docker without sudo, and I'm running idea.sh from my user, whenever I try to connect to docker from within Intellij Idea docker plugin, I get
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
I'm trying the Unix socket method. I already tried multiple restarts and logout.
I'm on Ubuntu 20.04 and Intellijd Idea 2020.3
Adding current user to docker group worked for me:
sudo gpasswd -a ${USER} docker
You might need to create group first:
sudo groupadd docker
restart your OS after those changes
For me it work
sudo chmod 0777 /var/run/docker.sock
Then test this in the terminal without the sudo
docker ps -a
normally you should have access to the docker process

Is there a way to kill a docker container that hangs for "stop" and "kill"?

I have a docker container that when I call:
docker container stop wcfservicesample
or
docker container kill wcfservicesample
It just "hangs". (Meaning the powershell command never returns.)
Is there some way to kill a container that is more forceful than "kill"?
Maybe itis too late, but What helped me under ubuntu linux was:
sudo systemctl restart docker && docker rm -f <<container_id>> ...
I dont know why it do work only on docker restart/

docker: Cannot connect to the Docker daemon on Mac OS X

I got the following error when I run docker. Does anybody know how to fix the problem. The OS is Mac OS X.
$ docker --version
Docker version 17.12.0-ce, build c97c6d6
$ docker run hello-world
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.
You can restart Docker with the following
Stop Docker for Mac gracefully
Stop all Docker containers without confirmation (make sure nothing is running in Docker)
docker ps -q | xargs -L1 docker stop
Requires all Docker containers are stopped
test -z "$(docker ps -q 2>/dev/null)" && osascript -e 'quit app "Docker"'
Start Docker gracefully
open --background -a Docker
I just found out that I have to restart my docker desktop as well. I had no idea that docker desktop and terminal's docker command are related. But now, apparently, they are related. If anyone encounters similar problems, remember to try restart your docker desktop and wait for it to get running!

Docker not working after installation

I tried installing the docker using the linux method.
However when the command $docker run hello-world is executed, it outputs:
docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?.
See 'docker run --help'.
What can be done about this?
First of all make sure the daemon is running:
$ps aux|grep "docker daemon"|grep -v "grep"
A) The daemon is not launched (no lines are returned by the ps)
Start the daemon that is not working:
$sudo /usr/bin/docker daemon -H unix:///var/run/docker.sock
Or start it as a service with:
$sudo /usr/sbin/service docker start
At this point the daemon is launched.
B) The daemon is launched
As shown by the ps with something like:
[..] /usr/bin/docker daemon -H unix:///var/run/docker.sock
You're good to go with your first container with a:
$sudo docker run hello-world.
sudo and docker
If you want to use docker without being sudo (this you should, though you must be aware of the security warning!) a good read of this will help you.
You have to run this command as sudo.
sudo docker run hello-world
This will give you enough privileges to perform that action.
If you want to enable your user to rung docker without sudo, then check out this answer.

Cannot connect to the Docker daemon. Is 'docker -d' running on this host?

I am trying to run my Docker commands, but I am facing the notification error in the title. I tried running:
ps auxww | grep docker
but still getting the error. Any solution?
If you can verify that the docker daemon is running then it may be that your user is not allowed to access docker.
To do this add yourself to the docker group.
sudo usermod -aG docker <userid>
Remember to do a re-login or otherwise apply/activate the new group permission.
newgrp docker
How about launching the daemon
sudo service docker start
should do the trick.
Or
sudo docker -d
In my case I had multiple docker instances running so it didn't know what to attach to. After killing them and restarting, my problem was solved.

Resources