-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile
59 lines (52 loc) · 1.75 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
FROM docker.io/centos:7
MAINTAINER Kazuhisa Hara <kazuhisya@gmail.com>
ENV TZ="JST-9" \
MAINTAINER="Kazuhisa Hara <kazuhisya@gmail.com>" \
NGINX_VERSION="1.15.7" \
NGINX_RELEASE="1" \
LUA_VERSION="0.10.14rc3" \
LUA_RELEASE="1" \
NDK_VERSION="0.3.1rc1" \
NDK_RELEASE="1"
RUN yum install -y --setopt=tsflags=nodocs epel-release && \
yum install -y --setopt=tsflags=nodocs \
GeoIP-devel \
gcc \
gd-devel \
gettext \
libxslt-devel \
luajit \
luajit-devel \
make \
openssl-devel \
pcre-devel \
perl-ExtUtils-Embed \
perl-devel \
redhat-rpm-config \
rpm-build \
rpmdevtools \
which \
yum-utils \
zlib-devel \
copr-cli && \
yum clean all && \
rpmdev-setuptree
WORKDIR /root/rpmbuild
RUN curl -L http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz \
-o SOURCES/nginx-${NGINX_VERSION}.tar.gz && \
curl -L https://github.com/openresty/lua-nginx-module/archive/v${LUA_VERSION}.tar.gz \
-o SOURCES/lua-nginx-module-${LUA_VERSION}.tar.gz && \
curl -L https://github.com/simpl/ngx_devel_kit/archive/v${NDK_VERSION}.tar.gz \
-o SOURCES/ngx_devel_kit-${NDK_VERSION}.tar.gz
COPY / nginx-module-ndk-lua
RUN cat nginx-module-ndk-lua/nginx-module-ndk-lua.spec.template \
| TODAY=$(LANG=c date +"%a %b %e %Y") envsubst '$MAINTAINER, $NGINX_VERSION, $NGINX_RELEASE, $LUA_VERSION, $LUA_RELEASE, $NDK_VERSION, $NDK_RELEASE, $TODAY' \
> SPECS/nginx.spec && \
rpmbuild -ba SPECS/nginx.spec
RUN cp nginx-module-ndk-lua/nginx.repo /etc/yum.repos.d/ && \
yum install -y \
--nogpgcheck \
--disablerepo=epel \
./RPMS/x86_64/nginx-module-* && \
yum clean all && \
nginx -T -c /root/rpmbuild/nginx-module-ndk-lua/nginx-test.conf