gpt4 book ai didi

javascript - 无法在 Windows 10 中执行脚本 docker-compose YML 文件

转载 作者:行者123 更新时间:2023-12-02 16:15:22 24 4
gpt4 key购买 nike

我正在使用 Windows 10 和 docker 工具箱,当我尝试 docker compose up --build 选项时,出现以下错误:

pywintypes.error: (2, 'CreateFile', '系统找不到指定的文件。')

docker.errors.DockerException: Error while fetching server API version: (2, 'CreateFile', 'The system cannot find the file specified.') [8628] 无法执行脚本 docker-compose

全文摘录如下:

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 439, in send
File "urllib3\connectionpool.py", line 670, in urlopen
File "urllib3\connectionpool.py", line 392, in _make_request
File "http\client.py", line 1255, in request
File "http\client.py", line 1301, in _send_request
File "http\client.py", line 1250, in endheaders
File "http\client.py", line 1010, in _send_output
File "http\client.py", line 950, in send
File "docker\transport\npipeconn.py", line 32, in connect
File "docker\transport\npipesocket.py", line 23, in wrapped
File "docker\transport\npipesocket.py", line 72, in connect
File "docker\transport\npipesocket.py", line 52, in connect
pywintypes.error: (2, 'CreateFile', 'The system cannot find the file specified.')

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 80, in main
File "compose\cli\main.py", line 189, 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: (2, 'CreateFile', 'The system cannot find the file specified.')
[8628] Failed to execute script docker-compose

Docker Compose YML 文件如下:

services:
frontend:
build: frontend
depends_on:
- api
tty: true
volumes:
- ./frontend/public:/frontend/public:cached,ro
- ./frontend/src:/frontend/src:cached,ro
ports:
- "3000:3000"

api:
build: backend
depends_on:
- database
tty: true
volumes:
- ./backend/bin:/backend/bin:cached,ro
- ./backend/src:/backend/src:cached,ro
ports:
- "3001:3001"
environment:
DATABASE_USER: "root"
DATABASE_PASSWORD: "1234"

database:
image: mongo:4.4
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: "root"
MONGO_INITDB_ROOT_PASSWORD: "1234"

我不确定是什么导致了这个问题,因为我是 docker 的新手。请提出您的建议,谢谢。

最佳答案

验证Docker是否启动并重试

关于javascript - 无法在 Windows 10 中执行脚本 docker-compose YML 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66902065/

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