@@ -7,6 +7,8 @@ ARG DOCKER_IMAGE_TAG=3.11.6
7
7
# ###################################
8
8
FROM $DOCKER_IMAGE_OS:$DOCKER_IMAGE_TAG AS builder
9
9
10
+ ARG EXTENDED_IMAGE=1
11
+
10
12
# ngx_devel_kit
11
13
# https://github.com/vision5/ngx_devel_kit
12
14
# The NDK is now considered to be stable.
@@ -19,11 +21,23 @@ ARG LUAJIT_LIB=/usr/local/lib
19
21
ARG LUAJIT_INC=/usr/local/include/luajit-2.1
20
22
ARG LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH
21
23
24
+ # headers-more-nginx-module
25
+ # https://github.com/openresty/headers-more-nginx-module
26
+ ARG VER_OPENRESTY_HEADERS=743a4bb1a253325d17a4f4ce8ee61ea0d8e0cc19
27
+
22
28
# lua-nginx-module
23
29
# https://github.com/openresty/lua-nginx-module
24
30
# Production ready.
25
31
ARG VER_LUA_NGINX_MODULE=0.10.15
26
32
33
+ # lua-resty-cookie
34
+ # https://github.com/cloudflare/lua-resty-cookie
35
+ ARG VER_CLOUDFLARE_COOKIE=c54865bdcfc3c42cbd6dbbceb654ba73871d07f6
36
+
37
+ # lua-resty-dns
38
+ # https://github.com/openresty/lua-resty-dns
39
+ ARG VER_OPENRESTY_DNS=0.21
40
+
27
41
# lua-resty-core
28
42
# https://github.com/openresty/lua-resty-core
29
43
# This library is production ready.
@@ -35,7 +49,33 @@ ARG LUA_LIB_DIR=/usr/local/share/lua/5.1
35
49
# This library is considered production ready.
36
50
ARG VER_LUA_RESTY_LRUCACHE=0.09
37
51
38
- FROM $DOCKER_IMAGE_OS:$DOCKER_IMAGE_TAG AS builder
52
+ # lua-resty-memcached
53
+ # https://github.com/openresty/lua-resty-memcached
54
+ ARG VER_OPENRESTY_MEMCACHED=0.15
55
+
56
+ # lua-resty-mysql
57
+ # https://github.com/openresty/lua-resty-mysql
58
+ ARG VER_OPENRESTY_MYSQL=0.22
59
+
60
+ # lua-resty-redis
61
+ # https://github.com/openresty/lua-resty-redis
62
+ ARG VER_OPENRESTY_REDIS=0.27
63
+
64
+ # lua-resty-shell
65
+ # https://github.com/openresty/lua-resty-shell
66
+ ARG VER_OPENRESTY_SHELL=0.02
67
+
68
+ # lua-resty-websocket
69
+ # https://github.com/openresty/lua-resty-websocket
70
+ ARG VER_OPENRESTY_WEBSOCKET=0.07
71
+
72
+ # nginx-lua-prometheus
73
+ # https://github.com/knyar/nginx-lua-prometheus
74
+ ARG VER_PROMETHEUS=0.20200523
75
+
76
+ # stream-lua-nginx-module
77
+ # https://github.com/openresty/stream-lua-nginx-module
78
+ ARG VER_OPENRESTY_STREAMLUA=0.0.8rc3
39
79
40
80
# https://github.com/nginx/nginx
41
81
ARG VER_NGINX=1.19.0
@@ -154,7 +194,78 @@ RUN set -eux \
154
194
# Lua Nginx Module
155
195
# ##############################################################################
156
196
&& curl -Lo /lua-nginx.tar.gz https://github.com/openresty/lua-nginx-module/archive/v${VER_LUA_NGINX_MODULE}.tar.gz \
157
- && tar -C / -xvzf /lua-nginx.tar.gz
197
+ && tar -C / -xvzf /lua-nginx.tar.gz \
198
+ # OpenResty Redis
199
+ # ##############################################################################
200
+ && [ $EXTENDED_IMAGE -eq 1 ] && ( \
201
+ curl -Lo /lua-openresty-redis.tar.gz https://github.com/openresty/lua-resty-redis/archive/v${VER_OPENRESTY_REDIS}.tar.gz \
202
+ && tar -C / -xvzf /lua-openresty-redis.tar.gz \
203
+ && cd /lua-resty-redis-${VER_OPENRESTY_REDIS} \
204
+ && make -j "$(nproc)" \
205
+ && make install) \
206
+ # OpenResty Mysql
207
+ # ##############################################################################
208
+ && [ $EXTENDED_IMAGE -eq 1 ] && ( \
209
+ curl -Lo /lua-openresty-mysql.tar.gz https://github.com/openresty/lua-resty-mysql/archive/v${VER_OPENRESTY_MYSQL}.tar.gz \
210
+ && tar -C / -xvzf /lua-openresty-mysql.tar.gz \
211
+ && cd /lua-resty-mysql-${VER_OPENRESTY_MYSQL} \
212
+ && make -j "$(nproc)" \
213
+ && make install) \
214
+ # OpenResty Websocket
215
+ # ##############################################################################
216
+ && [ $EXTENDED_IMAGE -eq 1 ] && ( \
217
+ curl -Lo /lua-openresty-websocket.tar.gz https://github.com/openresty/lua-resty-websocket/archive/v${VER_OPENRESTY_WEBSOCKET}.tar.gz \
218
+ && tar -C / -xvzf /lua-openresty-websocket.tar.gz \
219
+ && cd /lua-resty-websocket-${VER_OPENRESTY_WEBSOCKET} \
220
+ && make -j "$(nproc)" \
221
+ && make install) \
222
+ # OpenResty Dns
223
+ # ##############################################################################
224
+ && [ $EXTENDED_IMAGE -eq 1 ] && ( \
225
+ curl -Lo /lua-openresty-dns.tar.gz https://github.com/openresty/lua-resty-dns/archive/v${VER_OPENRESTY_DNS}.tar.gz \
226
+ && tar -C / -xvzf /lua-openresty-dns.tar.gz \
227
+ && cd /lua-resty-dns-${VER_OPENRESTY_DNS} \
228
+ && make -j "$(nproc)" \
229
+ && make install) \
230
+ # OpenResty Memcached
231
+ # ##############################################################################
232
+ && [ $EXTENDED_IMAGE -eq 1 ] && ( \
233
+ curl -Lo /lua-openresty-memcached.tar.gz https://github.com/openresty/lua-resty-memcached/archive/v${VER_OPENRESTY_MEMCACHED}.tar.gz \
234
+ && tar -C / -xvzf /lua-openresty-memcached.tar.gz \
235
+ && cd /lua-resty-memcached-${VER_OPENRESTY_MEMCACHED} \
236
+ && make -j "$(nproc)" \
237
+ && make install) \
238
+ # OpenResty Shell
239
+ # ##############################################################################
240
+ && [ $EXTENDED_IMAGE -eq 1 ] && ( \
241
+ curl -Lo /lua-openresty-shell.tar.gz https://github.com/openresty/lua-resty-shell/archive/v${VER_OPENRESTY_SHELL}.tar.gz \
242
+ && tar -C / -xvzf /lua-openresty-shell.tar.gz \
243
+ && cd /lua-resty-shell-${VER_OPENRESTY_SHELL} \
244
+ && make -j "$(nproc)" \
245
+ && make install) \
246
+ # OpenResty Headers
247
+ # ##############################################################################
248
+ && [ $EXTENDED_IMAGE -eq 1 ] && ( \
249
+ curl -Lo /headers-more-nginx-module.zip https://github.com/openresty/headers-more-nginx-module/archive/${VER_OPENRESTY_HEADERS}.zip \
250
+ && unzip -d / /headers-more-nginx-module.zip) \
251
+ # OpenResty Stream Lua
252
+ # ##############################################################################
253
+ && [ $EXTENDED_IMAGE -eq 1 ] && ( \
254
+ curl -Lo /stream-lua-nginx-module.zip https://github.com/openresty/stream-lua-nginx-module/archive/v${VER_OPENRESTY_STREAMLUA}.zip \
255
+ && unzip -d / /stream-lua-nginx-module.zip) \
256
+ # Cloudflare Cookie
257
+ # ##############################################################################
258
+ && [ $EXTENDED_IMAGE -eq 1 ] && ( \
259
+ curl -Lo /lua-resty-cookie.tar.gz https://github.com/cloudflare/lua-resty-cookie/archive/${VER_CLOUDFLARE_COOKIE}.tar.gz \
260
+ && tar -C / -xvzf /lua-resty-cookie.tar.gz \
261
+ && cd /lua-resty-cookie-${VER_CLOUDFLARE_COOKIE} \
262
+ && make -j "$(nproc)" ) \
263
+ # Prometheus
264
+ # ##############################################################################
265
+ && [ $EXTENDED_IMAGE -eq 1 ] && ( \
266
+ curl -Lo /nginx-lua-prometheus.tar.gz https://github.com/knyar/nginx-lua-prometheus/archive/${VER_PROMETHEUS}.tar.gz \
267
+ && tar -C / -xvzf /nginx-lua-prometheus.tar.gz \
268
+ && mv /nginx-lua-prometheus-${VER_PROMETHEUS}/*.lua ${LUA_LIB_DIR}/)
158
269
159
270
RUN set -eux \
160
271
# NGINX
@@ -169,10 +280,17 @@ RUN set -eux \
169
280
/var/cache/nginx/fastcgi_temp \
170
281
/var/cache/nginx/uwsgi_temp \
171
282
/var/cache/nginx/scgi_temp \
172
- && ./configure \
283
+ && [ $EXTENDED_IMAGE -eq 1 ] && ( \
284
+ ./configure \
285
+ ${NGINX_BUILD_CONFIG} \
286
+ --add-module=/headers-more-nginx-module-${VER_OPENRESTY_HEADERS} \
287
+ --add-module=/stream-lua-nginx-module-${VER_OPENRESTY_STREAMLUA} \
288
+ --with-cc-opt='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' \
289
+ --with-ld-opt='-Wl,-rpath,/usr/local/lib -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie' ) \
290
+ || (./configure \
173
291
${NGINX_BUILD_CONFIG} \
174
292
--with-cc-opt='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' \
175
- --with-ld-opt='-Wl,-rpath,/usr/local/lib -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie' \
293
+ --with-ld-opt='-Wl,-rpath,/usr/local/lib -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie' ) \
176
294
&& make -j "$(nproc)" build \
177
295
&& make install
178
296
@@ -184,6 +302,7 @@ FROM $DOCKER_IMAGE_OS:$DOCKER_IMAGE_TAG
184
302
ARG DOCKER_IMAGE=fabiocicerchia/nginx-lua
185
303
ARG DOCKER_IMAGE_OS=alpine
186
304
ARG DOCKER_IMAGE_TAG=3.11.6
305
+ ARG EXTENDED_IMAGE=1
187
306
ARG VER_NGINX=1.19.0
188
307
ARG BUILD_DATE
189
308
ARG VCS_REF
198
317
org.label-schema.url="https://github.com/$DOCKER_IMAGE" \
199
318
org.label-schema.vcs-ref=$VCS_REF \
200
319
org.label-schema.vcs-url="https://github.com/$DOCKER_IMAGE" \
201
- org.label-schema.version="$VER_NGINX-$DOCKER_IMAGE_OS$DOCKER_IMAGE_TAG"
320
+ org.label-schema.version="$VER_NGINX-$DOCKER_IMAGE_OS$DOCKER_IMAGE_TAG" \
321
+ version.extended="$EXTENDED_IMAGE"
202
322
203
323
# dumb-init
204
324
# https://github.com/Yelp/dumb-init
0 commit comments