Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dockerfiles/bases): shrink base image size #431

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dockerfiles/bases/ng-monitoring-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ARG PINGCAP_BASE
FROM $PINGCAP_BASE
RUN dnf install perl-interpreter -y && \
dnf clean all
RUN dnf install perl-interpreter -y \
&& dnf clean all \
&& rm -rf /var/cache/yum
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM pingcap/centos-stream:8 AS arm64
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 \
&& _date=20240919 dnf upgrade -y && dnf clean all \
&& _date=20240920 dnf upgrade -y && dnf clean all && rm -rf /var/cache/yum \
&& 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
Expand Down
5 changes: 3 additions & 2 deletions dockerfiles/bases/pd-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ARG PINGCAP_BASE
FROM $PINGCAP_BASE
RUN dnf install bind-utils wget jq perl-interpreter -y && \
dnf clean all
RUN dnf install bind-utils wget jq perl-interpreter -y \
&& dnf clean all \
&& rm -rf /var/cache/yum
2 changes: 1 addition & 1 deletion dockerfiles/bases/pd-base/release-6.5.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ FROM pingcap/centos-stream:8 AS arm64
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 \
&& _date=20240919 dnf upgrade -y && dnf clean all \
&& _date=20240920 dnf upgrade -y && dnf clean all && rm -rf /var/cache/yum \
&& 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
2 changes: 1 addition & 1 deletion dockerfiles/bases/pingcap-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM quay.io/rockylinux/rockylinux:9.4.20240523
COPY --from=busybox:1.36.1 /bin/busybox /bin/busybox
RUN _date=20240730 dnf upgrade -y && dnf clean all
RUN _date=20240920 dnf upgrade -y && dnf clean all && rm -rf /var/cache/yum
6 changes: 3 additions & 3 deletions dockerfiles/bases/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ build:
cache: {}
tagPolicy:
customTemplate:
template: "v1.9.1"
template: "v1.9.2"
cluster:
concurrency: 0
randomDockerConfigSecret: false
Expand Down Expand Up @@ -118,7 +118,7 @@ build:
cache: {}
tagPolicy:
customTemplate:
template: "v1.9.1-fips"
template: "v1.9.2-fips"
cluster:
concurrency: 0
randomDockerConfigSecret: false
Expand Down Expand Up @@ -202,7 +202,7 @@ build:
path: tools-base/release-6.5.Dockerfile
tagPolicy:
customTemplate:
template: "v1.0.1-old"
template: "v1.0.2-old"
local:
useDockerCLI: true
useBuildkit: true
Expand Down
4 changes: 3 additions & 1 deletion dockerfiles/bases/tidb-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ARG PINGCAP_BASE
FROM $PINGCAP_BASE
RUN dnf install --allowerasing -y curl wget && dnf clean all
RUN dnf install --allowerasing -y curl wget \
&& dnf clean all \
&& rm -rf /var/cache/yum
7 changes: 4 additions & 3 deletions dockerfiles/bases/tidb-base/release-6.5.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ FROM pingcap/centos-stream:8 AS arm64
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 \
&& _date=20240919 dnf upgrade -y && dnf clean all \
&& _date=20240920 dnf upgrade -y && dnf clean all && rm -rf /var/cache/yum \
&& 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
RUN set -e && \
dnf install bind-utils curl nmap-ncat -y && \
dnf clean all
dnf install bind-utils curl nmap-ncat -y \
&& dnf clean all \
&& rm -rf /var/cache/yum
4 changes: 3 additions & 1 deletion dockerfiles/bases/tiflash-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ARG PINGCAP_BASE
FROM $PINGCAP_BASE
RUN dnf install --allowerasing -y wget && dnf clean all
RUN dnf install --allowerasing -y wget \
&& dnf clean all \
&& rm -rf /var/cache/yum
4 changes: 3 additions & 1 deletion dockerfiles/bases/tikv-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG PINGCAP_BASE
FROM $PINGCAP_BASE
# wget is requested by operator
RUN dnf install -y tzdata wget && dnf clean all
RUN dnf install -y tzdata wget \
&& dnf clean all \
&& rm -rf /var/cache/yum
ENV TZ=/etc/localtime \
TZDIR=/usr/share/zoneinfo
4 changes: 3 additions & 1 deletion dockerfiles/bases/tikv-base/fips.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG PINGCAP_BASE=ghcr.io/pingcap-qe/bases/pingcap-base:v1.9.1
FROM $PINGCAP_BASE
# wget is requested by operator
RUN dnf install -y tzdata wget openssl && dnf clean all
RUN dnf install -y tzdata wget openssl \
&& dnf clean all \
&& rm -rf /var/cache/yum
ENV TZ=/etc/localtime \
TZDIR=/usr/share/zoneinfo
2 changes: 1 addition & 1 deletion dockerfiles/bases/tikv-base/release-6.5.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FROM pingcap/centos-stream:8 AS arm64
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 \
&& _date=20240919 dnf upgrade -y && dnf clean all \
&& _date=20240920 dnf upgrade -y && dnf clean all && rm -rf /var/cache/yum \
&& 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
Expand Down
4 changes: 3 additions & 1 deletion dockerfiles/bases/tools-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ARG PINGCAP_BASE
FROM $PINGCAP_BASE
RUN dnf install -y bind-utils wget nc && dnf clean all
RUN dnf install -y bind-utils wget nc \
&& dnf clean all \
&& rm -rf /var/cache/yum
2 changes: 1 addition & 1 deletion dockerfiles/bases/tools-base/release-6.5.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ FROM pingcap/centos-stream:8 AS arm64
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 \
&& _date=20240919 dnf upgrade -y && dnf clean all \
&& _date=20240920 dnf upgrade -y && dnf clean all && rm -rf /var/cache/yum \
&& 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
Expand Down