Skip to content

Commit 0cc7157

Browse files
committed
Support repo mirrors in 9-stackhpc containerfile
1 parent 6729b2a commit 0cc7157

File tree

1 file changed

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

1 file changed

+14
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
# Based on https://github.com/openstack/diskimage-builder/blob/master/diskimage_builder/elements/rocky-container/containerfiles/9
22

33
FROM docker.io/rockylinux/rockylinux:9
4+
ARG ROCKY_USE_MIRROR=false
5+
ARG ROCKY_APPSTREAM_URL
6+
ARG ROCKY_BASEOS_URL
7+
8+
RUN if [ ${ROCKY_USE_MIRROR} = "true" ]; then \
9+
dnf -y install 'dnf-command(config-manager)' && \
10+
mkdir /tmp/orig_repos && mv -f /etc/yum.repos.d/* /tmp/orig_repos/ && \
11+
dnf config-manager --add-repo ${ROCKY_APPSTREAM_URL} && \
12+
dnf config-manager --add-repo ${ROCKY_BASEOS_URL} && \
13+
dnf -y distro-sync; fi
414

515
RUN dnf group install -y 'Minimal Install' --allowerasing && \
616
dnf install -y findutils util-linux \
717
https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/cloud-init-23.1.1-12.el9.noarch.rpm
818

19+
RUN rm -f /etc/yum.repos.d/stackhpc.repo && \
20+
mv -f /tmp/orig_repos/* /etc/yum.repos.d/ && \
21+
rmdir /tmp/orig_repos
22+
923
RUN sed -i "s/renderers:.*/renderers: ['network-manager']\n activators: ['network-manager']/" /etc/cloud/cloud.cfg
1024

1125
RUN systemctl unmask console-getty.service dev-hugepages.mount \

0 commit comments

Comments
 (0)