Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
3 changes: 2 additions & 1 deletion image/cli-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
57 changes: 57 additions & 0 deletions image/cli-base/install/install-redis-cli.sh
Original file line number Diff line number Diff line change
@@ -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
Loading