Skip to content

Commit

Permalink
HADOOP-19222. Switch yum repo baseurl due to CentOS 7 sunset (#6932) …
Browse files Browse the repository at this point in the history
…Contributed by Cheng Pan.

Reviewed-by: Gautham Banasandra <[email protected]>
Signed-off-by:  Shilun Fan <[email protected]>
  • Loading branch information
pan3793 authored Jul 11, 2024
1 parent 8913d37 commit 4f0ee9d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions dev-support/docker/Dockerfile_centos_7
Original file line number Diff line number Diff line change
Expand Up @@ -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
######
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4f0ee9d

Please sign in to comment.