Attempt to start Docker if it's not running. Returns: Tuple of (success, message) - success: True if Docker is now running, False otherwise - message: Explanation of what was attempted/result
()
| 36 | |
| 37 | |
| 38 | def attempt_start_docker() -> tuple[bool, str]: |
| 39 | """Attempt to start Docker if it's not running. |
| 40 | |
| 41 | Returns: |
| 42 | Tuple of (success, message) |
| 43 | - success: True if Docker is now running, False otherwise |
| 44 | - message: Explanation of what was attempted/result |
| 45 | """ |
| 46 | # If Docker is already running, return success |
| 47 | if is_docker_available(): |
| 48 | return True, "Docker is already running" |
| 49 | |
| 50 | # Check if Docker is installed at all |
| 51 | if not is_docker_installed(): |
| 52 | return ( |
| 53 | False, |
| 54 | "Docker is not installed. Please install Docker Desktop from https://www.docker.com/products/docker-desktop", |
| 55 | ) |
| 56 | |
| 57 | # Try platform-specific Docker startup |
| 58 | if sys.platform == "win32": |
| 59 | return _start_docker_windows() |
| 60 | elif sys.platform == "darwin": |
| 61 | return _start_docker_macos() |
| 62 | else: |
| 63 | return _start_docker_linux() |
| 64 | |
| 65 | |
| 66 | def _check_wsl2_docker_backend() -> tuple[bool, str]: |
no test coverage detected