-
Notifications
You must be signed in to change notification settings - Fork 315
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
dockercompose: use "docker compose" before docker-compose #5825
Conversation
internal/dockercompose/client.go
Outdated
if err != nil { | ||
composePath = "docker-compose" | ||
return []string{"docker", "compose"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a couple questions:
- do we need to worry about
docker.exe
? - the logic here is: "if docker-compose doesn't exist, assume 'docker compose' does." That will lead to this error message:
$ docker compose
docker: 'compose' is not a docker command.
See 'docker --help'
which seems like a bad outcome
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to this doc:
https://docs.docker.com/compose/#compose-v2-and-the-new-docker-compose-command
docker compose
is the preferred form, so seems like we should try that first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I removed the ".exe" appending code because it doesn't seem to be needed anymore (with go 1.18 on windows)
- Yeah, I think that makes sense. Seems like we might want to just run the version command when we make the client so that we can see which form to use.
I also have some issues with the tests so I'll have another round to look at soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i might defer to @milas on the logic here, i remember the decision tree being fairly complex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think docker compose
is the recommended way going forward.
It's worth mentioning that the shim actually does some flag translation: https://github.com/docker/compose-switch/blob/2fe0b713c6839e86239e4930b98fe94f3c68f4e2/redirect/convert.go#L26-L64 - I think that --verbose
-> --debug
might be the only one that would cause trouble, but tbh I'm in favor of not passing that flag at all because Compose emits a LOT of internal debug logging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for decision tree, I think at this point it's safe to prefer docker compose
and fallback to docker-compose
.
(When V2 was in early preview, we'd prefer docker-compose-v1
which is what the shim would conditionally invoke based on preferences, so we used it explicitly, but that isn't necessary anymore.)
3ff2232
to
1386c30
Compare
1. Use program found in $TILT_DOCKER_COMPOSE_CMD 2. Use `docker compose` if `docker compose version` returns successfully 3. Fall back to `docker-compose`
9fdc766
to
938c47d
Compare
No description provided.