Docker command can't connect to Docker daemon

后端 未结 23 3176
有刺的猬
有刺的猬 2020-12-02 04:01

I want to make a move to Docker, so I\'ve just started to mess around with it. I\'ve installed Docker on a VirtualBox Ubuntu 15.10 (Wily Werewolf) installation and as sugges

23条回答
  •  悲哀的现实
    2020-12-02 04:36

    Usually, the following command does the trick:

    sudo service docker restart
    

    This, instead of docker start for the cases where Docker seems to already be running.

    If that works then, as suggested and in another answer and on this GitHub issue, if you haven't added yourself in the docker group do it by running:

    sudo usermod -aG docker  
    

    And you're most likely good to go.


    As for anybody else bumping into this, in some OS's docker doesn't start right after you install it and, as a result, the same can't connect to daemon message appears. In this case you can first verify that Docker is indeed not running by checking the status of your docker service by executing:

    sudo service docker status
    

    If the output looks something like: docker stop/waiting instead of docker start/running, process 15378 then it obviously means Docker is not active. In this case make sure you start it with:

    sudo service docker start
    

    And, as before, you'll most likely be good to go.

提交回复
热议问题