Skip to content

Commit 646622a

Browse files
committed
init
1 parent de8822d commit 646622a

File tree

3 files changed

+45
-10
lines changed

3 files changed

+45
-10
lines changed

README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1-
# About this Repo
1+
# Nginx with Lua module support
22

3-
This is the Git repo of the official Docker image for [nginx](https://registry.hub.docker.com/_/nginx/). See the
4-
Hub page for the full readme on how to use the Docker image and for information
5-
regarding contributing and issues.
3+
This repo is Dockerfile for [firesh/nginx-lua](https://hub.docker.com/r/firesh/nginx-lua/) images in docker hub.
4+
It is base offical [Nignx Dockerfile](https://github.com/nginxinc/docker-nginx/blob/master/stable/alpine/Dockerfile).
5+
To minimize the docker image, we build from Apline Linux.
66

7-
The full readme is generated over in [docker-library/docs](https://github.com/docker-library/docs),
8-
specificially in [docker-library/docs/nginx](https://github.com/docker-library/docs/tree/master/nginx).
7+
Only 2 modules is add:
8+
- [simpl/ngx_devel_kit](https://github.com/simpl/ngx_devel_kit)
9+
- [openresty/lua-nginx-module](https://github.com/openresty/lua-nginx-module)
910

11+
## Tags
12+
- [latest]()
13+
- [alpine]()
14+
15+
## Usage
16+
```
17+
docker run -d -p 80:80 -p 443:443 firesh/ngingx-lua
18+
```

stable/alpine/Dockerfile

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
FROM alpine:3.4
22

3-
MAINTAINER NGINX Docker Maintainers "[email protected]"
3+
MAINTAINER Wang Shaobo <[email protected]>
4+
5+
ENV LANG en_US.UTF-8
6+
#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
47

58
ENV NGINX_VERSION 1.10.2
9+
ENV NGX_DEVEL_KIT_VERSION 0.3.0
10+
ENV LUA_NGINX_MODULE_VERSION 0.10.7
11+
12+
# Install LUAJIT
13+
RUN apk add --no-cache luajit
614

715
RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
816
&& CONFIG="\
@@ -47,6 +55,9 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
4755
--with-file-aio \
4856
--with-http_v2_module \
4957
--with-ipv6 \
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} \
5061
" \
5162
&& addgroup -S nginx \
5263
&& adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx \
@@ -64,6 +75,13 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
6475
gd-dev \
6576
geoip-dev \
6677
perl-dev \
78+
luajit-dev \
79+
&& export LUAJIT_LIB=/usr/lib \
80+
&& export LUAJIT_INC=/usr/include/luajit-2.0 \
81+
&& curl -fSL https://github.com/simpl/ngx_devel_kit/archive/v0.3.0.tar.gz -o /tmp/ndk.tar.gz \
82+
&& tar -xvf /tmp/ndk.tar.gz -C /tmp \
83+
&& curl -fSL https://github.com/openresty/lua-nginx-module/archive/v${LUA_NGINX_MODULE_VERSION}.tar.gz -o /tmp/lua-nginx.tar.gz \
84+
&& tar -xvf /tmp/lua-nginx.tar.gz -C /tmp \
6785
&& curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz \
6886
&& curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz.asc -o nginx.tar.gz.asc \
6987
&& export GNUPGHOME="$(mktemp -d)" \
@@ -98,6 +116,10 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
98116
&& strip /usr/sbin/nginx* \
99117
&& strip /usr/lib/nginx/modules/*.so \
100118
&& rm -rf /usr/src/nginx-$NGINX_VERSION \
119+
&& rm -f /tmp/ndk.tar.gz \
120+
&& rm -f /tmp/lua-nginx.tar.gz \
121+
&& rm -f /tmp/ngx_devel_kit-${NGX_DEVEL_KIT_VERSION} \
122+
&& rm -f /tmp/lua-nginx-module-${LUA_NGINX_MODULE_VERSION} \
101123
\
102124
# Bring in gettext so we can get `envsubst`, then throw
103125
# the rest away. To do this, we need to install `gettext`

stable/alpine/nginx.vh.default.conf

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ server {
66
#access_log /var/log/nginx/log/host.access.log main;
77

88
location / {
9-
root /usr/share/nginx/html;
10-
index index.html index.htm;
9+
#root /usr/share/nginx/html;
10+
#index index.html index.htm;
11+
12+
default_type text/html;
13+
content_by_lua '
14+
ngx.say("<p>hello world! -- saying by lua</p>")
15+
';
1116
}
1217

1318
#error_page 404 /404.html;
@@ -42,4 +47,3 @@ server {
4247
# deny all;
4348
#}
4449
}
45-

0 commit comments

Comments
 (0)