From 5f16a062166324feddb5fde81050d779636d87ab Mon Sep 17 00:00:00 2001 From: aceforeverd Date: Wed, 24 Jul 2024 13:05:13 +0800 Subject: [PATCH] fix vault address for aarch64 --- docker/Dockerfile | 8 +++----- docker/patch_yum_repo.sh | 11 +++++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) create mode 100755 docker/patch_yum_repo.sh diff --git a/docker/Dockerfile b/docker/Dockerfile index c5641ceef59..37027cd43cc 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -21,15 +21,13 @@ ARG TARGETARCH LABEL org.opencontainers.image.source https://github.com/4paradigm/OpenMLDB -COPY setup_deps.sh / +COPY ./*.sh / # hadolint ignore=DL3031,DL3033 RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo && \ sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo && \ sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo && \ yum update -y && yum install -y centos-release-scl epel-release && \ - sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo && \ - sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo && \ - sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo && \ + /patch_yum_repo.sh && \ yum install -y devtoolset-8 rh-git227 devtoolset-8-libasan-devel flex doxygen java-1.8.0-openjdk-devel rh-python38-python-devel rh-python38-python-wheel rh-python38-python-requests rh-python38-python-pip && \ curl -Lo lcov-1.15-1.noarch.rpm https://github.com/linux-test-project/lcov/releases/download/v1.15/lcov-1.15-1.noarch.rpm && \ yum localinstall -y lcov-1.15-1.noarch.rpm && \ @@ -39,7 +37,7 @@ RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo && \ tar xzf zookeeper.tar.gz -C /deps/src && \ rm -v ./*.tar.gz && \ /setup_deps.sh -a "$TARGETARCH" -z "$ZETASQL_VERSION" -t "$THIRDPARTY_VERSION" && \ - rm -v /setup_deps.sh + rm -v /*.sh ENV THIRD_PARTY_DIR=/deps/usr ENV THIRD_PARTY_SRC_DIR=/deps/src diff --git a/docker/patch_yum_repo.sh b/docker/patch_yum_repo.sh new file mode 100755 index 00000000000..b771ec2ed53 --- /dev/null +++ b/docker/patch_yum_repo.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo +sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo +sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo + +if [[ "$ARCH" = "aarch64" ]]; then + sed -i s/vault.centos.org\\/centos/vault.centos.org\\/altarch/g /etc/yum.repos.d/*.repo +fi