-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dockerfiles/ci/base): update ci base image
Signed-off-by: wuhuizuo <wuhuizuo@126.com>
- Loading branch information
Showing
4 changed files
with
62 additions
and
60 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 |
---|---|---|
@@ -1,72 +1,75 @@ | ||
# Base image | ||
# renovate: datasource=docker depName=golang | ||
ARG GOLANG_VERSION=1.23.1 | ||
FROM golang:${GOLANG_VERSION} | ||
########### stage: builder | ||
FROM quay.io/rockylinux/rockylinux:8.10.20240528 | ||
|
||
LABEL go-version "${GOLANG_VERSION}" | ||
LABEL org.opencontainers.image.authors "wuhui.zuo@pingcap.com" | ||
LABEL org.opencontainers.image.description "CI Base image for building/testing" | ||
LABEL org.opencontainers.image.source "https://github.com/PingCAP-QE/artifacts" | ||
|
||
# install packages. | ||
RUN apt-get update && \ | ||
apt-get install -y build-essential wget unzip psmisc lsof jq mariadb-client && \ | ||
apt-get clean | ||
|
||
# rust toolchain | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s - -y --default-toolchain nightly | ||
ENV PATH /root/.cargo/bin:$PATH | ||
# setup mariadb repo | ||
# ref: https://mariadb.com/docs/server/connect/clients/mariadb-client/#Linux_(Repository) | ||
RUN curl -LsSO https://r.mariadb.com/downloads/mariadb_repo_setup \ | ||
&& echo "6083ef1974d11f49d42ae668fb9d513f7dc2c6276ffa47caed488c4b47268593 mariadb_repo_setup" | sha256sum -c - \ | ||
&& chmod +x mariadb_repo_setup \ | ||
&& ./mariadb_repo_setup \ | ||
&& rm mariadb_repo_setup | ||
|
||
##### install tools: bazelisk, yq, oras, codecov, gradle, apache-maven | ||
# renovate: datasource=github-tags depName=bazelbuild/bazelisk | ||
ARG BAZELISK_VERSION=v1.20.0 | ||
RUN OS=linux; ARCH=$([ "$(arch)" = "x86_64" ] && echo amd64 || echo arm64); \ | ||
curl -fsSL "https://github.com/bazelbuild/bazelisk/releases/download/${BAZELISK_VERSION}/bazelisk-${OS}-${ARCH}" -o /usr/local/bin/bazel && chmod +x /usr/local/bin/bazel | ||
# install OS packages. | ||
RUN --mount=type=cache,target=/var/cache/dnf \ | ||
dnf upgrade-minimal -y && \ | ||
dnf install -y make git gcc wget unzip psmisc lsof jq MariaDB-client | ||
|
||
# yq tool | ||
# renovate: datasource=github-tags depName=mikefarah/yq | ||
ARG YQ_VERSION=v4.44.3 | ||
# install golang toolchain | ||
# renovate: datasource=docker depName=golang | ||
ARG GOLANG_VERSION=1.23.1 | ||
RUN OS=linux; ARCH=$([ "$(arch)" = "x86_64" ] && echo amd64 || echo arm64); \ | ||
curl -fsSL "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_${OS}_${ARCH}" -o /usr/local/bin/yq && chmod +x /usr/local/bin/yq | ||
|
||
# oras tool | ||
# renovate: datasource=github-tags depName=oras-project/oras | ||
COPY --from=bitnami/oras:1.2.0 /oras /usr/local/bin/oras | ||
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}" | ||
|
||
# codecov tool | ||
# renovate: datasource=github-tags depName=codecov/uploader | ||
ARG CODECOV_VERSION=v0.8.0 | ||
RUN folder=$([ "$(arch)" = "x86_64" ] && echo linux || echo aarch64); \ | ||
curl -fsSL https://uploader.codecov.io/${CODECOV_VERSION}/${folder}/codecov -o /usr/local/bin/codecov && \ | ||
chmod +x /usr/local/bin/codecov | ||
# install rust toolchain | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s - -y --default-toolchain nightly | ||
ENV PATH /root/.cargo/bin:$PATH | ||
|
||
# java tool chains -> open-jdk | ||
ARG OPENJDK_VER=17 | ||
RUN apt-get update && apt-get install -y openjdk-${OPENJDK_VER}-jdk && apt-get clean | ||
RUN ARCH=$([ "$(arch)" = "x86_64" ] && echo amd64 || echo arm64); cd /usr/lib/jvm/ && ln -s java-${OPENJDK_VER}-openjdk-${ARCH} java-17-openjdk | ||
ENV JAVA_HOME=/usr/lib/jvm/java-${OPENJDK_VER}-openjdk | ||
# install nodejs toolchain | ||
ARG NODE_VERSION=18 | ||
RUN curl -fsSL https://rpm.nodesource.com/setup_${NODE_VERSION}.x | bash - \ | ||
&& dnf install -y nsolid \ | ||
&& npm install -g yarn@1.22.22 pnpm@8.15.9 | ||
|
||
# java tool chains -> gradle | ||
# java tool chains: open-jdk, gradle, apache-maven | ||
# -> open-jdk | ||
ARG JAVA_VER=17 | ||
RUN --mount=type=cache,target=/var/cache/dnf \ | ||
dnf install -y java-${JAVA_VER}-openjdk | ||
# RUN ARCH=$([ "$(arch)" = "x86_64" ] && echo amd64 || echo arm64); cd /usr/lib/jvm/ && ln -s java-${OPENJDK_VER}-openjdk-${ARCH} java-17-openjdk | ||
# ENV JAVA_HOME=/usr/lib/jvm/java-${OPENJDK_VER}-openjdk | ||
# -> gradle | ||
ARG GRADLE_VER=7.4.2 | ||
RUN wget https://services.gradle.org/distributions/gradle-${GRADLE_VER}-bin.zip && \ | ||
unzip gradle-${GRADLE_VER}-bin.zip -d /opt && \ | ||
rm gradle-${GRADLE_VER}-bin.zip | ||
ENV PATH=$PATH:/opt/gradle-${GRADLE_VER}/bin | ||
|
||
# java tool chains -> apache-maven | ||
# -> apache-maven | ||
ARG MAVEN_VER=3.8.8 | ||
RUN wget https://downloads.apache.org/maven/maven-3/${MAVEN_VER}/binaries/apache-maven-${MAVEN_VER}-bin.tar.gz && \ | ||
tar -xf apache-maven-${MAVEN_VER}-bin.tar.gz -C /opt && \ | ||
rm apache-maven-${MAVEN_VER}-bin.tar.gz | ||
ENV PATH=$PATH:/opt/apache-maven-${MAVEN_VER}/bin | ||
|
||
# install nodejs toolchain | ||
ARG NODE_VERSION=16 | ||
RUN curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - && \ | ||
apt-get install -y nodejs && \ | ||
apt-get clean && \ | ||
npm install -g yarn pnpm | ||
#### install tools: bazelisk, codecov, oras | ||
# renovate: datasource=github-tags depName=bazelbuild/bazelisk | ||
ARG BAZELISK_VERSION=v1.20.0 | ||
RUN OS=linux; ARCH=$([ "$(arch)" = "x86_64" ] && echo amd64 || echo arm64); \ | ||
curl -fsSL "https://github.com/bazelbuild/bazelisk/releases/download/${BAZELISK_VERSION}/bazelisk-${OS}-${ARCH}" -o /usr/local/bin/bazel && chmod +x /usr/local/bin/bazel | ||
|
||
# Upgrade Git tool | ||
# renovate: datasource=github-tags depName=git/git | ||
COPY --from=bitnami/git:2.46.1 /opt/bitnami/git/bin/git /usr/bin/git | ||
# codecov tool | ||
# renovate: datasource=github-tags depName=codecov/uploader | ||
ARG CODECOV_VERSION=v0.8.0 | ||
RUN folder=$([ "$(arch)" = "x86_64" ] && echo linux || echo aarch64); \ | ||
curl -fsSL https://uploader.codecov.io/${CODECOV_VERSION}/${folder}/codecov -o /usr/local/bin/codecov && \ | ||
chmod +x /usr/local/bin/codecov | ||
|
||
# oras tool | ||
# renovate: datasource=github-tags depName=oras-project/oras | ||
COPY --from=bitnami/oras:1.2.0 /oras /usr/local/bin/oras |
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