Skip to content

Commit c7b73d9

Browse files
committed
fix: disable repositories second time to downgrade kernel
It has been observed the image built with custom repositories will contain the latest kernel and will not downgrade to match what is contained within the custom repositories. By disabling the repositories after installing `Minimal Install` it should then trigger a downgrade. Signed-off-by: Jack Hodgkiss <jack@stackhpc.com>
1 parent eaed1e9 commit c7b73d9

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • elements/rocky-container-stackhpc/containerfiles

elements/rocky-container-stackhpc/containerfiles/9-stackhpc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ RUN if [[ ${ROCKY_USE_CUSTOM_DNF_MIRRORS} != "false" ]]; then \
1818
RUN dnf group install -y 'Minimal Install' --allowerasing && \
1919
dnf install -y findutils util-linux cloud-init
2020

21+
# Repositories need to be disabled a second time to downgrade kernel.
22+
RUN if [[ ${ROCKY_USE_CUSTOM_DNF_MIRRORS} != "false" ]]; then \
23+
dnf config-manager --disable \* && \
24+
for REPO_URL in $(echo ${ROCKY_CUSTOM_DNF_MIRROR_URLS} | sed 's/,/ /g'); do \
25+
dnf config-manager --add-repo ${REPO_URL}; \
26+
done && \
27+
dnf --allowerasing -y distro-sync; \
28+
fi
29+
2130
COPY <<EOF /etc/cloud/cloud.cfg.d/10-NetworkManager.cfg
2231
---
2332
system_info:

0 commit comments

Comments
 (0)