Repository navigation
Closed
Labels
Description
I know that there is another issue of the same type but the other issue is closed and I tried all the solutions proposed but with no effect.
still not working:
matteo@ubuntuDockerMB:~/wordpress-docker$ sudo docker -v
Docker version 1.12.3, build 6b644ec
matteo@ubuntuDockerMB:~/wordpress-docker$ sudo docker-compose up
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
matteo@ubuntuDockerMB:~/wordpress-docker$ sudo service docker start
start: Job is already running: docker
matteo@ubuntuDockerMB:~/wordpress-docker$ echo $DOCKER_HOST
matteo@ubuntuDockerMB:~/wordpress-docker$ DOCKER_HOST=127.0.0.1
matteo@ubuntuDockerMB:~/wordpress-docker$ echo $DOCKER_HOST
127.0.0.1
matteo@ubuntuDockerMB:~/wordpress-docker$ sudo docker-compose up
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
matteo@ubuntuDockerMB:~/wordpress-docker$ unset DOCKER_HOST
matteo@ubuntuDockerMB:~/wordpress-docker$ sudo docker-compose up
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
matteo@ubuntuDockerMB:~/wordpress-docker$ groups matteo
matteo : matteo adm cdrom sudo dip plugdev sambashare lpadmin docker
-
I'm part of the docker group
-
I'm using also sudo
-
The process is up
-
The DOCKER_HOST variable is unset or 127.0.0.1
-
Reconnected the user
-
Restarted the server
I think that I've tried all the possible configurations am I right?
Specs:
-
OS: Ubuntu 14.04.04 on Virtualbox on Windows 10 Home.
-
Docker version 1.12.3, build 6b644ec
Thank You!
Reacted by Pavol Travnik, Dmitry Murzin, Pavel-i-tel, Hyunjun Kim, Avishek , t3ran13, Lyle Hanson, Richard W Valdivia, Andrii Lutskevych, Naveen D N and 183 more
Reacted by Nguyễn Văn Thao, Bingyu Shen, christianshehata, 微笑 and hamzataougar
Reacted by Muhammad Bilal, lamvh, Pranshu Srivastava, Leo Borai, Promise Chukwuenyem, falken01, Ujjwal Kumar, minwooyoo, Faraz Ahmad and 微笑
Reacted by lamvh, Richard Nabaasa, Pranshu Srivastava, Mustafa Özyurt, Leo Borai, Dridi Lotfi, Paul R, Promise Chukwuenyem, Sergey Teplov, Shuangmu Hu and 10 more
Reacted by Bahman Enayatei, Ujjwal Kumar, Serge Närhi, Faraz Ahmad, 微笑 and Sergey
Reacted by -, Charles61, SoumilShekdar, Floricu Andreea, Ricardo Castaneda, Ujjwal Kumar, Serge Närhi, AditiGit0510, Fauzi Firdaus and 微笑
Activity
shin- commentedon Nov 29, 2016
Have you tried without
sudo? You shouldn't need it and it could be messing things up in your case. Also, what do you see when you rundocker info?harshajayaweeraXHJ commentedon Nov 29, 2016
Try running
dockerdorsudo dockerdif required first to start daemon. If you startdockerdwithsudoyou may want to rundocker-compose upwithsudoalso. otherwise it's fine.matteo-bombelli commentedon Dec 3, 2016
@shin- Hello! I've already done it with with sudo and also using root (
sudo su).here is the operation made as root
this is the result of
docker info@harshajayaweeraXHJ
dockerddoes not work butsudo service docker startworks as expectedPS:
@shin- & @harshajayaweeraXHJ Sorry for being late
jamethy commentedon Dec 22, 2016
You need to export the variable for it to be available in child processes:
Although this doesn't completely solve your issue...
I ran into this error because I foolishly ignored the ubuntu prerequisites.
matteo-bombelli commentedon Dec 23, 2016
thank you @jamethy, I,ve done just right that and i get
jorgeas80 commentedon Dec 23, 2016
Having the same problem now, also trying to install Wordpress under docker. Tried everything, but still can' t connect. Docker daemon is not running... I'll try it again
matteo-bombelli commentedon Dec 23, 2016
for me the problem stays there:
but this number should be created by docker itself
elikane commentedon Dec 30, 2016
I have the same problem as the original poster, and have tried all the suggested things above.
It seems that sometimes docker "dies" and is not running, and at other times it stays running. I noticed this while trying to run the
docker infocommand and getting an error about docker not running. Usingservice docker startthen allowed me to run the info command. This is what I got:shin- commentedon Jan 4, 2017
@matteo-bombelli This error is pretty clear, you need to specify a port. Do
export DOCKER_HOST=127.0.0.1:2375instead.ippo012 commentedon Jan 6, 2017
@matteo-bombelli
I had the same issue.
You need to restart docker.
$ service docker restartI solved it with this.
shashijais789 commentedon Feb 1, 2017
can anyone consolidate the solution for this problem in steps ?
lalitkumarj commentedon Feb 5, 2017
Hi. I second this last comment, I am having the same issue.
furkanmustafa commentedon Feb 8, 2017
I am having the same issue.
docker psworks.docker-compose build(with version 2) works!docker-compose build(with version 3) gives this error :/198 remaining items
Ivor commentedon Feb 11, 2021
Ubuntu 20.0.4 LTS
Initially with this command
I got the same error.
Then I saw the comment about changing the permissions on docker.sock
Then this worked:
Then I saw the comment about Ubuntu not adding the user to the docker group, so I
returned the docker.sock file to its original permissions:
and then I did
and then this worked:
dmytro-kerest commentedon Feb 17, 2021
it might help someone someday.
install docker-compose tool from docker website instructions and NOT from the repo of your distribution - in most cases it is outdated.
I have trie everything from the list here and the only thing that did work is installing latest docker-compose
aguschapuis commentedon Feb 25, 2021
Try with
sudo chmod 666 /var/run/docker.sockTaranchul commentedon Feb 25, 2021
This makes the file writable by every user which is a potential security risk in a system directory. That should only be considered as a last resort after trying the safer solution posted here before:
MUKESHBADIGINENI commentedon Mar 22, 2021
I tried the following process, it's working perfectly in my case.....!!
sudo docker-compose up -dklongbeard commentedon Apr 21, 2021
hey i'm late to the party I know but for anyone who gets this error on a live server just log out and back in again. When you add your user to the docker group you need to reload your terminal to get the updated permissions.
facundopadilla commentedon May 7, 2021
This work's me fine !
asmexcaliburwoods commentedon Aug 12, 2021
sudo chown -Rv someuser.someuser ~someuser/helped me to fix.someuseris the user i develop under and run docker-compose under it, too.vigi04 commentedon Aug 25, 2021
Sometimes, the error comes when the Image name contains uppercase characters..
service-name:
image: Abcd/Xyz
build: ..
corrected compose file
service-name:
image: abcd/xyz
build: ..
maxshuang commentedon Sep 6, 2021
work for me
hannwei commentedon Sep 11, 2021
"sudo docker-compose up" will most likely solve the problem.
But for people who do not want to sudo on docker-compose for security reasons, this may help :
sudo chgrp -R docker /var/run/dockerNo idea which file really needs it. But changing the group of all those docker files probably does not cause harm. That is a docker group anyway.
ahmedyounes commentedon Jan 23, 2022
in my case i was mentioning image in docker-compose.yml with variables im not using anymore
image: "${REGISTRY}/${IMAGE_NAME}:${GITHUB_SHA}"
Railkhayrullin commentedon Apr 15, 2022
If nothing helps, add to the folder with
docker-compose.ymlfile.envwith variable values fromdocker-compose.yml.example
.envfile:franco148 commentedon Dec 8, 2022
For some reason this is true, in my linux environment I had the same issue because there was
DOCKER_HOST=tcp://localhost:2375configured as environment variable. Removing it fixed the issue.k-caps commentedon Aug 26, 2024
Just to add my own 2 cents:
In my case the problem was an autogenerated .env file which used the git branch name as the docker tag. The branch name was 134 characters long, and docker tags can only be up to 128.