Skip to content

Commit

Permalink
refactor(dockerfiles/cd/builders/tikv): migrate builder base image fr…
Browse files Browse the repository at this point in the history
…om centos 7 to rocky linux 8

use the ubi edition base image.
  • Loading branch information
wuhuizuo committed Aug 14, 2024
1 parent 33abf29 commit 840ef94
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 79 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/pull-cd-builder-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,25 +89,6 @@ jobs:
module: [builder-others, builder-tikv, builder-tikv-fips]
platform: [linux/amd64, linux/arm64]
builder-profile: [local-docker]
include:
- module: builder-tikv
builder-profile: devtoolset8,local-docker
platform: linux/amd64
- module: builder-tikv
builder-profile: devtoolset9,local-docker
platform: linux/amd64
- module: builder-tikv
builder-profile: devtoolset10,local-docker
platform: linux/amd64
- module: builder-tikv
builder-profile: devtoolset8,local-docker
platform: linux/arm64
- module: builder-tikv
builder-profile: devtoolset9,local-docker
platform: linux/arm64
- module: builder-tikv
builder-profile: devtoolset10,local-docker
platform: linux/arm64
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/release-cd-builder-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,6 @@ jobs:
# module: [builder-others, builder-tikv, builder-tikv-fips, builder-others-slow]
module: [builder-others, builder-tikv, builder-tikv-fips]
builder-profile: [local-docker]
include:
- module: builder-tikv
builder-profile: devtoolset8,local-docker
- module: builder-tikv
builder-profile: devtoolset9,local-docker
- module: builder-tikv
builder-profile: devtoolset10,local-docker
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand Down
27 changes: 0 additions & 27 deletions dockerfiles/cd/builders/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,33 +193,6 @@ profiles:
tryImportMissing: true
patches:
- { op: move, from: /build/artifacts/0/kaniko, path: /build/artifacts/0/docker }
- name: devtoolset8
patches:
- op: replace
path: /build/tagPolicy/customTemplate/template
value: "{{ .SHA }}-devtoolset8"
- op: add
path: /build/artifacts/0/kaniko/buildArgs
value:
DEVTOOLSET_VER: 8
- name: devtoolset9
patches:
- op: replace
path: /build/tagPolicy/customTemplate/template
value: "{{ .SHA }}-devtoolset9"
- op: add
path: /build/artifacts/0/kaniko/buildArgs
value:
DEVTOOLSET_VER: 9
- name: devtoolset10
patches:
- op: replace
path: /build/tagPolicy/customTemplate/template
value: "{{ .SHA }}-devtoolset10"
- op: add
path: /build/artifacts/0/kaniko/buildArgs
value:
DEVTOOLSET_VER: 10
---
apiVersion: skaffold/v4beta6
kind: Config
Expand Down
26 changes: 8 additions & 18 deletions dockerfiles/cd/builders/tikv/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,15 @@
# - docker build -t tikv -f Dockerfile ./tikv

########### stage: Builder
FROM quay.io/rockylinux/rockylinux:8.10.20240528 as builder
FROM quay.io/rockylinux/rockylinux:8.10.20240528-ubi as builder

# install packages.
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 packages.
RUN --mount=type=cache,target=/var/cache/dnf \
dnf upgrade-minimal -y && \
dnf --enablerepo=powertools install -y \
make git findutils gcc gcc-c++ cmake curl openssl-devel perl python3 \
libstdc++-static

# install protoc.
# renovate: datasource=github-release depName=protocolbuffers/protobuf
Expand All @@ -38,9 +30,7 @@ ENV PATH /root/.cargo/bin/:$PATH
FROM builder as building
COPY . /tikv
RUN --mount=type=cache,target=/tikv/target \
source /opt/rh/devtoolset-${DEVTOOLSET_VER}/enable && \
ROCKSDB_SYS_STATIC=1 \
make dist_release -C /tikv
ROCKSDB_SYS_STATIC=1 make dist_release -C /tikv
RUN /tikv/bin/tikv-server --version

########### stage: Final image
Expand Down
13 changes: 5 additions & 8 deletions dockerfiles/cd/builders/tikv/fips.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,17 @@ ENV PATH /root/.cargo/bin/:$PATH

########### stage: Buiding
FROM builder as building
COPY . /tikv
COPY . /ws
RUN --mount=type=cache,target=/tikv/target \
source /opt/rh/devtoolset-8/enable && \
ENABLE_FIPS=1 \
ROCKSDB_SYS_STATIC=1 \
make dist_release -C /tikv
RUN /tikv/bin/tikv-server --version
ENABLE_FIPS=1 ROCKSDB_SYS_STATIC=1 make dist_release -C /ws
RUN /ws/bin/tikv-server --version

########### stage: Final image
FROM ghcr.io/pingcap-qe/bases/tikv-base:v1.9.1-fips

ENV MALLOC_CONF="prof:true,prof_active:false"
COPY --from=building /tikv/bin/tikv-server /tikv-server
COPY --from=building /tikv/bin/tikv-ctl /tikv-ctl
COPY --from=building /ws/bin/tikv-server /tikv-server
COPY --from=building /ws/bin/tikv-ctl /tikv-ctl

EXPOSE 20160
ENTRYPOINT ["/tikv-server"]

0 comments on commit 840ef94

Please sign in to comment.