diff --git a/Base/Compile/dotnet6/Dockerfile b/Base/Compile/dotnet6/Dockerfile index ec3671d..545c301 100644 --- a/Base/Compile/dotnet6/Dockerfile +++ b/Base/Compile/dotnet6/Dockerfile @@ -6,9 +6,7 @@ ENV PATH="${DOTNET_HOME}:$PATH" WORKDIR /home/admin # https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-6.0.427-linux-x64-binaries ADD https://download.visualstudio.microsoft.com/download/pr/12ee34e8-640c-400e-a6dc-4892b442df92/81d40fc98a5bbbfbafa4cc1ab86d6288/dotnet-sdk-6.0.427-linux-x64.tar.gz ./ -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; \ - yum install \ +RUN yum install \ libffi-devel \ zlib-devel \ bzip2-devel \ diff --git a/Base/Compile/dotnet8/Dockerfile b/Base/Compile/dotnet8/Dockerfile index c31e88b..56806e4 100644 --- a/Base/Compile/dotnet8/Dockerfile +++ b/Base/Compile/dotnet8/Dockerfile @@ -6,9 +6,7 @@ ENV PATH="${DOTNET_HOME}:$PATH" WORKDIR /home/admin # https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-8.0.403-linux-x64-binaries ADD https://download.visualstudio.microsoft.com/download/pr/ca6cd525-677e-4d3a-b66c-11348a6f920a/ec395f498f89d0ca4d67d903892af82d/dotnet-sdk-8.0.403-linux-x64.tar.gz ./ -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; \ - yum install \ +RUN yum install \ libffi-devel \ zlib-devel \ bzip2-devel \ diff --git a/Base/Compile/dotnet9/Dockerfile b/Base/Compile/dotnet9/Dockerfile index 76fc38c..756319f 100644 --- a/Base/Compile/dotnet9/Dockerfile +++ b/Base/Compile/dotnet9/Dockerfile @@ -6,9 +6,7 @@ ENV PATH="${DOTNET_HOME}:$PATH" WORKDIR /home/admin # https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-9.0.100-rc.2-linux-x64-binaries ADD https://builds.dotnet.microsoft.com/dotnet/Sdk/9.0.100-rc.2.24474.11/dotnet-sdk-9.0.100-rc.2.24474.11-linux-x64.tar.gz ./ -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; \ - yum install \ +RUN yum install \ libffi-devel \ zlib-devel \ bzip2-devel \ diff --git a/Base/Composite/java11/Dockerfile b/Base/Composite/java11/Dockerfile index d3e8d83..ec4b049 100644 --- a/Base/Composite/java11/Dockerfile +++ b/Base/Composite/java11/Dockerfile @@ -5,9 +5,7 @@ ENV JAVA_HOME=/usr/local/java ENV PATH="${JAVA_HOME}/bin:$PATH" WORKDIR /home/admin ADD jdk-11.0.2.tar.gz ./ -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; \ - yum install \ +RUN yum install \ tar \ wget \ net-tools \ diff --git a/Base/Composite/java17/Dockerfile b/Base/Composite/java17/Dockerfile index b7d6cd9..b203a3f 100644 --- a/Base/Composite/java17/Dockerfile +++ b/Base/Composite/java17/Dockerfile @@ -5,9 +5,7 @@ ENV JAVA_HOME=/usr/local/java ENV PATH="${JAVA_HOME}/bin:$PATH" WORKDIR /home/admin ADD jdk-17.0.2.tar.gz ./ -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; \ - yum install \ +RUN yum install \ tar \ wget \ net-tools \ diff --git a/Base/Composite/java21/Dockerfile b/Base/Composite/java21/Dockerfile index a2b61b3..38b44a5 100644 --- a/Base/Composite/java21/Dockerfile +++ b/Base/Composite/java21/Dockerfile @@ -5,9 +5,7 @@ ENV JAVA_HOME=/usr/local/java ENV PATH="${JAVA_HOME}/bin:$PATH" WORKDIR /home/admin ADD jdk-21.0.2.tar.gz ./ -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; \ - yum install \ +RUN yum install \ tar \ wget \ net-tools \ diff --git a/Base/Composite/python3/Dockerfile b/Base/Composite/python3/Dockerfile index 39a68d5..8ca4d4b 100644 --- a/Base/Composite/python3/Dockerfile +++ b/Base/Composite/python3/Dockerfile @@ -5,9 +5,7 @@ ENV PYTHON_HOME=/usr/local/python3 ENV PATH="${PYTHON_HOME}/bin:$PATH" WORKDIR /home/admin ADD https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz ./ -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; \ - yum install \ +RUN yum install \ libffi-devel \ zlib-devel \ bzip2-devel \ diff --git a/Base/Runtime/dotnet6/Dockerfile b/Base/Runtime/dotnet6/Dockerfile index c21d1c4..fd120ef 100644 --- a/Base/Runtime/dotnet6/Dockerfile +++ b/Base/Runtime/dotnet6/Dockerfile @@ -6,9 +6,7 @@ ENV PATH="${DOTNET_HOME}:$PATH" WORKDIR /home/admin # https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-aspnetcore-6.0.35-linux-x64-binaries ADD https://download.visualstudio.microsoft.com/download/pr/ccdb3628-8f55-411b-b0f1-669d42604ad8/81283ab8762aaab1be72772711f07f86/aspnetcore-runtime-6.0.35-linux-x64.tar.gz ./ -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; \ - yum install \ +RUN yum install \ libffi-devel \ zlib-devel \ bzip2-devel \ diff --git a/Base/Runtime/dotnet8/Dockerfile b/Base/Runtime/dotnet8/Dockerfile index 6a6f1ed..a6d3581 100644 --- a/Base/Runtime/dotnet8/Dockerfile +++ b/Base/Runtime/dotnet8/Dockerfile @@ -6,9 +6,7 @@ ENV PATH="${DOTNET_HOME}:$PATH" WORKDIR /home/admin # https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-aspnetcore-8.0.10-linux-x64-binaries ADD https://download.visualstudio.microsoft.com/download/pr/6d143cf6-e215-428e-bcde-9fd50ea0e1be/99652e31b3e0161a3f1f933e0bedf223/aspnetcore-runtime-8.0.10-linux-x64.tar.gz ./ -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; \ - yum install \ +RUN yum install \ libffi-devel \ zlib-devel \ bzip2-devel \ diff --git a/Base/Runtime/dotnet9/Dockerfile b/Base/Runtime/dotnet9/Dockerfile index 2ab09c5..81a3594 100644 --- a/Base/Runtime/dotnet9/Dockerfile +++ b/Base/Runtime/dotnet9/Dockerfile @@ -6,9 +6,7 @@ ENV PATH="${DOTNET_HOME}:$PATH" WORKDIR /home/admin # https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-aspnetcore-9.0.0-rc.2-linux-x64-binaries ADD https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.0-rc.2.24474.3/aspnetcore-runtime-9.0.0-rc.2.24474.3-linux-x64.tar.gz ./ -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; \ - yum install \ +RUN yum install \ libffi-devel \ zlib-devel \ bzip2-devel \ diff --git a/Other/ansible/Dockerfile b/Other/ansible/Dockerfile index 3cc0bc6..7b87c99 100644 --- a/Other/ansible/Dockerfile +++ b/Other/ansible/Dockerfile @@ -5,9 +5,7 @@ ENV PYTHON_HOME=/usr/local/python3 ENV PATH="${PYTHON_HOME}/bin:$PATH" WORKDIR /home/admin ADD https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz ./ -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; \ - yum install \ +RUN yum install \ libffi-devel \ zlib-devel \ bzip2-devel \ diff --git a/Other/nginx-tengine-3.1.0/Dockerfile b/Other/nginx-tengine-3.1.0/Dockerfile index 1962c03..aac37f5 100644 --- a/Other/nginx-tengine-3.1.0/Dockerfile +++ b/Other/nginx-tengine-3.1.0/Dockerfile @@ -7,9 +7,7 @@ ENV PATH="${NGINX_HOME}/sbin:$PATH" WORKDIR /home/admin # https://tengine.taobao.org/download/tengine-3.1.0.tar.gz ADD https://tengine.taobao.org/download/tengine-${TENGINE_VERSION}.tar.gz ./ -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; \ - yum install \ +RUN yum install \ gcc \ gcc-c++ \ make \ diff --git a/System/Dockerfile b/System/Dockerfile index 00de637..4d9e7a6 100644 --- a/System/Dockerfile +++ b/System/Dockerfile @@ -9,7 +9,5 @@ WORKDIR /home/admin # wget \ # net-tools \ # bind-utils -y; -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; \ - yum update -y && yum clean all; \ +RUN yum update -y && yum clean all; \ rm -rf /usr/lib/python3.6; diff --git a/System/VULNERABILITY_FIX.md b/System/VULNERABILITY_FIX.md index 38ef12d..e7d4a90 100644 --- a/System/VULNERABILITY_FIX.md +++ b/System/VULNERABILITY_FIX.md @@ -80,11 +80,14 @@ LABEL MAINTAINER="tianjun@odboy.cn" ENV TimeZone=Asia/Shanghai WORKDIR /home/admin -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; \ - yum update -y && yum clean all +RUN yum update -y && yum clean all; \ + rm -rf /usr/lib/python3.6 ``` +> 说明:ALinux3 官方镜像的 repo 已使用 `mirrors.aliyun.com`,不需要再做 `mirrors.cloud.aliyuncs.com` 换源; +> 时区由 `ENV TimeZone` 控制,运行时通常会被容器引擎挂载的宿主机 `/etc/localtime` 覆盖, +> 因此子镜像也不再重复 `ln -snf ... /etc/localtime`。 + 然后执行构建: ```bash