Closed matteo-bombelli closed 7 years ago
this worked for me
sudo chown $USER:docker /var/run/docker.sock
usermod -a -G docker USER Then logout and login again USER.
I encountered the same error whenever I had a variable inside docker-compose.yml that is NOT present within .env.
Weird error for such scenario but - whatever. :)
just type
sudo
before yourdocker-compose
command!
Take your like, sir! omg..., but works fine for me, great job!
i just had to do: sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
and it worked!
Yo instalรฉ docker-compose y la vez resolvรญe el problema con los siguientes pasos:
paso 1:
sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s-
uname -m` -o /usr/local/bin/docker-compose
paso 2: sudo chmod +x /usr/local/bin/docker-compose
paso 3: docker-compose --version
paso 4: export DOCKER_HOST=127.0.0.1:2375
paso 5: usermod -a -G docker $USER
paso 6: Reiniciar tu pc o ejecutar el comando shutdown
This worked for me:
sudo usermod -aG docker $(whoami)
logout
login
check to be sure you are in the "docker" group.
- sudo chown $USER:docker /var/run/docker.sock
This worked for me in a ubuntu 18 setup.
thx!
Hello, got same error message:
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running? If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
But this message was misleading, because my docker deamon does not had any problems in connections. The reason was a stupid mistake I made in the Yaml (which I didn't know before). I accidentally had a capital letter in the image name. That led to the fact that the service could not be formed, since only lower case letters are permitted as names. I noticed the error when I tried to build the Dockerfile separately with the names. It would be handy if docker-compose could forward the errors that occur within build problems. Since, as @shin- also said, this bug can still occur for many reasons at this time. Even though it's been some time since @shin- wrote this, the problem still seems to exist. Maybe it might be helpful.
Just posting my issue here, cause everyone is strictly thinking on real connection problems with docker and i wanted to show, that it does not need to be always the case.
$ cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)
$ sudo service docker start
$ sudo service docker status
Hello,
I faced the same issue. But it got resolved after I restarted my VM.
BR.Saurabh
that command solves to me:
sudo usermod -aG docker user
commands:
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose sudo docker-compose up -d
If you just installed docker and just granted a user the docker group try logging out of that user and logging back in again.
sudo service docker start && docker-compose up -d
Please try with above command. Issue is fixed for me
None of the listed above solutions have fixed it for me. Any other ideas?
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
resolvi o problema com esse comando:
sudo chown $USER:docker /var/run/docker.sock
๐๐ป๐๐ป๐๐ป๐๐ป๐๐ป๐๐ป ๐๐ฝSOLUTION ๐ ๐๐ฟ๐๐ฟ๐๐ฟ๐๐ฟ๐๐ฟ๐๐ฟ
if you haven't tried anything yet from this tread run these two commands and it will solve this particular problem:
sudo usermod -a -G docker $USER
# adds your current user to docker
group
newgrp docker
# activates new permissions for docker
group
sudo usermod -a -G docker $USER # adds your current user to docker group newgrp docker # activates new permissions for docker group
Should be newgrp -l docker
. When using this people should be aware that newgrp starts a new shell so their environment will be reset as if they logged in freshly again if they use -l
.
First we need to remount tmp with exec permission by executing
sudo docker-compose up -d ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable. ๅ ไธsudoไนๆฏๆฅๅๆ ท็้่ฏฏ
groups root root : root docker rootๅจdocker็ปไธ
Resolved the issue with this:
sudo usermod -aG docker $USER
docker info
The default DOCKER_HOST is unix:///var/run/docker.sock . If this file doesn't exist or your current user doesn't have access to that file then its trying to connect to http+docker://localhost
Try:
sudo chown /var/run/docker.sock
Then again try to run docker-compose up
Worked for me.
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
? Thanks! it works!
But please Docker, add a correct warning!
i got this message when copying volumes from poruction machine, ended up to owerdrite metadata.db
inside /var/lib/docker/volumes
, then it crashes. A fix is so smiple
docker system prune --volumes -f && rm /var/lib/docker/volumes/metadata.db && docker-compose up -d
This often happens when you run docker commands as sudo whiles you run docker-compose commands without it. What you need to do is to add docker user to the sudo group. (ie. usermod -aG docker $USER) Then you can run both comands (docker and docker-compose) without sudo.
I had exactly the same error. I removed the container (id) and started the docker again. That fixed the problem for me. It doesn't delete any data which was already uploaded.
Go into your cvat directory and run the following in your terminal:
i have the same problem, sudo docker-compose up work for me.
The solution for me was to stop my openvpn
that I was using.
I am not sure what happened, I restarted my PC and it started working!!
This works.
the following steps solved the problem for me.
remove docker:
$ sudo apt-get remove docker docker-engine
reinstall withcurl -sSL https://get.docker.com/ | sh
add user to a group:
sudo usermod -aG docker user
Just a note that you need to exit
the shell and login again for the usermod
command to stick.
I just suffered again same issue as before, and found sime light at the end... It it is related to that docker-compose shows this weird message hiding the real issue. I just tried to build one of the images with docker build . and then it showed up that some files trying to be included in the cache had no permissions to read and build failed. Once removed issued files it started working again with no issues. In my case mounting current dir was the issue as test generate directories with root users on the hosts So next time build failed because it can't read and start failing build with no clear messsage from docker-compose build. Need to check user run test to avoid the issue later but hope this helps others to find the real issue.
Regards
add regular users to the docker group
# usermod -a -G docker user
# exit
$ exec $SHELL
$ docker-compose ps
I fixed this by unsetting the CONTAINER_REGISTRY_BASE
variable
$ sudo usermod -aG docker $USER
I found it was a missing environment variable that was breaking the image:
settings in docker-compose.yml
ยฏ_(ใ)_/ยฏ
the following steps solved the problem for me.
remove docker:
$ sudo apt-get remove docker docker-engine
reinstall withcurl -sSL https://get.docker.com/ | sh
add user to a group:
sudo usermod -aG docker user
Thank You. Uninstalling, then reinstalling and changing user permissions and logging out and logging back in solved it for me.
None of the listed above solutions have fixed it for me. Any other ideas? ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running? If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
resolvi o problema com esse comando:
sudo chown $USER:docker /var/run/docker.sock
This fixed it for me.
I did everything except symbolically linking to docker-compose. Following commands fixed my issue
sudo usermod -aG docker $USER
$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
$ sudo service docker restart
In my case, none of the above worked
As it turned out, in my compose file I had a camelCase
image name (eg imageName
), and that was causing Couldn't connect to Docker daemon at http+docker://localunixsocket
. Changing that to dash-case
solved the problem (very strange).
Docker service was running fine, docker ps and info were also reporting no issues, just launching that compose file was the issue.
Ubuntu 18.04
docker 19.03.6
docker-compose 1.17.1 (compose file version 3)
sudo docker-compose up -d
just faced this issue again and realized I must restart Ubuntu after adding mu user to Docker group
sudo usermod -aG docker user
This by @Kirill-Babkin solved it for me. I had newly created user not in docker group. Thanks.
In my case my docker-compose.yml
was missing env var definition on image
section
prod-image-generation:
image: my-image:${BUILD_NUMBER}
I Lost about 30 minutes with it. Please suggest a meaningful error for this
Solution was set a value for the var
Just the empty export worked for me.
export DOCKER_HOST=
Fresh Docker installation here in Ubuntu 18. Assuming your user is already in the docker
group, just install the docker service so it autostarts sudo systemctl enable docker
then restart and voila sudo init 6
Had the same problem. Solved on my system by writing "docker-compose build"
I just had the same issue. I found that for some reason my user was not added to the docker security group, in turn not allowing me permission on docker's unix socket and giving me ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running.
Adding the docker group to my current user, then logging out and back in again fixed everything for me:
sudo usermod -aG docker $USER
Followed this, then restarted the machine, and ran docker-compose up --build
๐
show
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:
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!