From fb7f8ed080824f1ac1ec6275e539614e6d572cbd Mon Sep 17 00:00:00 2001 From: Odboy Date: Sat, 17 Jan 2026 21:23:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20alinux3=20=E9=87=8D=E5=BB=BA=E4=B8=BA?= =?UTF-8?q?=20Anolis=208=20=E9=98=BF=E9=87=8C=E4=BA=91=E6=BA=90=20+=20EPEL?= =?UTF-8?q?8=EF=BC=9Bproxy-tengine3=20=E6=94=B9=E7=94=A8=20system-alinux4?= =?UTF-8?q?=20=E5=9F=BA=E7=A1=80=E9=95=9C=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- image/proxy-tengine3/Dockerfile | 4 +-- image/system-alinux3/Dockerfile | 53 +++++++++++++++++------------ image/system-alinux3/Dockerfile_bak | 35 +++++++++++++++++++ 3 files changed, 68 insertions(+), 24 deletions(-) create mode 100644 image/system-alinux3/Dockerfile_bak diff --git a/image/proxy-tengine3/Dockerfile b/image/proxy-tengine3/Dockerfile index 4b42007..87973e4 100644 --- a/image/proxy-tengine3/Dockerfile +++ b/image/proxy-tengine3/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.cn-shanghai.aliyuncs.com/odboy/kenaito:system-alinux3 +FROM registry.cn-shanghai.aliyuncs.com/odboy/kenaito:system-alinux4 LABEL MAINTAINER="tianjun@odboy.cn" ENV TimeZone=Asia/Shanghai ENV TENGINE_VERSION=3.1.0 @@ -11,7 +11,7 @@ COPY nginx.conf ${NGINX_HOME}/conf/nginx.conf # 由 build.sh 预先下载到本目录 ADD tengine-${TENGINE_VERSION}.tar.gz ./ # gcc/gcc-c++/make 用于编译 tengine;sysstat/net-tools 用于排障 -RUN yum install \ +RUN set -e && yum install \ gcc \ gcc-c++ \ make \ diff --git a/image/system-alinux3/Dockerfile b/image/system-alinux3/Dockerfile index e84a928..ad350d4 100644 --- a/image/system-alinux3/Dockerfile +++ b/image/system-alinux3/Dockerfile @@ -7,30 +7,39 @@ 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; +# 全局锁 releasever=8 +RUN mkdir -p /etc/dnf/vars && echo 8 > /etc/dnf/vars/releasever -# 写入优化dnf.conf -RUN cat > /etc/dnf/dnf.conf <<'EOF' -[main] +# 删除原有全部repo,手写 Anolis 8 阿里云源 +RUN rm -rf /etc/yum.repos.d/* && \ +cat > /etc/yum.repos.d/anolis-base.repo <<'EOF' +[anolis-BaseOS] +name=Anolis 8 BaseOS +baseurl=https://mirrors.aliyun.com/anolis/8/BaseOS/$basearch/os/ 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 +gpgkey=https://mirrors.aliyun.com/anolis/RPM-GPG-KEY-Anolis-8 +enabled=1 + +[anolis-AppStream] +name=Anolis 8 AppStream +baseurl=https://mirrors.aliyun.com/anolis/8/AppStream/$basearch/os/ +gpgcheck=1 +gpgkey=https://mirrors.aliyun.com/anolis/RPM-GPG-KEY-Anolis-8 +enabled=1 EOF -# 预制缓存,打进镜像 +# ========== 修复后的 EPEL8(重点:加 Everything) ========== +RUN cat > /etc/yum.repos.d/epel.repo <<'EOF' +[epel] +name=Extra Packages for Enterprise Linux 8 +baseurl=https://mirrors.aliyun.com/epel/8/Everything/$basearch +gpgcheck=1 +gpgkey=https://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-8 +enabled=1 +EOF + +# dnf 调优 +RUN echo -e "max_parallel_downloads=10\nmetadata_expire=3600\nmetadata_timer_sync=0\ndeltarpm=False\ntimeout=15\nminrate=200k" >> /etc/dnf/dnf.conf + +# 缓存 RUN dnf clean all && dnf makecache \ No newline at end of file diff --git a/image/system-alinux3/Dockerfile_bak b/image/system-alinux3/Dockerfile_bak new file mode 100644 index 0000000..27f5a59 --- /dev/null +++ b/image/system-alinux3/Dockerfile_bak @@ -0,0 +1,35 @@ +#FROM alibaba-cloud-linux-3-registry.cn-hangzhou.cr.aliyuncs.com/alinux3/alinux3:220901.1 +FROM alibaba-cloud-linux-3-registry.cn-hangzhou.cr.aliyuncs.com/alinux3/alinux3:3.13.3 +LABEL MAINTAINER="tianjun@odboy.cn" +ENV TimeZone=Asia/Shanghai +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; + +# 写入优化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