Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions elements/rocky-container-stackhpc/containerfiles/10-stackhpc
Original file line number Diff line number Diff line change
@@ -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 <<EOF /etc/cloud/cloud.cfg.d/10-NetworkManager.cfg
---
system_info:
activators:
- "network-manager"

merge_type: 'dict(recurse_array)'
EOF

RUN systemctl unmask console-getty.service dev-hugepages.mount \
getty.target sys-fs-fuse-connections.mount systemd-logind.service \
systemd-remount-fs.service

# /etc/machine-id needs to be populated for /bin/kernel-install to
# correctly copy kernels into /boot. We will clear this out in the
# final image.
RUN systemd-machine-id-setup