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

Better edge case handling around Docker Compose v2 #190

Merged
merged 1 commit into from
Feb 20, 2024
Merged

Conversation

dpogue
Copy link
Member

@dpogue dpogue commented Nov 22, 2023

The original version of Docker Compose was a separate utility, which provided a docker-compose command-line tool.

Docker Compose v2 is a Docker plugin, which is meant to be run as a subcommand of Docker (i.e., docker compose ...). In most cases, it provides a docker-compose tool for backwards compatibility that forwards to the plugin, but in some cases that tool is either missing or not properly added to the path.

We will therefore try to run docker-compose, and if it fails we will try to run docker compose and see if that works before exiting with an error. If docker compose is supported, we will use that for subsequent commands.

The original version of Docker Compose was a separate utility, which
provided a docker-compose command-line tool.

Docker Compose v2 is a Docker plugin, which is meant to be run as a
subcommand of Docker (i.e., `docker compose ...`). In most cases, it
provides a `docker-compose` tool for backwards compatibility that
forwards to the plugin, but in some cases that tool is either missing or
not properly added to the path.

We will therefore try to run `docker-compose`, and if it fails we will
try to run `docker compose` and see if that works before exiting with an
error. If `docker compose` is supported, we will use that for subsequent
commands.
@dpogue
Copy link
Member Author

dpogue commented Nov 22, 2023

NOTE: Marking this as a draft until it's tested and confirmed working on a system that is lacking the docker-compose utility

EDIT: This appears to have worked, so I'm opening this up for review :)

@dpogue dpogue marked this pull request as ready for review November 22, 2023 17:54
@Hoikas
Copy link
Member

Hoikas commented Nov 25, 2023

Is this supposed to be a branch on the H-uru repo?

@dpogue
Copy link
Member Author

dpogue commented Nov 25, 2023

oops, I guess I don't have fork of DS and origin was upstream 😞

@zrax zrax merged commit 7cb600a into master Feb 20, 2024
4 checks passed
@zrax zrax deleted the docker-compose-v2 branch February 20, 2024 17:50
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 this pull request may close these issues.

3 participants