Skip to content

Commit 70de075

Browse files
committed
回退版本
1 parent 3c00b0a commit 70de075

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

Dockerfile

+19-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

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

78
FROM ${RESTY_IMAGE_BASE}:${RESTY_IMAGE_TAG}
89

@@ -11,15 +12,15 @@ LABEL maintainer="Evan Wies <evan@neomantra.net>"
1112
# Docker Build Arguments
1213
ARG RESTY_IMAGE_BASE="ubuntu"
1314
ARG RESTY_IMAGE_TAG="focal"
14-
ARG RESTY_VERSION="1.25.3.2"
15+
ARG RESTY_VERSION="1.25.3.1"
1516
ARG RESTY_LUAROCKS_VERSION="3.11.0"
1617
ARG RESTY_OPENSSL_VERSION="1.1.1w"
1718
ARG RESTY_OPENSSL_PATCH_VERSION="1.1.1f"
1819
ARG RESTY_OPENSSL_URL_BASE="https://www.openssl.org/source/old/1.1.1"
1920
ARG RESTY_PCRE_VERSION="8.45"
2021
ARG RESTY_PCRE_BUILD_OPTIONS="--enable-jit"
2122
ARG RESTY_PCRE_SHA256="4e6ce03e0336e8b4a3d6c2b70b1c5e18590a5673a98186da90d4f33c23defc09"
22-
ARG RESTY_J="2"
23+
ARG RESTY_J="1"
2324
ARG RESTY_CONFIG_OPTIONS="\
2425
--with-compat \
2526
--with-file-aio \
@@ -40,7 +41,6 @@ ARG RESTY_CONFIG_OPTIONS="\
4041
--with-http_stub_status_module \
4142
--with-http_sub_module \
4243
--with-http_v2_module \
43-
--with-http_v3_module \
4444
--with-http_xslt_module=dynamic \
4545
--with-ipv6 \
4646
--with-mail \
@@ -50,6 +50,7 @@ ARG RESTY_CONFIG_OPTIONS="\
5050
--with-stream \
5151
--with-stream_ssl_module \
5252
--with-threads \
53+
--with-cc-opt='-fstack-protector-strong' \
5354
--add-module=/usr/local/src/ngx_waf \
5455
"
5556
ARG RESTY_CONFIG_OPTIONS_MORE=""
@@ -93,6 +94,7 @@ COPY ngx_waf /usr/local/src/ngx_waf
9394

9495
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
9596
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
97+
git \
9698
build-essential \
9799
ca-certificates \
98100
curl \
@@ -108,8 +110,19 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \
108110
unzip \
109111
wget \
110112
zlib1g-dev \
113+
libcurl4-openssl-dev \
114+
libmodsecurity-dev \
115+
libmodsecurity3 \
111116
${RESTY_ADD_PACKAGE_BUILDDEPS} \
112117
${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 \
113126
&& cd /tmp \
114127
&& if [ -n "${RESTY_EVAL_PRE_CONFIGURE}" ]; then eval $(echo ${RESTY_EVAL_PRE_CONFIGURE}); fi \
115128
&& curl -fSL "${RESTY_OPENSSL_URL_BASE}/openssl-${RESTY_OPENSSL_VERSION}.tar.gz" -o openssl-${RESTY_OPENSSL_VERSION}.tar.gz \
@@ -149,6 +162,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \
149162
&& curl -fSL https://openresty.org/download/openresty-${RESTY_VERSION}.tar.gz -o openresty-${RESTY_VERSION}.tar.gz \
150163
&& tar xzf openresty-${RESTY_VERSION}.tar.gz \
151164
&& cd /tmp/openresty-${RESTY_VERSION} \
165+
&& export LIB_SODIUM=/usr/local/libsodium \
152166
&& if [ -n "${RESTY_EVAL_POST_DOWNLOAD_PRE_CONFIGURE}" ]; then eval $(echo ${RESTY_EVAL_POST_DOWNLOAD_PRE_CONFIGURE}); fi \
153167
&& eval ./configure -j${RESTY_J} ${_RESTY_CONFIG_DEPS} ${RESTY_CONFIG_OPTIONS} ${RESTY_CONFIG_OPTIONS_MORE} ${RESTY_LUAJIT_OPTIONS} ${RESTY_PCRE_OPTIONS} \
154168
&& make -j${RESTY_J} \
@@ -164,6 +178,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \
164178
&& ./configure \
165179
--prefix=/usr/local/openresty/luajit \
166180
--with-lua=/usr/local/openresty/luajit \
181+
--lua-suffix=jit-2.1.0-beta3 \
167182
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1 \
168183
&& make build \
169184
&& make install \
@@ -183,7 +198,7 @@ ENV PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/
183198
# If OpenResty changes, these may need updating:
184199
# /usr/local/openresty/bin/resty -e 'print(package.path)'
185200
# /usr/local/openresty/bin/resty -e 'print(package.cpath)'
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"
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"
187202

188203
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"
189204

0 commit comments

Comments
 (0)