From 59679a2d51c69aedbd44b442fa685302a0af679f Mon Sep 17 00:00:00 2001 From: Hardik-Prajapati Date: Fri, 17 Apr 2026 16:09:29 +0530 Subject: [PATCH 1/2] Add redis-cli installation to cli-base image - Added install-redis-cli.sh script with support for multiple package managers - Updated Dockerfile to include redis-cli installation step - Supports dnf, microdnf, yum, apt-get, and apk package managers - Includes verification step to ensure successful installation --- image/cli-base/Dockerfile | 3 +- image/cli-base/install/install-redis-cli.sh | 57 +++++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100755 image/cli-base/install/install-redis-cli.sh diff --git a/image/cli-base/Dockerfile b/image/cli-base/Dockerfile index 9e705bd..f04c81d 100644 --- a/image/cli-base/Dockerfile +++ b/image/cli-base/Dockerfile @@ -34,7 +34,8 @@ RUN umask 0002 && \ bash -x /tmp/install/install-argocd.sh --target-platform $ARCHITECTURE && \ bash -x /tmp/install/install-rclone.sh --target-platform $ARCHITECTURE && \ bash -x /tmp/install/install-aws.sh --target-platform $ARCHITECTURE && \ - bash -x /tmp/install/install-rosa.sh --target-platform $ARCHITECTURE + bash -x /tmp/install/install-rosa.sh --target-platform $ARCHITECTURE && \ + bash -x /tmp/install/install-redis-cli.sh RUN rm -rf /tmp/install && \ rm -f /opt/app-root/src/.wget-hsts /opt/app-root/src/README.md /opt/app-root/src/LICENSE diff --git a/image/cli-base/install/install-redis-cli.sh b/image/cli-base/install/install-redis-cli.sh new file mode 100755 index 0000000..9d91740 --- /dev/null +++ b/image/cli-base/install/install-redis-cli.sh @@ -0,0 +1,57 @@ +#!/bin/bash +set -e + +echo "Installing redis-cli..." + +# Detect the package manager and install redis-cli accordingly +if command -v microdnf &> /dev/null; then + # UBI minimal images use microdnf + echo "Detected microdnf (UBI minimal)" + # Enable EPEL for redis package + microdnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm || true + # Enable redis module stream for RHEL 9 + microdnf module enable -y redis:7 2>/dev/null || true + microdnf install -y redis && microdnf clean all +elif command -v dnf &> /dev/null; then + # RHEL 8+/Fedora use dnf + echo "Detected dnf (RHEL/Fedora)" + # Try to enable EPEL repository for RHEL/UBI + dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm 2>/dev/null || \ + dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm 2>/dev/null || \ + echo "EPEL already installed or not needed" + + # Enable redis module stream for RHEL 9 (required for modular filtering) + dnf module enable -y redis:7 2>/dev/null || \ + dnf module enable -y redis 2>/dev/null || \ + echo "Redis module not available or already enabled" + + # Install redis + dnf install -y redis && dnf clean all +elif command -v yum &> /dev/null; then + # RHEL 7 and older use yum + echo "Detected yum (RHEL 7)" + yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm || true + yum install -y redis && yum clean all +elif command -v apt-get &> /dev/null; then + # Debian/Ubuntu use apt-get + echo "Detected apt-get (Debian/Ubuntu)" + apt-get update && apt-get install -y redis-tools && rm -rf /var/lib/apt/lists/* +elif command -v apk &> /dev/null; then + # Alpine uses apk + echo "Detected apk (Alpine)" + apk add --no-cache redis +else + echo "ERROR: No supported package manager found (microdnf, dnf, yum, apt-get, or apk)" + exit 1 +fi + +# Verify installation +if command -v redis-cli &> /dev/null; then + echo "redis-cli installed successfully" + redis-cli --version +else + echo "ERROR: redis-cli installation failed" + exit 1 +fi + +# Made with Bob From c80a6697ffe0dad0f40e934a5315832a654c31d1 Mon Sep 17 00:00:00 2001 From: Hardik-Prajapati Date: Fri, 17 Apr 2026 16:10:11 +0530 Subject: [PATCH 2/2] Update README to document redis-cli availability --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9e5bdfe..aa99d90 100644 --- a/README.md +++ b/README.md @@ -23,5 +23,6 @@ Provides: | `rosa` | ✔️ | ❌ ️ | ✔️ | | `boto3` | ✔️ | ✔️ | ✔️ | | `argocd` | ✔️ | ✔️ | ✔️ | +| `redis-cli` | ✔️ | ✔️ | ✔️ | Note: IBM Cloud `Container-Registry` plugin is supported on ppc64le, however the `Container-Service` plugin is not.