docker - 在本地计算机上运行 `docker-compose up` 时出现 FileNotFound 错误

标签 docker

运行 docker-compose up 时,我在 CLI 中遇到了以下错误。网上有的回答推荐自己使用pip或者brew install docker-compose。这不成功:

...
  File "http/client.py", line 1010, in _send_output
  File "http/client.py", line 950, in send
  File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker/api/client.py", line 214, 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 237, 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.', FileNotFoundError(2, 'No such file or directory'))

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 81, in main
  File "compose/cli/main.py", line 200, in perform_command
  File "compose/cli/command.py", line 60, in project_from_options
  File "compose/cli/command.py", line 152, in get_project
  File "compose/cli/docker_client.py", line 41, in get_client
  File "compose/cli/docker_client.py", line 170, in docker_client
  File "docker/api/client.py", line 197, in __init__
  File "docker/api/client.py", line 221, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
[5328] Failed to execute script docker-compose

最佳答案

问题很简单,就是 Docker 守护进程没有运行。

让 docker 守护进程运行,然后重新运行 docker-compose up 命令

关于docker - 在本地计算机上运行 `docker-compose up` 时出现 FileNotFound 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68009556/

相关文章:

php - 如何正确链接 2 个容器?

docker - 使用 docker-compose 将多个 docker 容器链接到一个别名为 localhost 的容器

php - Docker 容器关闭脚本

docker - "Caching"中间 Docker 构建

docker - 从服务发现的角度来看,docker swarm 与 kubernetes 之间有什么区别

shell - 错误 : unexpected end of file (expecting "do") for shell script in Dockerfile

docker - 如何在 Kubernetes 中将用于容器的 Docker 镜像的摘要作为环境变量传递

python - 无法解决以10为底的int()的基本错误无效文字

带有 Docker 1.12 服务的 Mongodb 副本集

docker - Reflex Golang与docker,docker-compose和makefile