Stop a Docker container. Args: container_id: Container ID to stop Returns: True if successful, False otherwise
(container_id: str)
| 400 | |
| 401 | |
| 402 | def docker_stop_container(container_id: str) -> bool: |
| 403 | """Stop a Docker container. |
| 404 | |
| 405 | Args: |
| 406 | container_id: Container ID to stop |
| 407 | |
| 408 | Returns: |
| 409 | True if successful, False otherwise |
| 410 | """ |
| 411 | try: |
| 412 | result = subprocess.run( |
| 413 | [get_docker_command(), "stop", container_id], |
| 414 | capture_output=True, |
| 415 | text=True, |
| 416 | timeout=30, |
| 417 | ) |
| 418 | return result.returncode == 0 |
| 419 | except (FileNotFoundError, subprocess.TimeoutExpired): |
| 420 | return False |
| 421 | |
| 422 | |
| 423 | def docker_remove_container(container_id: str) -> bool: |
nothing calls this directly
no test coverage detected