1+ # GLOBAL ARGUMENT: Base Image
2+ ARG BASE_IMAGE=registry.access.redhat.com/ubi9/ubi:9.4
3+
14# Multi-stage docker build
25# Build stage
36FROM golang:1.22 AS builder
@@ -15,7 +18,8 @@ RUN CGO_ENABLED=0 go build -o /output/experiments ./bin/experiment
1518RUN CGO_ENABLED=0 go build -o /output/helpers ./bin/helper
1619
1720# Packaging stage
18- FROM registry.access.redhat.com/ubi9/ubi:9.4
21+ # We set the default to UBI 9.4, but allow it to be overridden via --build-arg
22+ FROM ${BASE_IMAGE}
1923
2024LABEL maintainer="LitmusChaos"
2125
@@ -26,21 +30,25 @@ ARG LITMUS_VERSION
2630RUN yum install -y \
2731 sudo \
2832 sshpass \
29- procps \
30- openssh-clients
33+ procps-ng \
34+ openssh-clients
35+
36+ # EPEL repo for stress-ng
37+ RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-$(rpm -E %rhel).noarch.rpm
3138
3239# tc binary
33- RUN yum install -y https://dl.rockylinux.org/vault/rocky/9.3/devel/$(uname -m)/os/Packages/i/iproute-6.2.0-5.el9.$(uname -m).rpm
34- RUN yum install -y https://dl.rockylinux.org/vault/rocky/9.3/devel/$(uname -m)/os/Packages/i/iproute-tc-6.2.0-5.el9.$(uname -m).rpm
40+ RUN yum install -y iproute
3541
3642# iptables
37- RUN yum install -y https://dl.rockylinux.org/vault/rocky/9.3/devel/$(uname -m)/os/Packages/i/iptables-libs-1.8.8-6.el9_1.$(uname -m).rpm
38- RUN yum install -y https://dl.fedoraproject.org/pub/archive/epel/9.3/Everything/$(uname -m)/Packages/i/iptables-legacy-libs-1.8.8-6.el9.2.$(uname -m).rpm
39- RUN yum install -y https://dl.fedoraproject.org/pub/archive/epel/9.3/Everything/$(uname -m)/Packages/i/iptables-legacy-1.8.8-6.el9.2.$(uname -m).rpm
43+ RUN yum install -y iptables iptables-services
4044
4145# stress-ng
42- RUN yum install -y https://yum.oracle.com/repo/OracleLinux/OL9/appstream/$(uname -m)/getPackage/Judy-1.0.5-28.el9.$(uname -m).rpm
43- RUN yum install -y https://yum.oracle.com/repo/OracleLinux/OL9/appstream/$(uname -m)/getPackage/stress-ng-0.14.00-2.el9.$(uname -m).rpm
46+ RUN if [ $(rpm -E %rhel) -eq 9 ]; then \
47+ yum install -y https://yum.oracle.com/repo/OracleLinux/OL9/appstream/$(uname -m)/getPackage/Judy-1.0.5-28.el9.$(uname -m).rpm && \
48+ yum install -y https://yum.oracle.com/repo/OracleLinux/OL9/appstream/$(uname -m)/getPackage/stress-ng-0.14.00-2.el9.$(uname -m).rpm; \
49+ else \
50+ yum install -y stress-ng; \
51+ fi && yum clean all
4452
4553# Installing Kubectl
4654ENV KUBE_LATEST_VERSION="v1.31.0"
0 commit comments