-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
community.docker.docker_compose does not work on debian 12 bookworm #672
Comments
Pretty sure Debian 12 won't have Docker Compose v1 since it is already deprecated. See #216 |
Why does installing in a venv not work? |
docker-compose depends on PyYAML<6 ... PyYAML fails to build.
|
Force PyYAML==5.3.1 in the venv, that version should build. |
Ok, understand. So, should I create venv for ansible on remote hosts? And then change |
You can create and use a venv for all docker_compose tasks only, whatever you prefer. |
I did it this way now (fast and easy workaround): - name: "docker-compose up"
docker_compose:
project_src: "{{ dir }}"
when: ansible_distribution_major_version | int < 12
- name: docker-compose up
shell:
cmd: "docker-compose up -d"
chdir: "{{ dir }}"
when: ansible_distribution_major_version | int > 11 I am not sure, how to use venv for docker_compose task only. |
You should be able to set |
It doesn't help when I use default interpreter, install docker-compose via ansible pip module, and then try to run docker-compose via community.docker.docker_compose module. I would have to run first task with one interpreter, than change interpreter, then run second task with new interpreter. But you can't change interpreter on the run. You would have to run playbook two times separately. Solution is simple. community.docker.docker_compose should use docker compose plugin instead of deprecated standalone docker-compose version. |
Yes, you can. You can define the interpreter to use per task.
#216. |
I have run into the same issue today when I needed to re-create my ansible venv on a new machine. I have updated their open issue regarding this (See docker/compose#9510). They make it clear that they don't intend to fix this as they consider it EOL. I just started writing all the ansible recipes using the community module and am a bit miffed that I need to rewrite everything now. It would be helpful if the ansible documentation would add a "deprectaion" note. And provide or suggest an alternative. I actually don't know what's the best alternative right now. Should I write compose-files, upload them to the remote and then run docker-compose as a shell command? It would be nice if this would be abstracted away by ansible. |
The documentation says "This module requires docker-compose < 2.0.0.". The module is not deprecated as there is no intention of removing it, it works totally fine with docker-compose v1.
A module for docker compose v2 would solve this, but while there have been two PRs (#540, #586), none of them got completed. So contributions are still welcome. |
I do it this way for debian 12 hosts. Because there is not possible to install docker-compose python plugin by pip, pipx, apt. Venv is too complicated workaround for me. I like straight, "clean" and easy to understand solutions. |
I have started to do this now as well as I ran into the same pyyaml issue when using |
Thank you so much @felixfontein for pointing this out. I have spent the past several hours trying to get Thanks again. |
I just want to point out that I face the same issue on fedora 38 When I try to install docker-compose module with
|
If you install
The key/magic here is |
@soakes Thanks for your help, I will give it a try |
SUMMARY
Community.docker.docker_compose does not work on debian 12 bookworm because of missing python module
docker-compose
.If you try to install it by pip
pip3 install docker-compose
, it will fail because of adoption of PEP668.I tried to install it via pipx, it will fail too. So I tried to install it in python venv, it fails too.
What is best practice to run this task on Debian 12?
ISSUE TYPE
COMPONENT NAME
community.docker.docker_compose
ANSIBLE VERSION
COLLECTION VERSION
none
CONFIGURATION
none
OS / ENVIRONMENT
STEPS TO REPRODUCE
Try to make
docker-compose up
with any compose file.EXPECTED RESULTS
Expected behavior is
docker-compose up -d
with given compose file.ACTUAL RESULTS
It will fail because of missing python module
docker-compose
. But it is (at this time) not possible to install it on Debian 12.The text was updated successfully, but these errors were encountered: