Skip to content

Commit 4ac2a57

Browse files
authored
Merge pull request TeslaGov#4 from TeslaGov/joefitz/docker-build
Joefitz/docker build
2 parents 95b2e1e + a0e6ef9 commit 4ac2a57

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

Dockerfile

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
FROM centos:7
2+
3+
MAINTAINER Tesla Government email: [email protected]
4+
5+
RUN yum -y update
6+
7+
RUN yum -y groupinstall 'Development Tools'
8+
RUN yum -y install pcre-devel pcre
9+
RUN yum -y install zlib-devel openssl-devel
10+
RUN yum -y install wget
11+
RUN yum -y install cmake
12+
RUN yum -y install check-devel check
13+
# RUN yum -y install subunit-devel subunit libsubunit
14+
15+
RUN mkdir -p /root/dl
16+
17+
# get our JWT module
18+
WORKDIR /root/dl
19+
# change this to get a specific version?
20+
RUN wget https://github.com/TeslaGov/ngx-http-auth-jwt-module/archive/master.zip
21+
RUN unzip master.zip
22+
RUN rm master.zip
23+
RUN ln -sf ngx-http-auth-jwt-module-master ngx-http-auth-jwt-module
24+
25+
# build jansson
26+
WORKDIR /root/dl
27+
RUN wget https://github.com/akheron/jansson/archive/v2.10.zip
28+
RUN unzip v2.10.zip
29+
RUN rm v2.10.zip
30+
RUN ln -sf jansson-2.10 jansson
31+
WORKDIR /root/dl/jansson
32+
RUN cmake .
33+
RUN make
34+
RUN make check
35+
RUN make install
36+
37+
# build libjwt
38+
WORKDIR /root/dl
39+
RUN wget https://github.com/benmcollins/libjwt/archive/v1.8.0.zip
40+
RUN unzip v1.8.0.zip
41+
RUN rm v1.8.0.zip
42+
RUN ln -sf libjwt-1.8.0 libjwt
43+
WORKDIR /root/dl/libjwt
44+
RUN autoreconf -i
45+
RUN ./configure JANSSON_CFLAGS=/usr/local/include JANSSON_LIBS=/usr/local/lib
46+
RUN make all
47+
# this does not work because it can't find JANSSON
48+
# RUN make check
49+
RUN make install
50+
51+
WORKDIR /root/dl
52+
RUN wget http://nginx.org/download/nginx-1.12.0.tar.gz
53+
RUN tar -xzf nginx-1.12.0.tar.gz
54+
RUN rm nginx-1.12.0.tar.gz
55+
RUN ln -sf nginx-1.12.0 nginx
56+
WORKDIR /root/dl/nginx
57+
RUN ./configure --with-compat --add-dynamic-module=../ngx-http-auth-jwt-module --with-cc-opt='-std=gnu99'
58+
RUN make modules
59+
60+
61+
EXPOSE 80
62+
VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/etc/nginx/conf.d", "/var/log/nginx", "/var/www/html"]
63+
WORKDIR /etc/nginx
64+

config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ngx_addon_name=ngx_http_auth_jwt_module
2+
3+
ngx_module_type=HTTP
4+
ngx_module_name=ngx_http_auth_jwt_module
5+
ngx_module_srcs="$ngx_addon_dir/src/ngx_http_auth_jwt_module.c"
6+
7+
. auto/module

0 commit comments

Comments
 (0)