I am getting an error message saying I can\'t connect to the docker daemon. I have looked into other people\'s answers who have had similar issues but it hasn\'t helped. I
In my case your docker service might be stopped
Command to start docker service:
$ sudo systemctl start docker
Command to verify if it start:
$ sudo docker run hello-world
I used Ubuntu 16.04 and found this problem too when I used docker-compose. I fixed it by running this command.
$ sudo systemctl start docker
$ sudo docker-compose build
Is there slight possibility you deleted default machine? But, first check if all files are there (OSX, similar on other systems)
brew install docker docker-compose docker-machine xhyve docker-machine-driver-xhyve
brew link docker docker-compose docker-machine xhyve docker-machine-driver-xhyve
sudo chown root:wheel /usr/local/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
sudo chmod u+s /usr/local/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
Also, install Docker App, as it much easier to maintain containers:
brew cask reinstall docker
ans start Docker app from finder (wait until service is fully started)
Then, check instalation with:
docker-machine ls
if no machines are present in list, create one and start it:
docker-machine create default
docker-machine start default
After this, build, compose and all other commands should work properly.
just try with sudo
. It seems like permission issue!
sudo docker-compose -f docker-compose-deps.yml up -d
it worked for me.
Another reason why this error can show up: for me it was a malformed image-path definition in the docker-compose.yml
:
service:
image: ${CONTAINER_REGISTRY_BASE}/my-service
...
Lookis ok'ish first, but i had CONTAINER_REGISTRY_BASE=eu.gcr.io/my-project/
set on the env. Apparently the //
in the image path caused this error.
docker-compose: v.1.21.2
docker: 18.03.1-ce
I got this error when there were files in the Dockerfile
directory that were not accessible by the current user. docker
could thus not upload the full context to the daemon and brought the "Couldn't connect to Docker daemon at http+docker://localunixsocket" message.