@@ -4,8 +4,6 @@ LABEL maintainer "fooinha@gmail.com"
44
55# Build arguments
66ARG DEBIAN_REPO_HOST=httpredir.debian.org
7- ARG GIT_LOCATION=https://github.com/fooinha/nginx-ssl-ja3.git
8- ARG GIT_BRANCH=master
97
108# Mirror to my location
119RUN echo "deb http://${DEBIAN_REPO_HOST}/debian sid main" > /etc/apt/sources.list
@@ -56,11 +54,7 @@ RUN mkdir -p /build
5654
5755WORKDIR /build
5856
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" ]
6458
6559# Get test framework
6660RUN git clone https://github.com/nginx/nginx-tests
@@ -80,25 +74,18 @@ RUN hg clone http://hg.nginx.org/nginx
8074
8175# Patch nginx for fetching ssl client extensions
8276WORKDIR /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
8979
9080# Install files
9181RUN 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
9383
9484# Install self-signed certificate
9585RUN 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"
9686
97- # exuberant ctags
98- RUN cd /build/nginx-ssl-ja3 && ctags -R src/ ../nginx/src/
99-
10087# vim config
101- COPY vimrc /etc/vim/vimrc
88+ COPY docker/debian-nginx-ssl-ja3/ vimrc /etc/vim/vimrc
10289
10390RUN echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib' | tee -a /root/.bashrc
10491RUN 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
10794RUN echo 'export export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer' | tee -a /root/.bashrc
10895RUN echo '' | tee -a /root/.bashrc
10996
97+ WORKDIR /build
98+ COPY docker/debian-nginx-ssl-ja3/compile.sh /build/compile.sh
11099RUN 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
111100RUN 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
112101
0 commit comments