Check if Docker is available and running.
()
| 87 | |
| 88 | |
| 89 | def _check_docker_available() -> bool: |
| 90 | """Check if Docker is available and running.""" |
| 91 | try: |
| 92 | # Use 30s timeout - Docker Desktop on Windows can be slow to respond |
| 93 | result = subprocess.run( |
| 94 | ["docker", "info"], |
| 95 | capture_output=True, |
| 96 | timeout=30, |
| 97 | ) |
| 98 | return result.returncode == 0 |
| 99 | except (subprocess.TimeoutExpired, FileNotFoundError): |
| 100 | return False |
| 101 | except KeyboardInterrupt as ki: |
| 102 | handle_keyboard_interrupt(ki) |
| 103 | raise |
| 104 | |
| 105 | |
| 106 | def _build_docker_image(project_root: Path, rebuild: bool = False) -> bool: |
no test coverage detected