gpt4 book ai didi

php - Docker-compose up : Error while fetching server API version: ('Connection aborted.' , ConnectionRefusedError(61, 'Connection refused' ))

转载 作者:行者123 更新时间:2023-12-03 16:29:59 26 4
gpt4 key购买 nike

我正在尝试做 docker-compose up命令在我的终端。首先,我导航到找到 docker-compose.yaml 的文件目录。然后我写命令。服务器在端口 80 上。我收到以下错误:

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

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "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 "site-packages/docker/api/client.py", line 188, in __init__
File "site-packages/docker/api/client.py", line 213, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', ConnectionRefusedError(61, 'Connection refused'))
[12728] Failed to execute script docker-compose
第一个错误出现两次,然后出现第二次。

最佳答案

将您的用户添加到 docker 组并重试。

sudo gpasswd -a $USER docker
newgrp docker
如果问题仍然存在,您可以在注销并重新登录后尝试,或者重新启动。或者干脆做:
sudo su $USER
注意:如果您的机器上没有运行 docker,这也可能发生。对于带有 sytemd 服务管理器的 linux,您可以使用以下命令进行验证:
systemctl status docker.service

关于php - Docker-compose up : Error while fetching server API version: ('Connection aborted.' , ConnectionRefusedError(61, 'Connection refused' )),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64662372/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com