File tree Expand file tree Collapse file tree 4 files changed +77
-15
lines changed Expand file tree Collapse file tree 4 files changed +77
-15
lines changed Original file line number Diff line number Diff line change 1
1
FROM centos:7
2
2
3
- MAINTAINER Tesla Government email
: [email protected]
3
+ LABEL maintainer= "TeslaGov" email
= " [email protected] "
4
4
5
5
ENV LD_LIBRARY_PATH=/usr/local/lib
6
6
7
- COPY ./resources/nginx.repo /etc/yum.repos.d/nginx.repo
8
-
9
7
RUN yum -y update && \
10
8
yum -y groupinstall 'Development Tools' && \
11
9
yum -y install pcre-devel pcre zlib-devel openssl-devel wget cmake check-devel check
@@ -26,7 +24,7 @@ RUN wget https://github.com/akheron/jansson/archive/v2.10.zip && \
26
24
rm v2.10.zip && \
27
25
ln -sf jansson-2.10 jansson && \
28
26
cd /root/dl/jansson && \
29
- cmake . -DJANSSON_BUILD_SHARED_LIBS=1 -DJANSSON_BUILD_DOCS=OFF &&
27
+ cmake . -DJANSSON_BUILD_SHARED_LIBS=1 -DJANSSON_BUILD_DOCS=OFF && \
30
28
make && \
31
29
make check && \
32
30
make install
@@ -50,14 +48,3 @@ RUN wget http://nginx.org/download/nginx-1.12.0.tar.gz && \
50
48
cd /root/dl/nginx && \
51
49
./configure --with-compat --add-dynamic-module=../ngx-http-auth-jwt-module --with-cc-opt='-std=gnu99' && \
52
50
make modules
53
-
54
- # setup a test for the new module
55
- RUN cp -r /usr/share/nginx/html /usr/share/nginx/secure
56
- COPY ./resources/test-jwt-nginx.conf /etc/nginx/conf.d/test-jwt-nginx.conf
57
- # download and run nginx binary
58
- RUN yum -y install nginx-1.12.0 && \
59
- cp /root/dl/nginx/objs/ngx_http_auth_jwt_module.so /etc/nginx/modules/. && \
60
- nginx
61
-
62
- EXPOSE 8000
63
-
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # build
4
+ DOCKER_IMAGE_NAME=jwt-nginx
5
+ docker build -t ${DOCKER_IMAGE_NAME} .
6
+ CONTAINER_ID=$( docker run -itd ${DOCKER_IMAGE_NAME} sh)
7
+
8
+ # setup test
9
+ rm -rf ./lib
10
+ rm -rf ./modules
11
+ mkdir modules
12
+ DOCKER_TEST_IMAGE_NAME=jwt-nginx-test
13
+ docker build -t ${DOCKER_TEST_IMAGE_NAME} test/.
14
+ CONTAINER_TEST_ID=$( docker run -p 8000:8000 -itd ${DOCKER_TEST_IMAGE_NAME} sh)
15
+ docker cp ${CONTAINER_ID} :/usr/local/lib .
16
+ docker cp lib ${CONTAINER_TEST_ID} :/usr/local
17
+ docker cp ${CONTAINER_ID} :/root/dl/nginx/objs/ngx_http_auth_jwt_module.so modules/.
18
+ docker cp modules/ngx_http_auth_jwt_module.so ${CONTAINER_TEST_ID} :/usr/lib64/nginx/modules/.
19
+ docker cp resources/test-jwt-nginx.conf ${CONTAINER_TEST_ID} :/etc/nginx/conf.d/test-jwt-nginx.conf
20
+ docker cp resources/nginx.conf ${CONTAINER_TEST_ID} :/etc/nginx/.
21
+
22
+ docker exec -d ${CONTAINER_TEST_ID} /bin/bash -c " export LD_LIBRARY_PATH=/usr/local/lib && nginx"
23
+
24
+
25
+
26
+
Original file line number Diff line number Diff line change
1
+
2
+ user nginx;
3
+ worker_processes 1 ;
4
+
5
+ error_log /var/log/nginx/error.log warn ;
6
+ pid /var/run/nginx.pid;
7
+
8
+ load_module modules/ngx_http_auth_jwt_module.so;
9
+
10
+ events {
11
+ worker_connections 1024 ;
12
+ }
13
+
14
+
15
+ http {
16
+ include /etc/nginx/mime.types;
17
+ default_type application/octet-stream;
18
+
19
+ log_format main '$remote_addr - $remote_user [$time_local ] "$request " '
20
+ '$status $body_bytes_sent "$http_referer " '
21
+ '"$http_user_agent " "$http_x_forwarded_for "' ;
22
+
23
+ access_log /var/log/nginx/access.log main ;
24
+
25
+ sendfile on ;
26
+ #tcp_nopush on;
27
+
28
+ keepalive_timeout 65 ;
29
+
30
+ #gzip on;
31
+
32
+ include /etc/nginx/conf.d/*.conf;
33
+ }
34
+
Original file line number Diff line number Diff line change
1
+ FROM centos:7
2
+
3
+ LABEL maintainer=
"TeslaGov" email=
"[email protected] "
4
+
5
+ ENV LD_LIBRARY_PATH=/usr/local/lib
6
+
7
+ COPY nginx.repo /etc/yum.repos.d/nginx.repo
8
+
9
+ # setup a test for the new module
10
+ # download and run nginx binary
11
+ RUN yum -y update && \
12
+ yum -y install nginx-1.12.0 && \
13
+ cp -r /usr/share/nginx/html /usr/share/nginx/secure
14
+
15
+ EXPOSE 8000
You can’t perform that action at this time.
0 commit comments