Skip to content

Commit

Permalink
(CAT-1946) - Update mirrors for EOL el7 distros
Browse files Browse the repository at this point in the history
For CentOS 7 and CentOS Stream 8 images, replaced
mirrorlist URLs with vault.centos.org. For Scientific
Linux 7 images, updated baseurls to point to the
obsolete directory on the FTP server.
  • Loading branch information
jordanbreen28 committed Jul 3, 2024
1 parent 7bb6a16 commit 9ff6c04
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions yum_systemd.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,26 @@ ARG OS_TYPE

FROM $OS_TYPE:$BASE_IMAGE_TAG

# Re-declare BASE_IMAGE_TAG ARG
# Re-declare OS_TYPE & BASE_IMAGE_TAG ARGS
ARG OS_TYPE
ARG BASE_IMAGE_TAG

ENV container docker

RUN echo "LC_ALL=en_US.utf-8" >> /etc/locale.conf

RUN if [ "$BASE_IMAGE_TAG" = "stream8" ] ; then (cd /etc/yum.repos.d/; sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*;\
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*);\
RUN if [[ ( "$OS_TYPE" = "quay.io/centos/centos" && "$BASE_IMAGE_TAG" = "stream8" ) || ( "$OS_TYPE" = "centos" && "$BASE_IMAGE_TAG" = "7" ) ]]; then \
for file in /etc/yum.repos.d/CentOS-*; do \
sed -i 's/mirrorlist/#mirrorlist/g' "$file"; \
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' "$file"; \
done; \
fi

RUN if [[ ( "$OS_TYPE" = "scientificlinux/sl" && "$BASE_IMAGE_TAG" = "7" ) ]]; then \
for file in /etc/yum.repos.d/*.repo; do \
sed -i 's/mirrorlist/#mirrorlist/g' "$file"; \
sed -i 's|^baseurl=http://ftp.scientificlinux.org/linux/scientific/|baseurl=http://ftp.scientificlinux.org/linux/scientific/obsolete/|g' "$file"; \
done; \
fi

RUN yum -y install openssh-server openssh-clients systemd initscripts glibc-langpack-en iproute; yum -y reinstall dbus; yum clean all; systemctl enable sshd.service
Expand Down

0 comments on commit 9ff6c04

Please sign in to comment.