Check if Docker is available on the system. Returns: True if Docker is available and responsive, False otherwise
()
| 69 | |
| 70 | |
| 71 | def is_docker_available() -> bool: |
| 72 | """Check if Docker is available on the system. |
| 73 | |
| 74 | Returns: |
| 75 | True if Docker is available and responsive, False otherwise |
| 76 | """ |
| 77 | docker_cmd = get_docker_command() |
| 78 | |
| 79 | try: |
| 80 | result = RunningProcess.run( |
| 81 | [docker_cmd, "--version"], |
| 82 | cwd=None, |
| 83 | check=False, |
| 84 | timeout=5, |
| 85 | ) |
| 86 | return result.returncode == 0 |
| 87 | except (FileNotFoundError, RuntimeError): |
| 88 | return False |
no test coverage detected