-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate linux builder OS from CentOS 7 to RockyLinux 8 (#381)
Fixes #379 --------- Signed-off-by: wuhuizuo <[email protected]>
- Loading branch information
Showing
12 changed files
with
148 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,24 +2,20 @@ | |
# - docker >= v20.10 | ||
# | ||
# build steps: | ||
# - git clone https://github.com/pingcap/tidb.git tidb | ||
# - rm tidb/.dockerignore # make step depended on git metadata. | ||
# - docker build -t tidb -f Dockerfile ./tidb | ||
# - git clone https://github.com/pingcap/ng-monitoring.git ng-monitoring | ||
# - rm ng-monitoring/.dockerignore # make step depended on git metadata. | ||
# - docker build -t ng-monitoring -f Dockerfile ./ng-monitoring | ||
|
||
########### 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 | ||
########### stage: builder | ||
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 NG-Monitoring" | ||
LABEL org.opencontainers.image.source = "https://github.com/PingCAP-QE/artifacts" | ||
|
||
# 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 | ||
RUN --mount=type=cache,target=/var/cache/dnf \ | ||
dnf upgrade-minimal -y && \ | ||
dnf install -y make git gcc | ||
|
||
# install golang toolchain | ||
# renovate: datasource=docker depName=golang | ||
|
@@ -29,7 +25,7 @@ RUN OS=linux; ARCH=$([ "$(arch)" = "x86_64" ] && echo amd64 || echo arm64); \ | |
ENV PATH /usr/local/go/bin/:$PATH | ||
LABEL go-version="${GOLANG_VERSION}" | ||
|
||
########### stage: Buiding | ||
########### stage: building | ||
FROM builder as building | ||
COPY . /ws | ||
ARG GOPROXY | ||
|
@@ -38,7 +34,6 @@ RUN /ws/bin/ng-monitoring-server -V | |
|
||
########### stage: Final image | ||
FROM ghcr.io/pingcap-qe/bases/ng-monitoring-base:v1.9.1 | ||
|
||
COPY --from=building /ws/bin/ng-monitoring-server /ng-monitoring-server | ||
|
||
WORKDIR / | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,44 +5,39 @@ | |
# - git clone --recurse-submodules https://github.com/tikv/pd.git pd | ||
# - 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 | ||
########### stage: builder | ||
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 PD" | ||
LABEL org.opencontainers.image.source = "https://github.com/PingCAP-QE/artifacts" | ||
|
||
# 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 | ||
RUN --mount=type=cache,target=/var/cache/dnf \ | ||
dnf upgrade-minimal -y && \ | ||
dnf install -y make git gcc which unzip | ||
|
||
# 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 | ||
LABEL go-version="${GOLANG_VERSION}" | ||
|
||
########### stage: Buiding | ||
########### stage: building | ||
FROM builder as building | ||
COPY . /pd | ||
COPY . /ws | ||
ARG GOPROXY | ||
RUN GOPROXY=${GOPROXY} make build tools -C /pd | ||
RUN /pd/bin/pd-server -V | ||
RUN /pd/bin/pd-ctl -V | ||
RUN /pd/bin/pd-recover -V | ||
RUN GOPROXY=${GOPROXY} make build tools -C /ws | ||
RUN /ws/bin/pd-server -V | ||
RUN /ws/bin/pd-ctl -V | ||
RUN /ws/bin/pd-recover -V | ||
|
||
########### stage: Final image | ||
FROM ghcr.io/pingcap-qe/bases/pd-base:v1.9.1 | ||
|
||
COPY --from=building /pd/bin/pd-server /pd-server | ||
COPY --from=building /pd/bin/pd-ctl /pd-ctl | ||
COPY --from=building /pd/bin/pd-recover /pd-recover | ||
COPY --from=building /ws/bin/pd-server /pd-server | ||
COPY --from=building /ws/bin/pd-ctl /pd-ctl | ||
COPY --from=building /ws/bin/pd-recover /pd-recover | ||
|
||
EXPOSE 2379 2380 | ||
ENTRYPOINT ["/pd-server"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,22 +2,20 @@ | |
# - docker >= v20.10 | ||
# | ||
# build steps: | ||
# - git clone https://github.com/pingcap/tidb.git tidb | ||
# - rm tidb/.dockerignore # make step depended on git metadata. | ||
# - docker build -t tidb -f Dockerfile ./tidb | ||
# - git clone https://github.com/pingcap/tidb-dashbord.git tidb-dashbord | ||
# - rm tidb-dashbord/.dockerignore # make step depended on git metadata. | ||
# - docker build -t tidb-dashbord -f Dockerfile ./tidb-dashbord | ||
|
||
########### 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 | ||
########### stage: builder | ||
FROM quay.io/rockylinux/rockylinux:8.10.20240528-ubi as builder | ||
LABEL org.opencontainers.image.authors "[email protected]" | ||
LABEL org.opencontainers.image.description "binary builder for TiDB Dashboard" | ||
LABEL org.opencontainers.image.source = "https://github.com/PingCAP-QE/artifacts" | ||
|
||
# install packages. | ||
RUN yum -y update && \ | ||
yum -y groupinstall "Development Tools" && \ | ||
yum -y install java-11-openjdk && \ | ||
yum clean all | ||
RUN --mount=type=cache,target=/var/cache/dnf \ | ||
dnf upgrade-minimal -y && \ | ||
dnf install -y make git gcc java-11-openjdk findutils | ||
|
||
# install golang toolchain | ||
# renovate: datasource=docker depName=golang | ||
|
@@ -28,11 +26,11 @@ 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 pnpm@7.30.5 | ||
RUN npm install -g pnpm@9.7.0 | ||
|
||
########### stage: Buiding | ||
########### stage: building | ||
FROM builder as building | ||
COPY . /ws | ||
ARG GOPROXY | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,17 +6,20 @@ | |
# - rm tidb-operator/.dockerignore # make step depended on git metadata. | ||
# - docker build -t tidb-operator -f Dockerfile ./tidb-operator | ||
|
||
########### stage: Builder | ||
########### stage: builder | ||
ARG GOLANG_VERSION=1.21.13 | ||
FROM golang:${GOLANG_VERSION} as builder | ||
LABEL org.opencontainers.image.authors "[email protected]" | ||
LABEL org.opencontainers.image.description "binary builder for TiDB Operator" | ||
LABEL org.opencontainers.image.source = "https://github.com/PingCAP-QE/artifacts" | ||
LABEL go-version="${GOLANG_VERSION}" | ||
|
||
# install packages. | ||
RUN --mount=type=cache,target=/var/cache/apt \ | ||
apt-get update && apt-get install -y uuid-runtime | ||
|
||
LABEL go-version="${GOLANG_VERSION}" | ||
|
||
########### stage: Buiding | ||
########### stage: building | ||
FROM builder as building | ||
COPY . /ws | ||
ARG GOPROXY | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,19 +6,16 @@ | |
# - rm tidb/.dockerignore # make step depended on git metadata. | ||
# - 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 | ||
########### stage: builder | ||
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 TiDB" | ||
LABEL org.opencontainers.image.source = "https://github.com/PingCAP-QE/artifacts" | ||
|
||
# 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 | ||
RUN --mount=type=cache,target=/var/cache/dnf \ | ||
dnf upgrade-minimal -y && \ | ||
dnf install -y make git gcc | ||
|
||
# install golang toolchain | ||
# renovate: datasource=docker depName=golang | ||
|
@@ -28,17 +25,16 @@ RUN OS=linux; ARCH=$([ "$(arch)" = "x86_64" ] && echo amd64 || echo arm64); \ | |
ENV PATH /usr/local/go/bin/:$PATH | ||
LABEL go-version="${GOLANG_VERSION}" | ||
|
||
########### stage: Buiding | ||
########### stage: building | ||
FROM builder as building | ||
COPY . /tidb | ||
COPY . /ws | ||
ARG GOPROXY | ||
RUN GOPROXY=${GOPROXY} make server -C /tidb | ||
RUN /tidb/bin/tidb-server -V | ||
RUN GOPROXY=${GOPROXY} make server -C /ws | ||
RUN /ws/bin/tidb-server -V | ||
|
||
########### stage: Final image | ||
FROM ghcr.io/pingcap-qe/bases/tidb-base:v1.9.1 | ||
|
||
COPY --from=building /tidb/bin/tidb-server /tidb-server | ||
COPY --from=building /ws/bin/tidb-server /tidb-server | ||
|
||
WORKDIR / | ||
EXPOSE 4000 | ||
|
Oops, something went wrong.