1- FROM nginx:1.26.3 -alpine AS builder
1+ FROM nginx:1.24.0 -alpine AS builder
22
33# 设置 ModSecurity 版本
44ENV MODSECURITY_VERSION=v3.0.14
@@ -33,9 +33,9 @@ RUN apk add --no-cache --virtual .build-deps \
3333WORKDIR /opt
3434
3535# 下载 Nginx 源码
36- RUN wget https://nginx.org/download/nginx-1.26.3 .tar.gz \
37- && tar -xzf nginx-1.26.3 .tar.gz \
38- && rm nginx-1.26.3 .tar.gz
36+ RUN wget https://nginx.org/download/nginx-1.24.0 .tar.gz \
37+ && tar -xzf nginx-1.24.0 .tar.gz \
38+ && rm nginx-1.24.0 .tar.gz
3939
4040# 下载 ModSecurity
4141RUN git clone --depth 1 -b ${MODSECURITY_VERSION} https://github.com/owasp-modsecurity/ModSecurity.git
@@ -54,15 +54,15 @@ RUN cd /opt/ModSecurity \
5454 && make clean
5555
5656# 编译 Nginx 与 ModSecurity 模块
57- RUN cd /opt/nginx-1.26.3 \
57+ RUN cd /opt/nginx-1.24.0 \
5858 && ./configure --with-compat --add-dynamic-module=/opt/ModSecurity-nginx \
5959 && make modules \
6060 && cp objs/ngx_http_modsecurity_module.so /etc/nginx/modules \
6161 && mkdir -p /etc/nginx/modsec \
6262 && cp /opt/ModSecurity/unicode.mapping /etc/nginx/modsec/
6363
6464# 最终镜像
65- FROM nginx:1.26.3 -alpine AS final
65+ FROM nginx:1.24.0 -alpine AS final
6666
6767# 安装运行时依赖
6868RUN apk add --no-cache --purge --virtual .runtime-deps \
@@ -82,7 +82,7 @@ COPY --from=builder /etc/nginx/modsec/unicode.mapping /etc/nginx/modsec/
8282
8383# 添加构建信息标签
8484LABEL maintainer="AptS-1547 <
[email protected] >" \
85- nginx_version="1.26.3 " \
85+ nginx_version="1.24.0 " \
8686 modsecurity_version="v3.0.14" \
8787 modsecurity_nginx_version="v1.0.3" \
88- build_date="2025-05-21T04:47:38Z "
88+ build_date="2025-05-21T05:00:13Z "
0 commit comments