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-composeThe 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=developmentI am not sure what causes this problem, Please give your suggestions, Thanks
313 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.
2I solved it by starting the docker service:
service docker start 2 I was having the same problem as mentioned above:
[49326] Failed to execute script docker-compose
I am using Linux(ubuntu 20.04)
But the thing that I missed was that when I completed the docker install in the next steps it was mentioned as linuxpost-install steps. It clearly states that after the installation the docker always runs on the root. So until you have configured the non-root options on docker setting at this link should try using sudo before your command.
1Just make sure that the Docker app is opened on your machine
1In my side I have managed to resolve this by "Reset to factory defaults", i.e under docker preferences.
It Worked for me in Windows:
Control Panel => Program and Features => Turn Windows Feature on or off => enable all the option for Hyper-V
2to anyone who's trying to do this with --context, add host user to docker's group
on ssh host:sudo usermod -aG docker $USER
Just encountered this issue this morning on 10.14.6 (18G87) MacOS, which I just updated to this morning after everything was working perfectly yesterday.
Found out that one of my compose.yml files was using single quotes around the version when it should be double quotes. This fixed the issue for me. This is not a bug with Docker-compose.
GM
The reason for this issue is, Docker (engine) services is stopped.
Remember that in Docker-Docs you have to read "Post-installation steps" to "Configure Docker to start on boot".
ie. for Redhat/CentOs
$ sudo systemctl enable docker.service
$ sudo systemctl enable containerd.serviceRegards.
Restart the container resolved my issue.
I am using WSL 2 and I had to do enable integration with the WSL distro I am using. It's in Settings > Resources > WSL Integration.
I was trying tou lounch my back with the following command:docker-compose up --build
And I got this message:
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', PermissionError(13, 'Permission denied')) [5884] Failed to execute script docker-compose
All I had to do was to add "sudo" in front of the above mentioned command.sudo docker-compose up --buildAfter this my back is launched :))
Change the version to be double quotes, it worked for me. version: "3.3"
1