Skip to content
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

Cache-installed docker doesn't include the compose plugin #575

Closed
faec opened this issue Apr 2, 2024 · 3 comments · Fixed by #633
Closed

Cache-installed docker doesn't include the compose plugin #575

faec opened this issue Apr 2, 2024 · 3 comments · Fixed by #633

Comments

@faec
Copy link

faec commented Apr 2, 2024

Using python-on-whales to orchestrate CI machines, some commands produce the following failure:

failed on setup with "python_on_whales.exceptions.DockerException: The docker command executed was `/root/.cache/python-on-whales/docker-cli/20.10.5/docker compose [...]`.
It returned with code 125
The content of stdout is ''
The content of stderr is 'unknown flag: --file

Further inspection of the error output shows that docker doesn't recognize compose as a valid command. This seems to be because python-on-whales installed the base docker engine but not the compose plugin. Manually adding the plugin as in this documentation seems to fix the issue. This is only an issue on systems that don't already have docker (with compose) installed.

I'm preparing a PR to fix this case, but any extra context or advice would be welcome.

@LewisGaul
Copy link
Collaborator

Hi @faec, one relevant point is that the plan is to remove the functionality of python-on-whales where it downloads the docker client, see #512 (comment).

@faec
Copy link
Author

faec commented Apr 2, 2024

@LewisGaul Ah, thank you! In that case maybe I'll work on fixing this in our CI initialization scripts instead

@alexeyda
Copy link

alexeyda commented Apr 2, 2024

I have the same problem.
I use pytest-docker-compose-v2 which uses python-on-whales and returns the following error:
It downloads docker-20-10-5.tgz

/usr/local/lib/python3.11/site-packages/python_on_whales/utils.py:194: DockerException
---------------------------- Captured stderr setup -----------------------------
100%|██████████| 69.2M/69.2M [00:06<00:00, 10.7MiB/s]s]
------------------------------ Captured log setup ------------------------------
DEBUG    urllib3.connectionpool:connectionpool.py:1055 Starting new HTTPS connection (1): download.docker.com:443
DEBUG    urllib3.connectionpool:connectionpool.py:549 https://download.docker.com:443 "GET /linux/static/stable/x86_64/docker-20.10.5.tgz HTTP/1.1" 200 69158342

and then returns the following

E           python_on_whales.exceptions.DockerException: The docker command executed was "/root/.cache/python-on-whales/docker-cli/20.10.5/docker compose --file docker-compose.yml build".
E           It returned with code 125
E           The content of stdout can be found above the stacktrace (it wasn't captured).
E           The content of stderr is 'unknown flag: --file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants