diff --git a/yum_systemd.dockerfile b/yum_systemd.dockerfile index 3a06dd1..548b1c3 100644 --- a/yum_systemd.dockerfile +++ b/yum_systemd.dockerfile @@ -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