From 65b078040d41962f21f88248d38f13021f5a6dc7 Mon Sep 17 00:00:00 2001 From: Erik Berg Date: Wed, 10 Nov 2021 11:57:10 +0100 Subject: [PATCH] Initial podman + docker-compose compatability Alter the regex to check for what the binary/program reports itself to be. If it's podman and version 3 or above, there are compatability layers introduced to support docker-compose with podman. https://www.redhat.com/sysadmin/podman-docker-compose --- make/common.sh | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/make/common.sh b/make/common.sh index 6065e899b89a..307e95adb241 100644 --- a/make/common.sh +++ b/make/common.sh @@ -83,18 +83,28 @@ function check_docker { fi # docker has been installed and check its version - if [[ $(docker --version) =~ (([0-9]+)\.([0-9]+)[\.0-9]*) ]] + if [[ $(docker --version) =~ ([[:alpha:]]+)[[:space:]]version[[:space:]](([0-9]+)\.([0-9]+)[\.0-9]*) ]] then - docker_version=${BASH_REMATCH[1]} - docker_version_major=${BASH_REMATCH[2]} - docker_version_minor=${BASH_REMATCH[3]} + docker_binary=${BASH_REMATCH[1]} + docker_version=${BASH_REMATCH[2]} + docker_version_major=${BASH_REMATCH[3]} + docker_version_minor=${BASH_REMATCH[4]} - note "docker version: $docker_version" - # the version of docker does not meet the requirement - if [ "$docker_version_major" -lt 17 ] || ([ "$docker_version_major" -eq 17 ] && [ "$docker_version_minor" -lt 6 ]) + note "$docker_binary version: $docker_version" + if [ "$docker_binary" == "podman" ] then - error "Need to upgrade docker package to 17.06.0+." - exit 1 + if [ "$docker_version_major" -lt 3 ] + then + error "Need to upgrade podman package to 3.0.0+." + exit 1 + fi + else + # the version of docker does not meet the requirement + if [ "$docker_version_major" -lt 17 ] || ([ "$docker_version_major" -eq 17 ] && [ "$docker_version_minor" -lt 6 ]) + then + error "Need to upgrade docker package to 17.06.0+." + exit 1 + fi fi else error "Failed to parse docker version."