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

Additional Docker Compose Run Flags #443

Merged
Merged
Changes from 1 commit
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
Next Next commit
additions
  • Loading branch information
ethanleifer committed May 24, 2023
commit 673f3df89632fdf620f5f0a4f61030be687dc4f5
4 changes: 4 additions & 0 deletions python_on_whales/components/compose/cli_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ def run(
self,
service: str,
command: List[str] = [],
build: bool = False,
detach: bool = False,
# entrypoint: Optional[List[str]] = None,
# envs: Dict[str, str] = {},
Expand All @@ -507,6 +508,7 @@ def run(
publish: List[
python_on_whales.components.container.cli_wrapper.ValidPortMapping
] = [],
remove_orphans: bool = False,
remove: bool = False,
service_ports: bool = False,
use_aliases: bool = False,
Expand Down Expand Up @@ -560,6 +562,7 @@ def run(
"Try setting tty=False in docker.compose.run(...)."
)
full_cmd = self.docker_compose_cmd + ["run"]
full_cmd.add_flag("--build", build)
full_cmd.add_flag("--detach", detach)
full_cmd.add_simple_arg("--name", name)
full_cmd.add_flag("--no-TTY", not tty)
Expand All @@ -573,6 +576,7 @@ def run(
f"{port_mapping[0]}:{port_mapping[1]}/{port_mapping[2]}",
]

full_cmd.add_flag("--remove-orphans", remove_orphans)
full_cmd.add_flag("--rm", remove)
full_cmd.add_flag("--service-ports", service_ports)
full_cmd.add_flag("--use-aliases", use_aliases)
Expand Down