From 5b8344a9064ddedc8cb23e2b5dcd91c9880c4cfd Mon Sep 17 00:00:00 2001 From: Odboy Date: Sat, 10 Jan 2026 21:49:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20system-alinux3=20=E5=86=99=E5=85=A5?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20dnf.conf=20=E5=B9=B6=E9=A2=84=E5=88=B6?= =?UTF-8?q?=E5=85=83=E6=95=B0=E6=8D=AE=E7=BC=93=E5=AD=98=EF=BC=9Bproxy-ten?= =?UTF-8?q?gine3=20=E6=9E=84=E5=BB=BA=E7=A6=81=E7=94=A8=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- image/proxy-tengine3/build.sh | 2 +- image/system-alinux3/Dockerfile | 27 ++++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/image/proxy-tengine3/build.sh b/image/proxy-tengine3/build.sh index 1e5e2e4..540ccaa 100755 --- a/image/proxy-tengine3/build.sh +++ b/image/proxy-tengine3/build.sh @@ -11,5 +11,5 @@ if [ ! -f "${TENGINE}" ]; then fi IMAGE=registry.cn-shanghai.aliyuncs.com/odboy/kenaito:proxy-tengine3 -docker build -t "${IMAGE}" . +docker build --no-cache -t "${IMAGE}" . docker push "${IMAGE}" diff --git a/image/system-alinux3/Dockerfile b/image/system-alinux3/Dockerfile index 86a95df..e84a928 100644 --- a/image/system-alinux3/Dockerfile +++ b/image/system-alinux3/Dockerfile @@ -7,5 +7,30 @@ WORKDIR /home/admin # 升级会有很多问题,比如nginx编译失败等 #RUN yum update -y && yum clean all; +# 替换公网源 RUN ln -snf /usr/share/zoneinfo/$TimeZone /etc/localtime && echo $TimeZone > /etc/timezone; \ - sed -i 's/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/' /etc/yum.repos.d/*.repo; \ No newline at end of file + sed -i 's/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/' /etc/yum.repos.d/*.repo; + +# 写入优化dnf.conf +RUN cat > /etc/dnf/dnf.conf <<'EOF' +[main] +gpgcheck=1 +installonly_limit=3 +clean_requirements_on_remove=True +max_parallel_downloads=12 +# 镜像构建阶段一次性 makecache,运行时完全不刷元数据 +metadata_expire=-1 +check_config_file_age=False +skip_if_unavailable=True +# 海外千万别开,测速会疯狂重试 +fastestmirror=0 +keepcache=True +metadata_timer_sync=0 +# 置空,关闭 module 机制,大幅提速 +module_platform_id= +timeout=30 +minrate=2048 +EOF + +# 预制缓存,打进镜像 +RUN dnf clean all && dnf makecache \ No newline at end of file