HADOOP-19222. Switch yum repo baseurl due to CentOS 7 sunset (#6932) Contributed by Cheng Pan.
Reviewed-by: Gautham Banasandra <gaurava@apache.org> Signed-off-by: Shilun Fan <slfan1989@apache.org>
This commit is contained in:
parent
8913d379fd
commit
4f0ee9d67d
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user