Skip to content

Commit 217915b

Browse files
authored
Merge pull request #1269 from pegasusVikas/feature/script-validation-docker
fix : Added docker availability check
2 parents ebb6b04 + 7ad254a commit 217915b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

start.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ def get_setup_method():
4040
return progress.get("data", {}).get("setup_method")
4141

4242

43+
def check_docker_available():
44+
"""Check if Docker is available and running."""
45+
try:
46+
result = subprocess.run(["docker", "version"], capture_output=True, shell=IS_WINDOWS, check=True)
47+
return True
48+
except (subprocess.CalledProcessError, FileNotFoundError):
49+
print(f"{Colors.RED}❌ Docker is not running or not installed.{Colors.ENDC}")
50+
print(f"{Colors.YELLOW}Please start Docker and try again.{Colors.ENDC}")
51+
return False
52+
4353
def check_docker_compose_up():
4454
result = subprocess.run(
4555
["docker", "compose", "ps", "-q"],
@@ -149,6 +159,9 @@ def main():
149159
if force:
150160
print("Force awakened. Skipping confirmation.")
151161

162+
if not check_docker_available():
163+
return
164+
152165
is_up = check_docker_compose_up()
153166

154167
if is_up:

0 commit comments

Comments
 (0)