Ubuntu 16.04 - > ERROR: Couldn't connect to Docker daemon - you might need to run `docker-machine start default`

前端 未结 15 2186
北恋
北恋 2021-02-03 17:48

I am getting error on ubuntu 16.04

\"ERROR: Couldn\'t connect to Docker daemon - you might need to run docker- machine start default. \"

相关标签:
15条回答
  • 2021-02-03 18:00

    Try running with root: sudo docker-compose build

    0 讨论(0)
  • 2021-02-03 18:01

    I noticed that I got this error after installing docker-compose. Trying to runsudo docker-compose build gave me the error --

    ERROR: Couldn't connect to Docker daemon. You might need to install Docker

    I solved this by installing docker-ce (Ubuntu 16.04 and 18.04). Everything worked as expected thereafter

    0 讨论(0)
  • 2021-02-03 18:04

    I had this same error 10 minutes ago and solved it by doing:

    sudo snap remove docker
    

    when finished:

    sudo snap install docker
    

    Problem solved.

    0 讨论(0)
  • 2021-02-03 18:07

    You should add your user in docker group. And then, you can use docker command without 'sudo'.

    $ sudo usermod -aG docker ${USER}
    $ sudo service docker restart
    

    Next, you have to logout in your OS. Finally, when you login, you can use docker command without 'sudo'.

    0 讨论(0)
  • 2021-02-03 18:08

    Sometimes, this error appears if you built stack before. Reason of giving error is migh be file permissions. If in building process docker generates new files or edits some files, there will be some root owned files.

    So, if the reason is permissions, make your user the owner of all application files.

    $ sudo chown -R ${USER} .
    
    0 讨论(0)
  • 2021-02-03 18:12

    After installing can execute command to have access to docker functionality without sudo. In my sitation, with same errors all is resolved after :

    $ sudo usermod -aG docker ${USER}
    $ su - ${USER}
    $ id -n
    $ sudo usermod -aG docker username
    

    and can restart docker after that:

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