ARG DISTRO=ubuntu ARG VERSION=22.04 FROM ${DISTRO}:${VERSION} ENV HOME=/root ENV LANG=C.UTF-8 ENV SHELL=/bin/bash ENV BASH_ENV=/etc/bash.bashrc ENV DEBIAN_FRONTEND=noninteractive WORKDIR /tmp SHELL [ "/bin/bash", "-c" ] ARG EXTRA_PACKAGES="" ENV PATH="/usr/local/bin:${PATH}" ENV LIBRARY_PATH="/usr/local/lib:/usr/local/lib64" ENV LD_LIBRARY_PATH="/usr/local/lib:/usr/local/lib64" ENV CMAKE_PREFIX_PATH="/usr/local" # Add git-core repository to get latest versions of git RUN apt-get update && \ apt-get install -y software-properties-common && \ add-apt-repository ppa:git-core/ppa RUN apt-get dist-upgrade -y && \ apt-get install -y autoconf autotools-dev bash-completion build-essential bzip2 cmake curl environment-modules git-core gnupg2 gzip libtool locales lsb-release m4 python3-pip unzip wget zip zlib1g-dev && \ apt-get autoclean && \ locale -a RUN OS_VERSION=$(grep '^VERSION_ID=' /etc/os-release | cut -d'=' -f2 | tr -d '"') && \ OS_ID=$(grep '^ID=' /etc/os-release | cut -d'=' -f2 | tr -d '"') && \ if [ "${OS_ID}" == "ubuntu" ] && [ "${OS_VERSION}" == "22.04" ]; then \ python3 -m pip install --upgrade pip; \ python3 -m pip install 'cmake==3.21'; \ else \ python3 -m pip install --break-system-packages 'cmake==3.21'; \ fi # 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 ENV LC_ALL=C.UTF-8 WORKDIR /home SHELL [ "/bin/bash", "--login", "-c" ]