I am getting error on ubuntu 16.04
\"ERROR: Couldn\'t connect to Docker daemon - you might need to run
docker- machine start default
. \"
Try running with root: sudo docker-compose build
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
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.
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'.
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} .
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