问题描述
我想安装这个模块,但是当我尝试步骤 docker-compose build ...
I want to install this module but there is something wrong when I try the step docker-compose build ...
我多次尝试更新docker版本并重新启动docker...但没有成功.
I tried to update the docker version and restart docker many times... But it didn't work.
git clone https://github/uhh-lt/158.git
cd 158
docker-compose build
File "/home/ming/.local/bin/docker-compose", line 8, in <module>
sys.exit(main())
File "/home/ming/.local/lib/python3.8/site-packages/compose/cli/main.py", line 67, in main
command()
File "/home/ming/.local/lib/python3.8/site-packages/compose/cli/main.py", line 123, in perform_command
project = project_from_options('.', options)
File "/home/ming/.local/lib/python3.8/site-packages/compose/cli/command.py", line 60, in project_from_options
return get_project(
File "/home/ming/.local/lib/python3.8/site-packages/compose/cli/command.py", line 131, in get_project
client = get_client(
File "/home/ming/.local/lib/python3.8/site-packages/compose/cli/docker_client.py", line 41, in get_client
client = docker_client(
File "/home/ming/.local/lib/python3.8/site-packages/compose/cli/docker_client.py", line 170, in docker_client
client = APIClient(**kwargs)
File "/home/ming/.local/lib/python3.8/site-packages/docker/api/client.py", line 188, in __init__
self._version = self._retrieve_server_version()
File "/home/ming/.local/lib/python3.8/site-packages/docker/api/client.py", line 212, in _retrieve_server_version
raise DockerException(
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
2020.11.23
感谢你们两个帮助我解决错误!我尝试了推荐但无法连接到我的 docker...
Thanks for two of you helping me with the error! I tried the commend but can't connect to my docker...
ming@KITM-7664:~$ sudo /etc/init.d/docker start
[sudo] password for ming:
* Starting Docker: docker [ OK ]
ming@KITM-7664:~$ which docker
/usr/bin/docker
ming@KITM-7664:~$ docker version
Client: Docker Engine - Community
Version: 19.03.13
API version: 1.40
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 17:02:52 2020
OS/Arch: linux/amd64
Experimental: false
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
ming@KITM-7664:~$ systemctl status docker
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
ming@KITM-7664:~$ systemctl start docker
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
ming@KITM-7664:~$ sudo /etc/init.d/docker start
* Starting Docker: docker [ OK ]
ming@KITM-7664:~$ docker version
Client: Docker Engine - Community
Version: 19.03.13
API version: 1.40
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 17:02:52 2020
OS/Arch: linux/amd64
Experimental: false
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
推荐答案
您确定 docker 正在您的系统上运行吗?当 compose 无法通过 docker 套接字连接到 docker 时,您可能会收到该错误(如果未定义任何其他连接方式).
Are you sure docker is running on your system? You can get that error when compose is not able to connect to docker via docker socket (if any other way for connection is not defined).
如果你在linux上运行,通常你可以运行systemctl status docker
来检查docker daemon是否正在运行,然后systemctl start docker
来启动它.
If you are running on linux, usually you can run systemctl status docker
to check if docker daemon is running and systemctl start docker
to start it.
这有助于说明您使用的是什么操作系统和 docker 版本
.
It would help to tell what OS and docker version
are you using.
这篇关于docker.errors.DockerException:获取服务器 API 版本时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论