From 86474d9f903f91487b158f49e4ee12613fd0ed97 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 31 May 2024 09:41:34 +0200 Subject: [PATCH] fix: parse docker version better --- app/Models/Server.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Models/Server.php b/app/Models/Server.php index ad1700819..38c427dc4 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -897,7 +897,9 @@ public function validateDockerSwarm() } public function validateDockerEngineVersion() { - $dockerVersion = instant_remote_process(["docker version|head -2|grep -i version| awk '{print $2}'"], $this, false); + $dockerVersionRaw = instant_remote_process(["docker version --format json"], $this, false); + $dockerVersionJson = json_decode($dockerVersionRaw, true); + $dockerVersion = data_get($dockerVersionJson, 'Server.Version', '0.0.0'); $dockerVersion = checkMinimumDockerEngineVersion($dockerVersion); if (is_null($dockerVersion)) { $this->settings->is_usable = false;