diff --git a/dev-support/docker/Dockerfile_centos_7 b/dev-support/docker/Dockerfile_centos_7 index ff947637a2..b97e59969a 100644 --- a/dev-support/docker/Dockerfile_centos_7 +++ b/dev-support/docker/Dockerfile_centos_7 @@ -30,6 +30,13 @@ COPY pkg-resolver pkg-resolver RUN chmod a+x pkg-resolver/*.sh pkg-resolver/*.py \ && chmod a+r pkg-resolver/*.json +###### +# Centos 7 has reached its EOL and the packages +# are no longer available on mirror.centos.org site. +# Please see https://www.centos.org/centos-linux-eol/ +###### +RUN pkg-resolver/set-vault-as-baseurl-centos.sh centos:7 + ###### # Install packages from yum ###### @@ -38,8 +45,13 @@ RUN yum update -y \ && yum groupinstall -y "Development Tools" \ && yum install -y \ centos-release-scl \ - python3 \ - && yum install -y $(pkg-resolver/resolve.py centos:7) + python3 + +# Apply the script again because centos-release-scl creates new YUM repo files +RUN pkg-resolver/set-vault-as-baseurl-centos.sh centos:7 + +# hadolint ignore=DL3008,SC2046 +RUN yum install -y $(pkg-resolver/resolve.py centos:7) # Set GCC 9 as the default C/C++ compiler RUN echo "source /opt/rh/devtoolset-9/enable" >> /etc/bashrc diff --git a/dev-support/docker/pkg-resolver/set-vault-as-baseurl-centos.sh b/dev-support/docker/pkg-resolver/set-vault-as-baseurl-centos.sh index 4be4cd956b..905ac5077d 100644 --- a/dev-support/docker/pkg-resolver/set-vault-as-baseurl-centos.sh +++ b/dev-support/docker/pkg-resolver/set-vault-as-baseurl-centos.sh @@ -24,7 +24,7 @@ fi if [ "$1" == "centos:7" ] || [ "$1" == "centos:8" ]; then cd /etc/yum.repos.d/ || exit && 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-* && + sed -i 's|# *baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* && yum update -y && cd /root || exit else