diff --git a/Dockerfile.rhel8 b/Dockerfile.rhel8 index 70b18d2983..4e3564baef 100644 --- a/Dockerfile.rhel8 +++ b/Dockerfile.rhel8 @@ -4,9 +4,17 @@ COPY . . RUN hack/build.sh FROM registry.ci.openshift.org/ocp/4.22:base-rhel9 -RUN INSTALL_PKGS=" \ +RUN . /etc/os-release && \ + MAJOR_VERSION=$(echo "${VERSION_ID}" | cut -d. -f1) && \ + CONTAINER_RUNTIME=runc && \ + # CentOS/RHEL 10 does not have runc as a package, so replace with crun + # Remove when base image is upgraded to RHEL 10 + if [ "${MAJOR_VERSION}" = "10" ]; then \ + CONTAINER_RUNTIME=crun; \ + fi && \ + INSTALL_PKGS=" \ bind-utils bsdtar findutils fuse-overlayfs git git-lfs hostname lsof \ - netavark procps-ng runc socat tar util-linux wget which \ + netavark procps-ng ${CONTAINER_RUNTIME} socat tar util-linux wget which \ " && \ yum install -y --setopt=skip_missing_names_on_install=False $INSTALL_PKGS && \ yum clean all