Skip to content

Commit effd46a

Browse files
authored
Merge pull request #75 from stackhpc/rl10/update-containerfile
rocky-container-stackhpc: Add separate Rocky 10 image
2 parents df71280 + 6b38ecf commit effd46a

File tree

1 file changed

+46
-0
lines changed
  • elements/rocky-container-stackhpc/containerfiles

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Based on https://github.com/openstack/diskimage-builder/blob/master/diskimage_builder/elements/rocky-container/containerfiles/10
2+
# For least surprise when a new minor version is out, specify the full version, eg `ROCKY_VERSION=10.1`
3+
ARG ROCKY_VERSION=10
4+
FROM quay.io/rockylinux/rockylinux:${ROCKY_VERSION}
5+
ARG ROCKY_USE_CUSTOM_DNF_MIRRORS="false"
6+
# Comma-delimited list of repo URLs
7+
ARG ROCKY_CUSTOM_DNF_MIRROR_URLS
8+
9+
RUN if [[ ${ROCKY_USE_CUSTOM_DNF_MIRRORS} != "false" ]]; then \
10+
dnf -y install 'dnf-command(config-manager)' && \
11+
mkdir /tmp/orig_repos && mv /etc/yum.repos.d/*.repo /tmp/orig_repos/ && \
12+
for REPO_URL in $(echo ${ROCKY_CUSTOM_DNF_MIRROR_URLS} | sed 's/,/ /g'); do \
13+
dnf config-manager --add-repo ${REPO_URL}; \
14+
done && \
15+
dnf --allowerasing -y distro-sync; \
16+
fi
17+
18+
RUN dnf group install -y 'Minimal Install' --allowerasing && \
19+
dnf install -y findutils util-linux cloud-init
20+
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+
30+
COPY <<EOF /etc/cloud/cloud.cfg.d/10-NetworkManager.cfg
31+
---
32+
system_info:
33+
activators:
34+
- "network-manager"
35+
36+
merge_type: 'dict(recurse_array)'
37+
EOF
38+
39+
RUN systemctl unmask console-getty.service dev-hugepages.mount \
40+
getty.target sys-fs-fuse-connections.mount systemd-logind.service \
41+
systemd-remount-fs.service
42+
43+
# /etc/machine-id needs to be populated for /bin/kernel-install to
44+
# correctly copy kernels into /boot. We will clear this out in the
45+
# final image.
46+
RUN systemd-machine-id-setup

0 commit comments

Comments
 (0)