basilinjoe
(Basilin Joe)
January 16, 2020, 8:02am
1
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.
I am getting the above error on Ubuntu 18 machine when running docker compose on jenkins workspace /var/lib/jenkins/workspace
docker-compose version 1.25.1, build a82fef07
Docker version 19.03.5, build 633a0ea838
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic
systemctl status docker.service
Jan 16 06:57:53 Wdsys dockerd[19160]: time="2020-01-16T06:57:53.569004581Z" level=error msg="Handler for POST /v1.30/build returned error: invalid reference format"
riadhoq
(Riadhoq)
March 12, 2020, 4:38pm
2
From https://github.com/docker/compose/issues/4181
Add user to docker group (if not already added)
sudo usermod -aG docker $USER
2. create a symbolic link to /usr/bin using the following command
$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
3. Restart docker service
$ sudo service docker restart
I had the same issue.
sudo service docker restart worked for me.
Thanks @riadhoq
aylusltd
(Aylusltd)
October 14, 2021, 7:58pm
4
I had to run sudo docker-compose up. Apparently docker was running as root because of sudo systemctl start docker and my user couldn’t access it.
4 Likes
anelson82
(Anelson82)
November 17, 2021, 2:18pm
5
Yeah, adding the sudo in front, helped me. Thanks
2 Likes
algaebarn
(Algaebarn)
January 5, 2022, 1:23am
6
as mentioned above sudo docker-compose up fixed the problem for me.
1 Like
michel3344
(Michel3344)
January 19, 2022, 11:10pm
7
Add sudo before CLI worked for me
1 Like
idsej
(Idsej)
June 14, 2022, 9:07pm
10
lol, I did this mistake too. Thanks
As mentioned above sudo docker-compose up -d --build fixed the problem for me too
1 Like
aprmswra
(Arbi Parameswara)
September 4, 2024, 1:07pm
12
thanks a lot, worked for me