From 7ad254a984ba426f966d71ccac03349b29077284 Mon Sep 17 00:00:00 2001 From: PegasusVikas Date: Sun, 10 Aug 2025 03:18:52 +0530 Subject: [PATCH] feat(start.py): Docker availability check --- start.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/start.py b/start.py index 11d56327..c7513e53 100644 --- a/start.py +++ b/start.py @@ -40,6 +40,16 @@ def get_setup_method(): return progress.get("data", {}).get("setup_method") +def check_docker_available(): + """Check if Docker is available and running.""" + try: + result = subprocess.run(["docker", "version"], capture_output=True, shell=IS_WINDOWS, check=True) + return True + except (subprocess.CalledProcessError, FileNotFoundError): + print(f"{Colors.RED}❌ Docker is not running or not installed.{Colors.ENDC}") + print(f"{Colors.YELLOW}Please start Docker and try again.{Colors.ENDC}") + return False + def check_docker_compose_up(): result = subprocess.run( ["docker", "compose", "ps", "-q"], @@ -149,6 +159,9 @@ def main(): if force: print("Force awakened. Skipping confirmation.") + if not check_docker_available(): + return + is_up = check_docker_compose_up() if is_up: