|
1 | 1 | FROM nginx:1.27.4 as lua-builder |
2 | 2 |
|
3 | 3 | RUN apt-get update && apt-get install -y \ |
4 | | - build-essential \ |
5 | | - zlib1g-dev \ |
6 | | - libssl-dev \ |
7 | | - git \ |
8 | | - wget \ |
9 | | - ca-certificates |
| 4 | + build-essential zlib1g-dev libssl-dev git wget ca-certificates libreadline-dev \ |
| 5 | + libpcre2-dev \ |
| 6 | + && rm -rf /var/lib/apt/lists/* |
10 | 7 |
|
11 | 8 | WORKDIR /usr/src |
12 | 9 |
|
13 | | -RUN wget https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.42/pcre2-10.42.tar.gz && \ |
14 | | - tar zxvf pcre2-10.42.tar.gz && \ |
15 | | - cd pcre2-10.42 && \ |
16 | | - ./configure --prefix=/usr/local --enable-jit && \ |
17 | | - make && make install |
18 | | - |
19 | | -RUN git clone https://github.com/openresty/luajit2.git --branch v2.1-agentzh --single-branch |
| 10 | +RUN git clone --branch v2.1-agentzh --single-branch https://github.com/openresty/luajit2.git |
20 | 11 | WORKDIR /usr/src/luajit2 |
21 | | -RUN make && make install |
| 12 | +RUN make -j"$(nproc)" && make install |
22 | 13 |
|
23 | 14 | ENV PATH="/usr/local/bin:${PATH}" |
24 | 15 | ENV LD_LIBRARY_PATH="/usr/local/lib:${LD_LIBRARY_PATH}" |
25 | 16 |
|
26 | 17 | WORKDIR /usr/src |
27 | | - |
28 | | -RUN git clone --branch v0.3.2 https://github.com/simpl/ngx_devel_kit.git |
| 18 | +RUN git clone --branch v0.3.2 https://github.com/simpl/ngx_devel_kit.git |
29 | 19 | RUN git clone --branch v0.10.25 https://github.com/openresty/lua-nginx-module.git |
30 | 20 |
|
31 | | -RUN wget http://nginx.org/download/nginx-1.27.4.tar.gz && tar zxvf nginx-1.27.4.tar.gz |
| 21 | +ARG NGINX_V=1.27.4 |
| 22 | +RUN wget http://nginx.org/download/nginx-${NGINX_V}.tar.gz \ |
| 23 | + && tar zxf nginx-${NGINX_V}.tar.gz |
32 | 24 |
|
33 | | -WORKDIR /usr/src/nginx-1.27.4 |
| 25 | +WORKDIR /usr/src/nginx-${NGINX_V} |
34 | 26 | ENV LUAJIT_LIB=/usr/local/lib |
35 | 27 | ENV LUAJIT_INC=/usr/local/include/luajit-2.1 |
36 | 28 |
|
37 | 29 | RUN ./configure --with-compat \ |
38 | | - --with-pcre=/usr/local \ |
39 | 30 | --add-dynamic-module=../ngx_devel_kit \ |
40 | 31 | --add-dynamic-module=../lua-nginx-module \ |
41 | 32 | --with-ld-opt="-Wl,-rpath,/usr/local/lib" \ |
42 | | - && make modules |
| 33 | + || { echo '--- CONFIG.LOG ---'; cat objs/autoconf.err 2>/dev/null || true; exit 1; } |
| 34 | + |
| 35 | +RUN make modules -j"$(nproc)" |
0 commit comments