ARG DISTRO=rockylinux ARG VERSION=8 FROM ${DISTRO}:${VERSION} ENV HOME=/root ENV SHELL=/bin/bash ENV BASH_ENV=/etc/bash.bashrc ENV DEBIAN_FRONTEND=noninteractive WORKDIR /tmp SHELL [ "/bin/bash", "-c" ] ENV PATH=/usr/local/bin:${PATH} ARG EXTRA_PACKAGES="" RUN yum groupinstall -y "Development Tools" && \ yum install -y epel-release && \ yum install -y --allowerasing curl dpkg-devel python3-pip wget zlib-devel which git && \ yum clean all && \ python3 -m pip install --upgrade pip && \ python3 -m pip install 'cmake==3.21' # The Rock Tarball ARG GPU_TYPE="" RUN if [ -n "${GPU_TYPE}" ]; then \ TARBALL=$(curl -fsSL "https://rocm.nightlies.amd.com/tarball-multi-arch/" | \ grep -oE "\"name\": \"therock-dist-linux-${GPU_TYPE}-[^\"]+\", \"mtime\": [0-9.]+" | \ sort -t' ' -k4 -g | \ tail -1 | \ sed 's/.*"name": "\([^"]*\)".*/\1/'); \ test -n "${TARBALL}" || { echo "Error: no therock-dist-linux-${GPU_TYPE}-* tarball found" >&2; exit 1; }; \ VERSION=$(echo "${TARBALL}" | sed -nE 's/.*([0-9]+\.[0-9]+\.[0-9]+).*/\1/p'); \ test -n "${VERSION}" || { echo "Error: could not extract version from '${TARBALL}'" >&2; exit 1; }; \ curl -fSL "https://rocm.nightlies.amd.com/tarball-multi-arch/${TARBALL}" \ -o "/opt/rocm-${VERSION}-${GPU_TYPE}.tar.gz"; \ fi WORKDIR /home SHELL [ "/bin/bash", "--login", "-c" ]