Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to docker-compose up any project

Whenever I try to docker-compose up any project I get the following error. I've tried with and without sudo I am only having this issue on this machine. I am able to run the same containers on my Mac and Amazon WorkSpace.

(myslabs) [austin@localhost myslabs]$ sudo docker-compose up
[sudo] password for austin: 
Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/adapters.py", line 449, in send
  File "urllib3/connectionpool.py", line 727, in urlopen
  File "urllib3/util/retry.py", line 403, in increment
  File "urllib3/packages/six.py", line 734, in reraise
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionRefusedError(111, 'Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker/api/client.py", line 205, in _retrieve_server_version
  File "docker/api/daemon.py", line 181, in version
  File "docker/utils/decorators.py", line 46, in inner
  File "docker/api/client.py", line 228, in _get
  File "requests/sessions.py", line 543, in get
  File "requests/sessions.py", line 530, in request
  File "requests/sessions.py", line 643, in send
  File "requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionRefusedError(111, 'Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "bin/docker-compose", line 3, in <module>
  File "compose/cli/main.py", line 67, in main
  File "compose/cli/main.py", line 123, in perform_command
  File "compose/cli/command.py", line 69, in project_from_options
  File "compose/cli/command.py", line 132, in get_project
  File "compose/cli/docker_client.py", line 43, in get_client
  File "compose/cli/docker_client.py", line 170, in docker_client
  File "docker/api/client.py", line 188, in __init__
  File "docker/api/client.py", line 213, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', ConnectionRefusedError(111, 'Connection refused'))
[142201] Failed to execute script docker-compose

I've not been able to find any articles about any similar issues. I am using Centos 8 running inside of a VirtualBox on Windows.

(myslabs) [austin@localhost myslabs]$ docker --version
Docker version 19.03.13, build 4484c46d9d
(myslabs) [austin@localhost myslabs]$ docker-compose --version
docker-compose version 1.27.3, build 4092ae5d

Any help would greatly be appreciated.

like image 532
Austin Gilkison Avatar asked Oct 01 '20 21:10

Austin Gilkison


People also ask

How do I force recreate Docker compose?

If you want to force Compose to stop and recreate all containers, use the --force-recreate flag. If the process encounters an error, the exit code for this command is 1 . If the process is interrupted using SIGINT (ctrl + C) or SIGTERM , the containers are stopped, and the exit code is 0 .

How to start docker-compose up if it is not running?

If it is not running, use the command sudo service docker start to get it running before sudo docker-compose up Interesting. Mine doesn't come up with "start". No error, though. Sometimes docker service is stopped. You can check it and restart.Normally happens if error iscontainer. can pruine and start again.

Why is my Docker container not working on Windows?

Please restart docker containers and it will work fine. This issue comes mainly in the case of windows. restart your docker container.

Does docker-compose ever re-build the underlying images?

Notable in this step is that no underlying images are re-built. In re-creating the container, docker-compose seems to figure out to use the newer volume that has the updated node_modules. See the output directory for the output printed during the first run (steps 4 and 5) and the second run (steps 8 and 9).

How do I Ping An app in Docker Compose?

ping: app: Name or service not known First command: we tell docker-compose that we want to execute command “ ping app ” in the service app’s container, and you can see that app is resolved to 172.23.0.2 — this is the app ’s IP address in the docker-compose network.


3 Answers

I also encountered the same error as you,My problem is that docker does not start.

  • check docker status systemctl status docker

  • systemctl start docker

  • docker-compose up try again

  • systemctl enable docker to start on boot

like image 65
Grocker Avatar answered Oct 20 '22 03:10

Grocker


If you're on a Mac, it may mean that Docker itself isn't running. I had rebooted my Mac and Docker wasn't set to automatically launch at login. You can set this as a Docker preference.

like image 15
Chris Garrett Avatar answered Oct 20 '22 03:10

Chris Garrett


If nothing works, run:

sudo chmod +x /usr/local/bin/docker-compose

sudo docker-compose up -d
like image 4
zencoder Avatar answered Oct 20 '22 04:10

zencoder