Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to execute script docker-compose YML file in Windows 10

I'm using windows 10 and docker toolbox and as I try docker compose up --build option, I get the following errors:

pywintypes.error: (2, 'CreateFile', 'The system cannot find the file specified.')

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

The full extract is as follows:

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 File is below:

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"

I am not sure what causes this problem, as I am new to docker. Please give your suggestions, Thanks.

like image 593
Humair Ali Avatar asked Jun 08 '26 06:06

Humair Ali


1 Answers

Verify that Docker is started and try again

like image 146
jafojial Avatar answered Jun 10 '26 20:06

jafojial