Skip to content

Commit 14200bd

Browse files
Remove +dfsg* from docker version (#2757)
On some Debian installations, the following command docker version --format '{{.Server.Version}}' returns a version number with +dfsg... added, for example: 20.10.5+dfsg1 After removing the dots, the comparison of DOCKER_VERSION with MIN_DOCKER_VERSION throws ./buildContainerImage.sh: line 97: [: 20105+dfsg1: integer expression expected This pull request also adds the substring +dfsg* from the version number in order for the comparison to have numerical values on both sides.
1 parent e6ffb92 commit 14200bd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

OracleDatabase/SingleInstance/dockerfiles/buildContainerImage.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ checkDockerVersion() {
8989
# Get Docker Server version
9090
echo "Checking Docker version."
9191
DOCKER_VERSION=$("${CONTAINER_RUNTIME}" version --format '{{.Server.Version }}'|| exit 0)
92+
# Remove +dfsg* if present
93+
DOCKER_VERSION=${DOCKER_VERSION%%+dfsg*}
94+
# Remove dot in Docker version
95+
DOCKER_VERSION=${DOCKER_VERSION//./}
9296

9397
if [ "$(printf '%s\n' "$MIN_DOCKER_VERSION" "$DOCKER_VERSION" | sort -V | head -n1)" != "$MIN_DOCKER_VERSION" ]; then
9498
echo "Docker version is below the minimum required version ${MIN_DOCKER_VERSION}"

0 commit comments

Comments
 (0)