From eb8ac56cf6a64f3cf75ce621640b65f98af9d8d0 Mon Sep 17 00:00:00 2001
From: MontyDev <173278744+z80-asm@users.noreply.github.com>
Date: Tue, 22 Oct 2024 21:30:15 +0100
Subject: [PATCH] fix: docker version check

---
 docker-compose/configure | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/docker-compose/configure b/docker-compose/configure
index 1c75220..646f131 100755
--- a/docker-compose/configure
+++ b/docker-compose/configure
@@ -7,12 +7,11 @@ if [ -z "$DOCKER_VER" ]; then
     echo "Docker not found; install it: https://docs.docker.com/engine/install/"
     exit 1
 fi
-if [ "$(echo "$DOCKER_VER"| cut -d'.' -f 1)" -ge 19 ] && \
-   [ "$(echo "$DOCKER_VER"| cut -d'.' -f 2)" -ge 0 ]  && \
-   [ "$(echo "$DOCKER_VER"| cut -d'.' -f 3)" -ge 3 ]; then
+MIN_DOCKER_VER=19.0.3
+if { echo "$MIN_DOCKER_VER"; echo "$DOCKER_VER"; } | sort --version-sort --check=quiet; then
     echo "Docker Found; OK"
 else
-    echo "Docker version less than 19.0.3; upgrade it: https://docs.docker.com/engine/install/"
+    echo "Docker version less than $MIN_DOCKER_VER; upgrade it: https://docs.docker.com/engine/install/"
     exit 1
 fi
 docker compose version 2>&1 > /dev/null