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

后端 未结 6 1513
渐次进展
渐次进展 2020-12-30 07:30

Problem: I am trying to run docker inside vagrant, my Vagrantfile contains following:-

  config.vm.provision \"docker\" do |d|
     d.run \"ubuntu\",
                


        
相关标签:
6条回答
  • 2020-12-30 07:48

    i've gotten the same error response. when i checkout the daemon.json file, and i found that

    {
         "registry-mirrors": ["http://hub-mirror.c.163.com"]
         "graph": "/etc/docker/mirror"
    }
    

    as you can see, i missed "," so i corrected it so simple. how careless i was!

    {
         "registry-mirrors": ["http://hub-mirror.c.163.com"],
         "graph": "/etc/docker/mirror"
    }
    

    sometimes you need check your code carefully

    0 讨论(0)
  • 2020-12-30 07:51

    On your ssh server, run:

    1. systemctl start docker

    2. systemctl status docker

    Docker will start on the server and have a socket on its respective.

    0 讨论(0)
  • 2020-12-30 07:52

    In my case I had to do:

    sudo rm /var/run/docker.pid
    sudo docker start [my_container]
    
    0 讨论(0)
  • 2020-12-30 07:59

    I faced a similar issue, running the command sudo service docker restart, followed by restarting the docker image fixed the issue for me

    0 讨论(0)
  • 2020-12-30 08:11

    Start docker deamon by systemctl start docker.service

    Be sure to run command as superuser

    0 讨论(0)
  • 2020-12-30 08:15

    Here is what happened to me and what could be a possible solution for someone else. I'm running on Ubuntu 16.04.

    I ultimately purged and reinstalled everything from the docker-ce install. I mean everything. Still not working...

    Through my internet wizardry I was able to find an article (I can't recall where, there were so many) mentioning that the file located at:

    $ sudo nano /etc/systemd/system/docker.service

    Had a -d in the place of the daemon at Execstart. That wasn't the case for me. I had ...daemon -D..., but I did notice that it was pointing to /usr/bin/local/docker. That didn't exist, but what does exist is /usr/bin/docker. In that location you will also find docker-containerd, dockerd, etc...

    Anyway, I made the change to the docker.service file--simply dropping /local out of there. Saved. Then:

    $ systemctl daemon-reload
    $ sudo service docker restart
    $ sudo service docker status (should see active (running))
    $ sudo docker run hello-world
    

    Success!

    0 讨论(0)
提交回复
热议问题