docker - 在本地机器上运行 `docker-compose up` 时出现 FileNotFound 错误
问题描述
运行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
命令
推荐阅读
- c - 使用从 C 中的文件读取的值进行冒泡排序
- postgresql - 与 Kotlin 一起使用 JDBI 中的 NoSuchMethodException
- python - 如何 pip 从只读目录安装软件包?
- javascript - 将 axios 请求传递给 vue.js 中的子组件
- python - Django REST FileUpload Parser 不适用于图像
- css - LESS CSS 条件不评估 iscolor
- apache-spark - 使用 pyspark 中的 groupBy 函数使用 QuantileDiscretizer 进行分桶
- c++ - “未定义引用”Ros Cpp 库问题
- python - 使用 Django 和数据库代码的连接中止错误
- python - 使用 Fastai 的并行函数进行 pandas 聚合