Skip to content

Commit 27288b9

Browse files
authored
Aditya059/bugfix for issue 2985 (#2992)
* Replaced 23.5 with 23.6 dockerfiles * Fixed if check for both podman and docker version
1 parent 1871268 commit 27288b9

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

OracleDatabase/SingleInstance/dockerfiles/buildContainerImage.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,10 @@ checkPodmanVersion() {
7474
echo "Checking Podman version."
7575
PODMAN_VERSION=$("${CONTAINER_RUNTIME}" info --format '{{.host.BuildahVersion}}' 2>/dev/null ||
7676
"${CONTAINER_RUNTIME}" info --format '{{.Host.BuildahVersion}}')
77-
# Remove dot in Podman version
78-
PODMAN_VERSION=${PODMAN_VERSION//./}
7977

80-
if [ -z "${PODMAN_VERSION}" ]; then
78+
if [ -z "${PODMAN_VERSION//./}" ]; then
8179
exit 1;
82-
elif [ "${PODMAN_VERSION}" -lt "${MIN_PODMAN_VERSION//./}" ]; then
80+
elif [ "$(printf '%s\n' "$MIN_PODMAN_VERSION" "$PODMAN_VERSION" | sort -V | head -n1)" != "$MIN_PODMAN_VERSION" ]; then
8381
echo "Podman version is below the minimum required version ${MIN_PODMAN_VERSION}"
8482
echo "Please upgrade your Podman installation to proceed."
8583
exit 1;
@@ -91,10 +89,8 @@ checkDockerVersion() {
9189
# Get Docker Server version
9290
echo "Checking Docker version."
9391
DOCKER_VERSION=$("${CONTAINER_RUNTIME}" version --format '{{.Server.Version }}'|| exit 0)
94-
# Remove dot in Docker version
95-
DOCKER_VERSION=${DOCKER_VERSION//./}
9692

97-
if [ "${DOCKER_VERSION}" -lt "${MIN_DOCKER_VERSION//./}" ]; then
93+
if [ "$(printf '%s\n' "$MIN_DOCKER_VERSION" "$DOCKER_VERSION" | sort -V | head -n1)" != "$MIN_DOCKER_VERSION" ]; then
9894
echo "Docker version is below the minimum required version ${MIN_DOCKER_VERSION}"
9995
echo "Please upgrade your Docker installation to proceed."
10096
exit 1;

0 commit comments

Comments
 (0)