From 66cf6df4b3b5a1933e0cddf7cb09178c05d85497 Mon Sep 17 00:00:00 2001 From: Vahor Date: Mon, 9 Sep 2024 23:46:29 +0200 Subject: [PATCH] skip docker network creation --- app/Actions/Service/StartService.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Actions/Service/StartService.php b/app/Actions/Service/StartService.php index 4b6a25dcc..7aef457a1 100644 --- a/app/Actions/Service/StartService.php +++ b/app/Actions/Service/StartService.php @@ -16,8 +16,10 @@ class StartService $service->saveComposeConfigs(); $commands[] = 'cd '.$service->workdir(); $commands[] = "echo 'Saved configuration files to {$service->workdir()}.'"; - $commands[] = "echo 'Creating Docker network.'"; - $commands[] = "docker network inspect $service->uuid >/dev/null 2>&1 || docker network create --attachable $service->uuid"; + if($service->networks()->count() > 0){ + $commands[] = "echo 'Creating Docker network.'"; + $commands[] = "docker network inspect $service->uuid >/dev/null 2>&1 || docker network create --attachable $service->uuid"; + } $commands[] = 'echo Starting service.'; $commands[] = "echo 'Pulling images.'"; $commands[] = 'docker compose pull';