Skip to content

fix(core): allow setting docker command path for docker compose #512

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 1 commit into from
Mar 29, 2024
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
3 changes: 2 additions & 1 deletion core/testcontainers/compose/compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ class DockerCompose:
wait: bool = True
env_file: Optional[str] = None
services: Optional[list[str]] = None
docker_command_path: Optional[str] = None

def __post_init__(self):
if isinstance(self.compose_file_name, str):
Expand All @@ -181,7 +182,7 @@ def docker_compose_command(self) -> list[str]:

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