Skip to content

Commit

Permalink
Migrate linux builder OS from CentOS 7 to RockyLinux 8
Browse files Browse the repository at this point in the history
Fixes #379

Signed-off-by: wuhuizuo <[email protected]>
  • Loading branch information
wuhuizuo committed Aug 13, 2024
1 parent 5236657 commit eef70c7
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 86 deletions.
14 changes: 1 addition & 13 deletions dockerfiles/cd/builders/ng-monitoring/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,7 @@
# - docker build -t tidb -f Dockerfile ./tidb

########### stage: Builder
FROM centos:7.9.2009 as builder
# CentOS 7 has reached EOL
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

# install packages.
RUN yum update --nogpgcheck -y && \
yum install --nogpgcheck -y epel-release deltarpm && \
yum update --nogpgcheck -y && \
yum groupinstall --nogpgcheck -y "Development Tools" && \
yum install -y wget && \
yum clean all
FROM quay.io/rockylinux/rockylinux:8.10.20240528 as builder

# install golang toolchain
# renovate: datasource=docker depName=golang
Expand Down
16 changes: 2 additions & 14 deletions dockerfiles/cd/builders/pd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,11 @@
# - docker build -t pd -f Dockerfile ./pd

########### stage: Builder
FROM centos:7.9.2009 as builder
# CentOS 7 has reached EOL
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

# install packages.
RUN yum update --nogpgcheck -y && \
yum install --nogpgcheck -y epel-release deltarpm && \
yum update --nogpgcheck -y && \
yum groupinstall --nogpgcheck -y "Development Tools" && \
yum install --nogpgcheck -y which && \
yum clean all
FROM quay.io/rockylinux/rockylinux:8.10.20240528 as builder

# install golang toolchain
# renovate: datasource=docker depName=golang
ARG GOLANG_VERSION=1.21.6
ARG GOLANG_VERSION=1.21.13
RUN OS=linux; ARCH=$([ "$(arch)" = "x86_64" ] && echo amd64 || echo arm64); \
curl -fsSL https://dl.google.com/go/go${GOLANG_VERSION}.linux-${ARCH}.tar.gz | tar -C /usr/local -xz
ENV PATH /usr/local/go/bin/:$PATH
Expand Down
14 changes: 2 additions & 12 deletions dockerfiles/cd/builders/tidb-dashboard/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,7 @@
# - docker build -t tidb -f Dockerfile ./tidb

########### stage: Builder
FROM centos:7.9.2009 as builder
# CentOS 7 has reached EOL
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

# install packages.
RUN yum -y update && \
yum -y groupinstall "Development Tools" && \
yum -y install java-11-openjdk && \
yum clean all
FROM quay.io/rockylinux/rockylinux:8.10.20240528 as builder

# install golang toolchain
# renovate: datasource=docker depName=golang
Expand All @@ -28,7 +18,7 @@ ENV PATH /usr/local/go/bin/:$PATH
LABEL go-version="${GOLANG_VERSION}"

# Install nodejs.
RUN curl -fsSL https://rpm.nodesource.com/setup_16.x | bash -
RUN curl -fsSL https://rpm.nodesource.com/setup_18.x | bash -
RUN yum -y install nodejs && yum clean all
RUN npm install -g [email protected]

Expand Down
13 changes: 1 addition & 12 deletions dockerfiles/cd/builders/tidb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,7 @@
# - docker build -t tidb -f Dockerfile ./tidb

########### stage: Builder
FROM centos:7.9.2009 as builder
# CentOS 7 has reached EOL
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

# install packages.
RUN yum update --nogpgcheck -y && \
yum install --nogpgcheck -y epel-release deltarpm && \
yum update --nogpgcheck -y && \
yum groupinstall --nogpgcheck -y "Development Tools" && \
yum clean all
FROM quay.io/rockylinux/rockylinux:8.10.20240528 as builder

# install golang toolchain
# renovate: datasource=docker depName=golang
Expand Down
6 changes: 1 addition & 5 deletions dockerfiles/cd/builders/tiflash/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
# - docker build -t tikv -f Dockerfile ./tikv

########### stage: Builder
FROM centos:7.9.2009 as builder
# CentOS 7 has reached EOL
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
FROM quay.io/rockylinux/rockylinux:8.10.20240528 as builder

LABEL org.opencontainers.image.authors "[email protected]"
LABEL org.opencontainers.image.description "binary builder for tiflash"
Expand Down
13 changes: 1 addition & 12 deletions dockerfiles/cd/builders/tiflow/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,7 @@
# - docker build -t dm -f Dockerfile ./tiflow

########### stage: Builder - cdc
FROM centos:7.9.2009 as builder-cdc
# CentOS 7 has reached EOL
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

# install packages.
RUN yum update --nogpgcheck -y && \
yum install --nogpgcheck -y epel-release deltarpm && \
yum update --nogpgcheck -y && \
yum groupinstall --nogpgcheck -y "Development Tools" && \
yum clean all
FROM quay.io/rockylinux/rockylinux:8.10.20240528 as builder-cdc

# install golang toolchain
# renovate: datasource=docker depName=golang
Expand Down
32 changes: 15 additions & 17 deletions dockerfiles/cd/builders/tikv/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,23 @@
# - docker build -t tikv -f Dockerfile ./tikv

########### stage: Builder
FROM centos:7.9.2009 as builder
# CentOS 7 has reached EOL
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
FROM quay.io/rockylinux/rockylinux:8.10.20240528 as builder

# install packages.
ARG DEVTOOLSET_VER=8
RUN yum install --nogpgcheck -y epel-release centos-release-scl deltarpm && \
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 && \
([ "$(arch)" = "x86_64" ] || sed -i s#vault.centos.org/centos/7/sclo/#vault.centos.org/altarch/7/sclo/#g /etc/yum.repos.d/*.repo) && \
yum update --nogpgcheck -y && \
yum install -y git devtoolset-${DEVTOOLSET_VER} perl cmake3 unzip && \
yum clean all && \
ln -s /usr/bin/cmake3 /usr/bin/cmake
ENV DEVTOOLSET_VER ${DEVTOOLSET_VER}
RUN dnf install -y \
openssl-devel \
gcc \
gcc-c++ \
make \
cmake \
perl \
git \
findutils \
curl \
python3 --allowerasing && \
dnf --enablerepo=crb install -y \
libstdc++-static && \
dnf clean all

# install protoc.
# renovate: datasource=github-release depName=protocolbuffers/protobuf
Expand All @@ -34,7 +33,6 @@ RUN FILE=$([ "$(arch)" = "aarch64" ] && echo "protoc-${PROTOBUF_VER#?}-linux-aar
# install rust toolchain
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s - -y --default-toolchain none
ENV PATH /root/.cargo/bin/:$PATH
LABEL devtoolset-ver="${DEVTOOLSET_VER}"

########### stage: Buiding
FROM builder as building
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/cd/builders/tikv/fips.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ARG PROTOBUF_VER=v3.15.8
RUN FILE=$([ "$(arch)" = "aarch64" ] && echo "protoc-${PROTOBUF_VER#?}-linux-aarch_64.zip" || echo "protoc-${PROTOBUF_VER#?}-linux-$(arch).zip"); \
curl -LO "https://github.com/protocolbuffers/protobuf/releases/download/${PROTOBUF_VER}/${FILE}" && unzip "$FILE" -d /usr/local/ && rm -f "$FILE"

# Install Rustup
# install rust toolchain
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s - -y --default-toolchain none
ENV PATH /root/.cargo/bin/:$PATH

Expand Down

0 comments on commit eef70c7

Please sign in to comment.