Skip to content

fix(compose): use provided docker command instead of default #785

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/testcontainers/compose/compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ class DockerCompose:
The list of services to use from this DockerCompose.
client_args:
arguments to pass to docker.from_env()
docker_command_path:
The docker compose command to run.

Example:

Expand Down Expand Up @@ -195,7 +197,7 @@ def docker_compose_command(self) -> list[str]:

@cached_property
def compose_command_property(self) -> list[str]:
docker_compose_cmd = [self.docker_command_path or "docker", "compose"]
docker_compose_cmd = [self.docker_command_path] if self.docker_command_path else ["docker", "compose"]
if self.compose_file_name:
for file in self.compose_file_name:
docker_compose_cmd += ["-f", file]
Expand Down