From 96976f50b53d9b18ed6f35d01be95a91b4e185a9 Mon Sep 17 00:00:00 2001 From: aceforeverd Date: Wed, 24 Jul 2024 15:51:16 +0800 Subject: [PATCH] build(docker): centos7 EOL (#3965) * build(docker): centos7 EOL * fix vault address for aarch64 * ci(docker): disable arm64 image Dont have arm machine to test --- .github/workflows/hybridsql-docker.yml | 2 +- docker/Dockerfile | 10 +++++++--- docker/patch_yum_repo.sh | 11 +++++++++++ 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100755 docker/patch_yum_repo.sh diff --git a/.github/workflows/hybridsql-docker.yml b/.github/workflows/hybridsql-docker.yml index a23786743f6..02d52355f4e 100644 --- a/.github/workflows/hybridsql-docker.yml +++ b/.github/workflows/hybridsql-docker.yml @@ -93,6 +93,6 @@ jobs: with: context: docker push: ${{ github.event_name == 'push' }} - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/docker/Dockerfile b/docker/Dockerfile index aab88ecc4b8..37027cd43cc 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -21,9 +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 yum update -y && yum install -y centos-release-scl epel-release && \ +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 && \ + /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 && \ @@ -33,7 +37,7 @@ RUN yum update -y && yum install -y centos-release-scl epel-release && \ 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