Skip to content

Commit 1b21b52

Browse files
authored
Merge pull request #29 from macbre/remove-lua
Remove Lua support
2 parents 3d0815e + 5e41ca5 commit 1b21b52

File tree

6 files changed

+10
-44
lines changed

6 files changed

+10
-44
lines changed

.github/workflows/dockerimage.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,14 @@ jobs:
4242
-p 0.0.0.0:8888:80 \
4343
-v "$PWD/tests":/static:ro \
4444
-v "$PWD/tests/static.conf":/etc/nginx/conf.d/static.conf:ro \
45-
-v "$PWD/tests/env.conf":/etc/nginx/main.d/env.conf:ro \
46-
--env FOO=foo-test-value \
4745
--name test_nginx \
4846
-t ${{ github.repository }}
4947
5048
sleep 2; docker ps
5149
curl -v --compressed 0.0.0.0:8888 2>&1 | tee /tmp/out
5250
53-
# assert response headers presense
54-
grep 'X-Foo: foo-test-value' /tmp/out
51+
grep --fixed-strings '< Server: nginx' /tmp/out
52+
grep --fixed-strings '< Content-Encoding: br' /tmp/out
53+
grep --fixed-strings '<p>It works!</p>' /tmp/out
5554
5655
docker logs test_nginx

Dockerfile

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@ ARG NGINX_VERSION=1.19.10
33
# https://github.com/google/ngx_brotli
44
ARG NGX_BROTLI_COMMIT=9aec15e2aa6feea2113119ba06460af70ab3ea62
55

6-
# https://github.com/vision5/ngx_devel_kit/releases
7-
# https://hub.docker.com/r/firesh/nginx-lua/dockerfile
8-
ARG NGX_DEVEL_KIT_VERSION=0.3.1
9-
10-
# https://github.com/openresty/luajit2/releases
11-
ARG LUA_NGINX_MODULE_VERSION=0.10.14
12-
136
ARG CONFIG="\
147
--prefix=/etc/nginx \
158
--sbin-path=/usr/sbin/nginx \
@@ -55,9 +48,6 @@ ARG CONFIG="\
5548
--with-file-aio \
5649
--with-http_v2_module \
5750
--add-module=/usr/src/ngx_brotli \
58-
--with-ld-opt="-Wl,-rpath,/usr/lib" \
59-
--add-module=/tmp/ngx_devel_kit-${NGX_DEVEL_KIT_VERSION} \
60-
--add-module=/tmp/lua-nginx-module-${LUA_NGINX_MODULE_VERSION} \
6151
"
6252

6353
FROM alpine:3.13 AS base
@@ -66,8 +56,6 @@ LABEL maintainer="NGINX Docker Maintainers <docker-maint@nginx.com>"
6656
ARG NGINX_VERSION
6757
ARG NGX_BROTLI_COMMIT
6858
ARG CONFIG
69-
ARG NGX_DEVEL_KIT_VERSION
70-
ARG LUA_NGINX_MODULE_VERSION
7159

7260
RUN \
7361
apk add --no-cache --virtual .build-deps \
@@ -83,8 +71,6 @@ RUN \
8371
libxslt-dev \
8472
gd-dev \
8573
geoip-dev \
86-
luajit \
87-
luajit-dev \
8874
&& apk add --no-cache --virtual .brotli-build-deps \
8975
autoconf \
9076
libtool \
@@ -96,14 +82,8 @@ RUN \
9682
COPY nginx.pub /tmp/nginx.pub
9783

9884
RUN \
99-
echo "Fetcing lua-nginx-module $LUA_NGINX_MODULE_VERSION and nginx devel kit $NGX_DEVEL_KIT_VERSION ..." \
100-
&& curl -fSL https://github.com/simpl/ngx_devel_kit/archive/v${NGX_DEVEL_KIT_VERSION}.tar.gz -o /tmp/ndk.tar.gz \
101-
&& tar -xvf /tmp/ndk.tar.gz -C /tmp \
102-
&& curl -fSL https://github.com/openresty/lua-nginx-module/archive/v${LUA_NGINX_MODULE_VERSION}.tar.gz -o /tmp/lua-nginx.tar.gz \
103-
&& tar -xvf /tmp/lua-nginx.tar.gz -C /tmp
104-
105-
RUN \
106-
mkdir -p /usr/src/ngx_brotli \
85+
echo "Compiling nginx $NGINX_VERSION with brotli $NGX_BROTLI_COMMIT" \
86+
&& mkdir -p /usr/src/ngx_brotli \
10787
&& cd /usr/src/ngx_brotli \
10888
&& git init \
10989
&& git remote add origin https://github.com/google/ngx_brotli.git \
@@ -121,10 +101,7 @@ RUN \
121101
&& tar -zxC /usr/src -f nginx.tar.gz
122102

123103
RUN \
124-
export LUAJIT_LIB=/usr/lib \
125-
&& export LUAJIT_INC=/usr/include/moonjit-2.2 \
126-
&& echo "Compiling nginx $NGINX_VERSION with brotli $NGX_BROTLI_COMMIT and lua nginx module v$LUA_NGINX_MODULE_VERSION ..." \
127-
&& cd /usr/src/nginx-$NGINX_VERSION \
104+
cd /usr/src/nginx-$NGINX_VERSION \
128105
&& ./configure $CONFIG --with-debug \
129106
&& make -j$(getconf _NPROCESSORS_ONLN) \
130107
&& mv objs/nginx objs/nginx-debug \
@@ -169,8 +146,6 @@ RUN \
169146

170147
FROM alpine:3.13
171148
ARG NGINX_VERSION
172-
ARG NGX_BROTLI_COMMIT
173-
ARG LUA_NGINX_MODULE_VERSION
174149

175150
COPY --from=base /tmp/runDeps.txt /tmp/runDeps.txt
176151
COPY --from=base /etc/nginx /etc/nginx
@@ -195,10 +170,6 @@ RUN \
195170
COPY nginx.conf /etc/nginx/nginx.conf
196171
COPY ssl_common.conf /etc/nginx/conf.d/ssl_common.conf
197172

198-
ENV NGINX_VERSION $NGINX_VERSION
199-
ENV NGX_BROTLI_COMMIT $NGX_BROTLI_COMMIT
200-
ENV LUA_NGINX_MODULE_VERSION $LUA_NGINX_MODULE_VERSION
201-
202173
EXPOSE 80 443
203174

204175
STOPSIGNAL SIGTERM

nginx.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ http {
2626

2727
keepalive_timeout 65;
2828

29+
server_tokens off; # disables emitting nginx version in error messages and in the “Server” response header field
30+
2931
gzip on;
3032
brotli on;
3133
brotli_static on;

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## What is this?
22

3-
Stable and up-to-date [nginx](https://nginx.org/en/CHANGES) with [Google's `brotli` compression](https://github.com/google/ngx_brotli), [Lua module](https://github.com/openresty/lua-nginx-module), and [Grade A+ SSL config](https://ssl-config.mozilla.org/)
3+
Stable and up-to-date [nginx](https://nginx.org/en/CHANGES) with [Google's `brotli` compression](https://github.com/google/ngx_brotli) and [Grade A+ SSL config](https://ssl-config.mozilla.org/)
44

55

66
## How to use this image
@@ -18,7 +18,7 @@ nginx version: nginx/1.19.10
1818
built by gcc 10.2.1 20201203 (Alpine 10.2.1_pre1)
1919
built with OpenSSL 1.1.1k 25 Mar 2021
2020
TLS SNI support enabled
21-
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-threads --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-stream_realip_module --with-stream_geoip_module=dynamic --with-http_slice_module --with-mail --with-mail_ssl_module --with-compat --with-file-aio --with-http_v2_module --add-module=/usr/src/ngx_brotli --with-ld-opt=-Wl,-rpath,/usr/lib --add-module=/tmp/ngx_devel_kit-0.3.1 --add-module=/tmp/lua-nginx-module-0.10.14
21+
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-threads --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-stream_realip_module --with-stream_geoip_module=dynamic --with-http_slice_module --with-mail --with-mail_ssl_module --with-compat --with-file-aio --with-http_v2_module --add-module=/usr/src/ngx_brotli
2222
```
2323

2424
## SSL Grade A+ handling

tests/env.conf

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/static.conf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,5 @@ server {
99
brotli_static on;
1010

1111
expires 1d;
12-
13-
# test lua module, see env.conf too
14-
set_by_lua $foo_from_env 'return os.getenv("FOO")';
15-
16-
add_header X-Foo $foo_from_env;
1712
}
1813
}

0 commit comments

Comments
 (0)