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

Automatic fallback to docker-compose v2 #620

Merged
merged 2 commits into from
Jul 20, 2023
Merged

Automatic fallback to docker-compose v2 #620

merged 2 commits into from
Jul 20, 2023

Conversation

cristianrgreco
Copy link
Collaborator

@cristianrgreco cristianrgreco commented Jul 20, 2023

Resolves #617

Testcontainers uses the docker-compose library for interacting with docker-compose. This library invokes the underlying docker-compose CLI, with commands such as docker-compose up. This works fine when the docker-compose binary is installed. Docker-compose is now being included in the main docker binary, and accessible via docker compose. When this is the case, the docker-compose functionality fails because the library cannot find the docker-compose binary. Support for docker compose was added recently, but needs to be used explicitly.

This PR tries to find a docker-compose binary, first with the old method, and then with the new (to avoid a breaking change), and will use a suitable client depending on which binary is found.

Tested locally by moving my docker-compose binary out of the PATH and seeing the fallback work.

@netlify
Copy link

netlify bot commented Jul 20, 2023

Deploy Preview for testcontainers-node ready!

Name Link
🔨 Latest commit e8f494f
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-node/deploys/64b90310b1aec400087b29f8
😎 Deploy Preview https://deploy-preview-620--testcontainers-node.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@cristianrgreco cristianrgreco added enhancement New feature or request minor Backward compatible functionality labels Jul 20, 2023
@cristianrgreco cristianrgreco self-assigned this Jul 20, 2023
@cristianrgreco cristianrgreco marked this pull request as ready for review July 20, 2023 14:59
@cristianrgreco cristianrgreco merged commit f9e4aa6 into main Jul 20, 2023
25 checks passed
@cristianrgreco cristianrgreco deleted the 617 branch July 20, 2023 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor Backward compatible functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant