docker-compose reports it's version as dev, which breaks things
Description:
On Arch, docker-compose reports it's version as dev
$ docker compose version
Docker Compose version dev
This is an issue because a lot of tools depend on the version number to get correct behavior. In particular, it breaks the community.docker ansible collection. I didn't see any previous reports of this in the forums, and this repo has no issues right now.
Additional info:
- package version(s):
$ pacman -Q docker-compose
docker-compose 2.26.0-1
- link to upstream bug report, if any: Not exactly upstream, but https://github.com/ansible-collections/community.docker/issues/825
- Example of error:
Traceback (most recent call last):
File "<stdin>", line 107, in <module>
File "<stdin>", line 99, in _ansiballz_main
File "<stdin>", line 47, in invoke_module
File "<frozen runpy>", line 226, in run_module
File "<frozen runpy>", line 98, in _run_module_code
File "<frozen runpy>", line 88, in _run_code
File "/tmp/ansible_community.docker.docker_compose_v2_payload_9tu8jd7j/ansible_community.docker.docker_compose_v2_payload.zip/ansible_collections/community/docker/plugins/modules/docker_compose_v2.py", line 638, in <module>
File "/tmp/ansible_community.docker.docker_compose_v2_payload_9tu8jd7j/ansible_community.docker.docker_compose_v2_payload.zip/ansible_collections/community/docker/plugins/modules/docker_compose_v2.py", line 631, in main
File "/tmp/ansible_community.docker.docker_compose_v2_payload_9tu8jd7j/ansible_community.docker.docker_compose_v2_payload.zip/ansible_collections/community/docker/plugins/modules/docker_compose_v2.py", line 419, in __init__
File "/tmp/ansible_community.docker.docker_compose_v2_payload_9tu8jd7j/ansible_community.docker.docker_compose_v2_payload.zip/ansible_collections/community/docker/plugins/module_utils/compose_v2.py", line 521, in __init__
File "/tmp/ansible_community.docker.docker_compose_v2_payload_9tu8jd7j/ansible_community.docker.docker_compose_v2_payload.zip/ansible/module_utils/compat/version.py", line 60, in __lt__
File "/tmp/ansible_community.docker.docker_compose_v2_payload_9tu8jd7j/ansible_community.docker.docker_compose_v2_payload.zip/ansible/module_utils/compat/version.py", line 338, in _cmp
TypeError: '<' not supported between instances of 'str' and 'int'
Steps to reproduce:
-
docker compose version
(to just see the lack of version number) - Make a new ansible project, with a role that has a task using community.docker.docker_compose_v2. For this, we'll put the following in playbook.yml
- name: Playbook doohicky
gather_facts: false
hosts: localhost
tasks:
- name: Example docker compose ansible thing
community.docker.docker_compose_v2:
project_src: "whatever"
state: absent
- Run
ansible-playbook playbook.yml
, and witness the glorious error. The link to the upstream report has more details about the error.
Edited by s e