Skip to content

Commit 1f8517f

Browse files
committed
HADOOP-19222. Switch yum repo baseurl due to CentOS 7 sunset
1 parent f211af3 commit 1f8517f

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

dev-support/docker/Dockerfile_centos_7

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ COPY pkg-resolver pkg-resolver
3030
RUN chmod a+x pkg-resolver/*.sh pkg-resolver/*.py \
3131
&& chmod a+r pkg-resolver/*.json
3232

33+
######
34+
# Centos 7 has reached its EOL and the packages
35+
# are no longer available on mirror.centos.org site.
36+
# Please see https://www.centos.org/centos-linux-eol/
37+
######
38+
RUN pkg-resolver/set-vault-as-baseurl-centos.sh centos:7
39+
3340
######
3441
# Install packages from yum
3542
######
@@ -38,8 +45,12 @@ RUN yum update -y \
3845
&& yum groupinstall -y "Development Tools" \
3946
&& yum install -y \
4047
centos-release-scl \
41-
python3 \
42-
&& yum install -y $(pkg-resolver/resolve.py centos:7)
48+
python3
49+
50+
# Apply the script again because centos-release-scl creates new YUM repo files
51+
RUN pkg-resolver/set-vault-as-baseurl-centos.sh centos:7
52+
53+
RUN yum install -y $(pkg-resolver/resolve.py centos:7)
4354

4455
# Set GCC 9 as the default C/C++ compiler
4556
RUN echo "source /opt/rh/devtoolset-9/enable" >> /etc/bashrc

dev-support/docker/pkg-resolver/set-vault-as-baseurl-centos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fi
2424
if [ "$1" == "centos:7" ] || [ "$1" == "centos:8" ]; then
2525
cd /etc/yum.repos.d/ || exit &&
2626
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* &&
27-
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* &&
27+
sed -i 's|# *baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* &&
2828
yum update -y &&
2929
cd /root || exit
3030
else

0 commit comments

Comments
 (0)