diff --git a/elements/rocky-container-stackhpc/containerfiles/10-stackhpc b/elements/rocky-container-stackhpc/containerfiles/10-stackhpc new file mode 100644 index 0000000..d9ad22d --- /dev/null +++ b/elements/rocky-container-stackhpc/containerfiles/10-stackhpc @@ -0,0 +1,46 @@ +# Based on https://github.com/openstack/diskimage-builder/blob/master/diskimage_builder/elements/rocky-container/containerfiles/10 +# For least surprise when a new minor version is out, specify the full version, eg `ROCKY_VERSION=10.1` +ARG ROCKY_VERSION=10 +FROM quay.io/rockylinux/rockylinux:${ROCKY_VERSION} +ARG ROCKY_USE_CUSTOM_DNF_MIRRORS="false" +# Comma-delimited list of repo URLs +ARG ROCKY_CUSTOM_DNF_MIRROR_URLS + +RUN if [[ ${ROCKY_USE_CUSTOM_DNF_MIRRORS} != "false" ]]; then \ + dnf -y install 'dnf-command(config-manager)' && \ + mkdir /tmp/orig_repos && mv /etc/yum.repos.d/*.repo /tmp/orig_repos/ && \ + for REPO_URL in $(echo ${ROCKY_CUSTOM_DNF_MIRROR_URLS} | sed 's/,/ /g'); do \ + dnf config-manager --add-repo ${REPO_URL}; \ + done && \ + dnf --allowerasing -y distro-sync; \ + fi + +RUN dnf group install -y 'Minimal Install' --allowerasing && \ + dnf install -y findutils util-linux cloud-init + +# Repositories need to be disabled a second time to downgrade kernel. +RUN if [[ ${ROCKY_USE_CUSTOM_DNF_MIRRORS} != "false" ]]; then \ + dnf config-manager --disable \* && \ + for REPO_URL in $(echo ${ROCKY_CUSTOM_DNF_MIRROR_URLS} | sed 's/,/ /g'); do \ + dnf config-manager --add-repo ${REPO_URL}; \ + done && \ + dnf --allowerasing -y distro-sync; \ + fi + +COPY <