Skip to content

Commit

Permalink
(CAT-1946) - Fix failing centos7/scientific7 images
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbreen28 committed Jul 3, 2024
1 parent 7bb6a16 commit 8d855d7
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions yum_systemd.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@ 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 \
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-*; \
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 8d855d7

Please sign in to comment.