From 44d485413d1d7fad8faaa035472761d2f48f5f68 Mon Sep 17 00:00:00 2001 From: Patrick Stephens Date: Tue, 24 Sep 2024 13:22:48 +0100 Subject: [PATCH] packaging: fix CentOS builds from PR #9157 Signed-off-by: Patrick Stephens --- dockerfiles/Dockerfile.centos7 | 7 ++++--- packaging/distros/centos/Dockerfile | 14 ++++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/dockerfiles/Dockerfile.centos7 b/dockerfiles/Dockerfile.centos7 index daeb49a9771..9ff9ee88ad9 100644 --- a/dockerfiles/Dockerfile.centos7 +++ b/dockerfiles/Dockerfile.centos7 @@ -4,13 +4,14 @@ FROM centos:7 # hadolint ignore=DL3032, DL3033 -RUN yum -y update && \ +RUN sed -i -e "s/^mirrorlist=http:\/\/mirrorlist.centos.org/#mirrorlist=http:\/\/mirrorlist.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo && \ + sed -i -e "s/^#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo && \ + yum -y update && \ yum install -y rpm-build curl ca-certificates gcc gcc-c++ cmake make bash \ wget unzip systemd-devel wget flex bison \ cyrus-sasl-lib cyrus-sasl-devel openssl openss-libs openssl-devel \ postgresql-libs postgresql-devel postgresql-server postgresql libyaml-devel && \ - wget -q http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \ - rpm -ivh epel-release-latest-7.noarch.rpm && \ + yum install -y epel-release && \ yum install -y cmake3 COPY . /src/ diff --git a/packaging/distros/centos/Dockerfile b/packaging/distros/centos/Dockerfile index 0954659f437..8e70b32d478 100644 --- a/packaging/distros/centos/Dockerfile +++ b/packaging/distros/centos/Dockerfile @@ -13,13 +13,14 @@ FROM multiarch/qemu-user-static:x86_64-aarch64 as multiarch-aarch64 FROM centos:7 as centos-7-base # hadolint ignore=DL3033 -RUN yum -y update && \ +RUN sed -i -e "s/^mirrorlist=http:\/\/mirrorlist.centos.org/#mirrorlist=http:\/\/mirrorlist.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo && \ + sed -i -e "s/^#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo && \ + yum -y update && \ yum install -y rpm-build curl ca-certificates gcc gcc-c++ cmake make bash \ wget unzip systemd-devel wget flex bison \ cyrus-sasl-lib cyrus-sasl-devel openssl openss-libs openssl-devel \ postgresql-libs postgresql-devel postgresql-server postgresql libyaml-devel && \ - wget -q http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \ - rpm -ivh epel-release-latest-7.noarch.rpm && \ + yum install -y epel-release && \ yum install -y cmake3 && \ yum clean all @@ -32,13 +33,14 @@ FROM arm64v8/centos:7 as centos-7.arm64v8-base COPY --from=multiarch-aarch64 /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static # hadolint ignore=DL3033 -RUN yum -y update && \ +RUN sed -i -e "s/^mirrorlist=http:\/\/mirrorlist.centos.org/#mirrorlist=http:\/\/mirrorlist.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo && \ + sed -i -e "s/^#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo && \ + yum -y update && \ yum install -y rpm-build curl ca-certificates gcc gcc-c++ cmake make bash \ wget unzip systemd-devel wget flex bison \ cyrus-sasl-lib cyrus-sasl-devel openssl openss-libs openssl-devel \ postgresql-libs postgresql-devel postgresql-server postgresql libyaml-devel && \ - wget -q http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \ - rpm -ivh epel-release-latest-7.noarch.rpm && \ + yum install -y epel-release && \ yum install -y cmake3 && \ yum clean all