Skip to content

Commit 4aeb76d

Browse files
committed
尝试新编译
1 parent 7f3beab commit 4aeb76d

File tree

3 files changed

+16
-20
lines changed

3 files changed

+16
-20
lines changed

.github/workflows/docker-publish.yml

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ jobs:
2727
- name: Set up Docker Buildx
2828
uses: docker/setup-buildx-action@v2
2929

30+
- name: Download ngx_waf-10.1.2
31+
run: |
32+
chmod +x build.sh && ./build.sh
33+
3034
- name: Docker meta
3135
id: meta
3236
uses: docker/metadata-action@v4

Dockerfile

+5-20
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
ARG RESTY_IMAGE_BASE="ubuntu"
55
ARG RESTY_IMAGE_TAG="focal"
6-
ARG LIB_SODIUM_VER=1.0.18-RELEASE
76

87
FROM ${RESTY_IMAGE_BASE}:${RESTY_IMAGE_TAG}
98

@@ -12,7 +11,7 @@ LABEL maintainer="Evan Wies <evan@neomantra.net>"
1211
# Docker Build Arguments
1312
ARG RESTY_IMAGE_BASE="ubuntu"
1413
ARG RESTY_IMAGE_TAG="focal"
15-
ARG RESTY_VERSION="1.25.3.1"
14+
ARG RESTY_VERSION="1.25.3.2"
1615
ARG RESTY_LUAROCKS_VERSION="3.11.0"
1716
ARG RESTY_OPENSSL_VERSION="1.1.1w"
1817
ARG RESTY_OPENSSL_PATCH_VERSION="1.1.1f"
@@ -41,6 +40,7 @@ ARG RESTY_CONFIG_OPTIONS="\
4140
--with-http_stub_status_module \
4241
--with-http_sub_module \
4342
--with-http_v2_module \
43+
--with-http_v3_module \
4444
--with-http_xslt_module=dynamic \
4545
--with-ipv6 \
4646
--with-mail \
@@ -50,8 +50,7 @@ ARG RESTY_CONFIG_OPTIONS="\
5050
--with-stream \
5151
--with-stream_ssl_module \
5252
--with-threads \
53-
--with-cc-opt='-fstack-protector-strong' \
54-
--add-module=/usr/local/src/ngx_waf \
53+
--add-module=/usr/local/src/ngx_waf-10.1.2 \
5554
"
5655
ARG RESTY_CONFIG_OPTIONS_MORE=""
5756
ARG RESTY_LUAJIT_OPTIONS="--with-luajit-xcflags='-DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT'"
@@ -90,11 +89,10 @@ LABEL resty_eval_post_make="${RESTY_EVAL_POST_MAKE}"
9089
LABEL resty_luajit_options="${RESTY_LUAJIT_OPTIONS}"
9190
LABEL resty_pcre_options="${RESTY_PCRE_OPTIONS}"
9291

93-
COPY ngx_waf /usr/local/src/ngx_waf
92+
COPY ngx_waf-10.1.2 /usr/local/src/ngx_waf-10.1.2
9493

9594
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
9695
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
97-
git \
9896
build-essential \
9997
ca-certificates \
10098
curl \
@@ -110,19 +108,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \
110108
unzip \
111109
wget \
112110
zlib1g-dev \
113-
libcurl4-openssl-dev \
114-
libmodsecurity-dev \
115-
libmodsecurity3 \
116111
${RESTY_ADD_PACKAGE_BUILDDEPS} \
117112
${RESTY_ADD_PACKAGE_RUNDEPS} \
118-
&& git clone -b v1.7.15 https://github.com/DaveGamble/cJSON.git /tmp/ngx_waf/lib/cjson \
119-
&& git clone -b v2.3.0 https://github.com/troydhanson/uthash.git /tmp/ngx_waf/lib/uthash \
120-
&& git clone https://github.com/jedisct1/libsodium.git --branch 1.0.18-RELEASE /tmp/libsodium \
121-
&& cd /tmp/libsodium \
122-
&& ./configure --prefix=/usr/local/libsodium --with-pic \
123-
&& make \
124-
&& make check \
125-
&& make install \
126113
&& cd /tmp \
127114
&& if [ -n "${RESTY_EVAL_PRE_CONFIGURE}" ]; then eval $(echo ${RESTY_EVAL_PRE_CONFIGURE}); fi \
128115
&& curl -fSL "${RESTY_OPENSSL_URL_BASE}/openssl-${RESTY_OPENSSL_VERSION}.tar.gz" -o openssl-${RESTY_OPENSSL_VERSION}.tar.gz \
@@ -162,7 +149,6 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \
162149
&& curl -fSL https://openresty.org/download/openresty-${RESTY_VERSION}.tar.gz -o openresty-${RESTY_VERSION}.tar.gz \
163150
&& tar xzf openresty-${RESTY_VERSION}.tar.gz \
164151
&& cd /tmp/openresty-${RESTY_VERSION} \
165-
&& export LIB_SODIUM=/usr/local/libsodium \
166152
&& if [ -n "${RESTY_EVAL_POST_DOWNLOAD_PRE_CONFIGURE}" ]; then eval $(echo ${RESTY_EVAL_POST_DOWNLOAD_PRE_CONFIGURE}); fi \
167153
&& eval ./configure -j${RESTY_J} ${_RESTY_CONFIG_DEPS} ${RESTY_CONFIG_OPTIONS} ${RESTY_CONFIG_OPTIONS_MORE} ${RESTY_LUAJIT_OPTIONS} ${RESTY_PCRE_OPTIONS} \
168154
&& make -j${RESTY_J} \
@@ -178,7 +164,6 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \
178164
&& ./configure \
179165
--prefix=/usr/local/openresty/luajit \
180166
--with-lua=/usr/local/openresty/luajit \
181-
--lua-suffix=jit-2.1.0-beta3 \
182167
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1 \
183168
&& make build \
184169
&& make install \
@@ -198,7 +183,7 @@ ENV PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/
198183
# If OpenResty changes, these may need updating:
199184
# /usr/local/openresty/bin/resty -e 'print(package.path)'
200185
# /usr/local/openresty/bin/resty -e 'print(package.cpath)'
201-
ENV LUA_PATH="/usr/local/openresty/site/lualib/?.ljbc;/usr/local/openresty/site/lualib/?/init.ljbc;/usr/local/openresty/lualib/?.ljbc;/usr/local/openresty/lualib/?/init.ljbc;/usr/local/openresty/site/lualib/?.lua;/usr/local/openresty/site/lualib/?/init.lua;/usr/local/openresty/lualib/?.lua;/usr/local/openresty/lualib/?/init.lua;./?.lua;/usr/local/openresty/luajit/share/luajit-2.1.0-beta3/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/openresty/luajit/share/lua/5.1/?.lua;/usr/local/openresty/luajit/share/lua/5.1/?/init.lua"
186+
ENV LUA_PATH="/usr/local/openresty/site/lualib/?.ljbc;/usr/local/openresty/site/lualib/?/init.ljbc;/usr/local/openresty/lualib/?.ljbc;/usr/local/openresty/lualib/?/init.ljbc;/usr/local/openresty/site/lualib/?.lua;/usr/local/openresty/site/lualib/?/init.lua;/usr/local/openresty/lualib/?.lua;/usr/local/openresty/lualib/?/init.lua;./?.lua;/usr/local/openresty/luajit/share/luajit-2.1/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/openresty/luajit/share/lua/5.1/?.lua;/usr/local/openresty/luajit/share/lua/5.1/?/init.lua"
202187

203188
ENV LUA_CPATH="/usr/local/openresty/site/lualib/?.so;/usr/local/openresty/lualib/?.so;./?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/openresty/luajit/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so;/usr/local/openresty/luajit/lib/lua/5.1/?.so"
204189

build.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
if [ ! -f v10.1.2.zip ]; then
4+
wget https://github.com/ADD-SP/ngx_waf/archive/refs/tags/v10.1.2.zip
5+
fi
6+
7+
rm -rf ngx_waf-10.1.2 && unzip v10.1.2.zip

0 commit comments

Comments
 (0)