Skip to content

Commit cc19d14

Browse files
authored
Merge pull request #9 from fooinha/docker/mount
nginx-ssl-ja3: docker with volume
2 parents 543f47c + 5b2b4d9 commit cc19d14

File tree

7 files changed

+21
-37
lines changed

7 files changed

+21
-37
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ script:
3636
- make -j$JOBS > build.log 2>&1 || (cat build.log && exit 1)
3737
- sudo make install > build.log 2>&1 || (cat build.log && exit 1)
3838
- cd ..
39-
- cp -v docker/debian-nginx-ssl-ja3/nginx.1.15.9.ssl.extensions.patch nginx/.
39+
- cp -v patches/latest.patch nginx/.
4040
- cd nginx
41-
- patch -p1 < nginx.1.15.9.ssl.extensions.patch
41+
- patch -p1 < latest.patch
4242
- auto/configure --with-debug --with-stream --with-ld-opt="-Wl,-E -L /usr/local/lib" --prefix=$NGINX_PREFIX --with-http_ssl_module --with-stream_ssl_module --add-module=.. > build.log 2>&1 || (cat build.log && exit 1)
4343
- make -j$JOBS > build.log 2>&1 || (cat build.log && exit 1)
4444
- sudo make install > build.log 2>&1 || (cat build.log && exit 1)

docker/debian-nginx-ssl-ja3/Dockerfile

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ LABEL maintainer "[email protected]"
44

55
# Build arguments
66
ARG 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
119
RUN echo "deb http://${DEBIAN_REPO_HOST}/debian sid main" > /etc/apt/sources.list
@@ -56,11 +54,7 @@ RUN mkdir -p /build
5654

5755
WORKDIR /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
6660
RUN 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
8276
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
8979

9080
# Install files
9181
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
9383

9484
# Install self-signed certificate
9585
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"
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

10390
RUN echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib' | tee -a /root/.bashrc
10491
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
10794
RUN echo 'export export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer' | tee -a /root/.bashrc
10895
RUN echo '' | tee -a /root/.bashrc
10996

97+
WORKDIR /build
98+
COPY docker/debian-nginx-ssl-ja3/compile.sh /build/compile.sh
11099
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
111100
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
112101

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
cd nginx
4+
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"
5+
make install
6+
cd -

docker/docker-compose.yml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
11
version: '3'
22

3-
43
services:
54

6-
# nginx:
7-
# build: ./alpine-nginx-ssl-ja3
8-
# hostname: nginx
9-
# container_name: nginx-ssl-ja3
10-
# ports:
11-
# - "80:80"
12-
# expose:
13-
# - 80
14-
# network_mode: bridge
15-
# tty: true
16-
# privileged: true
17-
# cap_add:
18-
# - ALL
19-
205
nginx-dev:
21-
build: ./debian-nginx-ssl-ja3
6+
build:
7+
context: ../
8+
dockerfile: docker/debian-nginx-ssl-ja3/Dockerfile
229
hostname: nginx-dev
2310
container_name: nginx-ssl-ja3
11+
volumes:
12+
- ../:/build/nginx-ssl-ja3
2413
ports:
2514
- "443:443"
2615
expose:

patches/latest.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../docker/debian-nginx-ssl-ja3/nginx.1.15.9.ssl.extensions.patch
1+
nginx.1.15.9.ssl.extensions.patch

0 commit comments

Comments
 (0)