1- FROM nginx:1.18.0 -alpine AS builder
1+ FROM nginx:1.16.1 -alpine AS builder
22
33# 设置 ModSecurity 版本
44ENV MODSECURITY_VERSION=v3.0.14
@@ -34,9 +34,9 @@ RUN apk add --no-cache --virtual .build-deps \
3434WORKDIR /opt
3535
3636# 下载 Nginx 源码
37- RUN wget https://nginx.org/download/nginx-1.18.0 .tar.gz \
38- && tar -xzf nginx-1.18.0 .tar.gz \
39- && rm nginx-1.18.0 .tar.gz
37+ RUN wget https://nginx.org/download/nginx-1.16.1 .tar.gz \
38+ && tar -xzf nginx-1.16.1 .tar.gz \
39+ && rm nginx-1.16.1 .tar.gz
4040
4141# 下载 ModSecurity
4242RUN git clone --depth 1 -b ${MODSECURITY_VERSION} https://github.com/owasp-modsecurity/ModSecurity.git
@@ -55,15 +55,15 @@ RUN cd /opt/ModSecurity \
5555 && make clean
5656
5757# 编译 Nginx 与 ModSecurity 模块
58- RUN cd /opt/nginx-1.18.0 \
58+ RUN cd /opt/nginx-1.16.1 \
5959 && ./configure --with-compat --add-dynamic-module=/opt/ModSecurity-nginx \
6060 && make modules \
6161 && cp objs/ngx_http_modsecurity_module.so /etc/nginx/modules \
6262 && mkdir -p /etc/nginx/modsec \
6363 && cp /opt/ModSecurity/unicode.mapping /etc/nginx/modsec/
6464
6565# 最终镜像
66- FROM nginx:1.18.0 -alpine AS final
66+ FROM nginx:1.16.1 -alpine AS final
6767
6868# 安装运行时依赖
6969RUN apk add --no-cache --purge --virtual .runtime-deps \
@@ -84,7 +84,7 @@ COPY --from=builder /etc/nginx/modsec/unicode.mapping /etc/nginx/modsec/
8484
8585# 添加构建信息标签
8686LABEL maintainer="AptS-1547 <
[email protected] >" \
87- nginx_version="1.18.0 " \
87+ nginx_version="1.16.1 " \
8888 modsecurity_version="v3.0.14" \
8989 modsecurity_nginx_version="v1.0.3" \
90- build_date="2025-05-21T08:29:46Z "
90+ build_date="2025-05-21T08:09:10Z "
0 commit comments