4
4
5
5
# Build arguments
6
6
ARG DEBIAN_REPO_HOST=httpredir.debian.org
7
- ARG GIT_LOCATION=https://github.com/fooinha/nginx-ssl-ja3.git
8
- ARG GIT_BRANCH=master
9
7
10
8
# Mirror to my location
11
9
RUN echo "deb http://${DEBIAN_REPO_HOST}/debian sid main" > /etc/apt/sources.list
@@ -56,11 +54,7 @@ RUN mkdir -p /build
56
54
57
55
WORKDIR /build
58
56
59
- # Fetches and clones from git location
60
- RUN git clone ${GIT_LOCATION}
61
- RUN cd nginx-ssl-ja3 && git checkout ${GIT_BRANCH}
62
-
63
- WORKDIR /build
57
+ VOLUME ["/build/nginx-ssl-ja3" ]
64
58
65
59
# Get test framework
66
60
RUN git clone https://github.com/nginx/nginx-tests
@@ -80,25 +74,18 @@ RUN hg clone http://hg.nginx.org/nginx
80
74
81
75
# Patch nginx for fetching ssl client extensions
82
76
WORKDIR /build/nginx
83
- COPY nginx.1.15.9.ssl.extensions.patch /build/nginx
84
- RUN patch -p1 < nginx.1.15.9.ssl.extensions.patch
85
-
86
- # Configure, make and install
87
- RUN ./auto/configure --add-module=/build/nginx-ssl-ja3 --with-http_ssl_module --with-stream_ssl_module --with-stream --with-debug --with-ld-opt="-L/usr/local/lib -Wl,-E"
88
- RUN make install
77
+ COPY patches/latest.patch /build/nginx
78
+ RUN patch -p1 < latest.patch
89
79
90
80
# Install files
91
81
RUN mkdir -p /usr/local/nginx/conf/
92
- COPY nginx.conf /usr/local/nginx/conf/nginx.conf
82
+ COPY docker/debian-nginx-ssl-ja3/ nginx.conf /usr/local/nginx/conf/nginx.conf
93
83
94
84
# Install self-signed certificate
95
85
RUN LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib /usr/local/bin/openssl req -new -x509 -days 365 -nodes -out /usr/local/nginx/conf/cert.pem -keyout /usr/local/nginx/conf/rsa.key -subj "/C=PT/ST=Lisbon/L=Lisbon/O=Development/CN=foo.local"
96
86
97
- # exuberant ctags
98
- RUN cd /build/nginx-ssl-ja3 && ctags -R src/ ../nginx/src/
99
-
100
87
# vim config
101
- COPY vimrc /etc/vim/vimrc
88
+ COPY docker/debian-nginx-ssl-ja3/ vimrc /etc/vim/vimrc
102
89
103
90
RUN echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib' | tee -a /root/.bashrc
104
91
RUN echo 'export PATH=$PATH:/usr/local/bin:/usr/local/nginx/sbin' | tee -a /root/.bashrc
@@ -107,6 +94,8 @@ RUN echo 'export ASAN_OPTIONS=symbolize=1' | tee -a /root/.bashrc
107
94
RUN echo 'export export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer' | tee -a /root/.bashrc
108
95
RUN echo '' | tee -a /root/.bashrc
109
96
97
+ WORKDIR /build
98
+ COPY docker/debian-nginx-ssl-ja3/compile.sh /build/compile.sh
110
99
RUN echo 'TO COMPILE RUN:\n cd nginx\n ASAN_OPTIONS=symbolize=1 ./auto/configure --add-module=/build/nginx-ssl-ja3 --with-http_ssl_module --with-stream_ssl_module --with-debug --with-stream --with-cc-opt="-fsanitize=address -O -fno-omit-frame-pointer" --with-ld-opt="-L/usr/local/lib -Wl,-E -lasan"\n make install' | tee -a /build/COMPILE.ASAN.README
111
100
RUN echo 'TO TEST RUN:\n nginx &\n openssl s_client -connect 127.0.0.1:12345 -cipher "AES128-SHA" -curves secp521r1' | tee -a /build/TEST.README
112
101
0 commit comments