Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to execute script docker-compose

I use mac 10.11.6 El capitan and i installed docker toolbox and i am trying to use docker compose build option but i am throwing some errors as follows,

kj$ docker-compose -f docker-compose-dev.yml build
Traceback (most recent call last):
  File "docker-compose", line 6, in <module>
  File "compose/cli/main.py", line 71, in main
  File "compose/cli/main.py", line 124, in perform_command
  File "compose/cli/command.py", line 41, in project_from_options
  File "compose/cli/command.py", line 113, in get_project
  File "compose/config/config.py", line 380, in load
  File "compose/config/config.py", line 380, in <listcomp>
  File "compose/config/config.py", line 513, in process_config_file
  File "compose/config/config.py", line 221, in get_service_dicts
  File "distutils/version.py", line 46, in __eq__
  File "distutils/version.py", line 337, in _cmp
TypeError: '<' not supported between instances of 'str' and 'int'
[83046] Failed to execute script docker-compose

The content of yml file

version: '3.3'

services:

  users:
    build:
      context: ./
      dockerfile: Dockerfile-dev
    volumes:
      - './:/usr/src/app'
    ports:
      - 5001:5000
    environment:
      - FLASK_APP=project/__init__.py
      - FLASK_ENV=development

I am not sure what causes this problem, Please give your suggestions, Thanks

like image 988
KSp Avatar asked Mar 08 '19 22:03

KSp


2 Answers

The answer to this question is pretty straight forward, it happened to me this morning. When I finished working on my project I closed the docker app for Mac (mainly what the error says is that it cannot get the API version of Docker and or docker-compose). Make sure your Docker for desktop is running everything else should be back to normal.Check this image to see if docker desktop is running.

like image 147
Dan Mic Avatar answered Sep 20 '22 08:09

Dan Mic


I solved it by starting the docker service:

service docker start
like image 41
Jhonattan Peláez Avatar answered Sep 20 '22 08:09

Jhonattan Peláez