Skip to content

Commit 9ac6320

Browse files
committed
combine all supported libs into single Dockerfile
1 parent 42ef69f commit 9ac6320

File tree

2 files changed

+63
-6
lines changed

2 files changed

+63
-6
lines changed

Dockerfile

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
FROM ubuntu:20.04 AS builder-ssl
2+
ARG SSLLIB=QuicTLS
23

4+
# combined list of dependencies for QuicTLS, AWS-LC
35
ENV DEBIAN_FRONTEND noninteractive
4-
RUN apt-get -y update && apt-get -y install git make gcc
6+
RUN apt-get -y update && apt-get -y install git g++ make gcc wget autoconf libtool cmake curl
57

6-
RUN git clone --depth 1 -b OpenSSL_1_1_1s+quic https://github.com/quictls/openssl.git
7-
RUN cd /openssl && ./config && make -j$(nproc) && make install_sw
8+
# AWS-LC requirement
9+
COPY --from=golang:latest /usr/local/go/ /usr/local/go/
10+
ENV PATH="/usr/local/go/bin:${PATH}"
11+
12+
RUN if [ "$SSLLIB" = "QuicTLS" ]; \
13+
then git clone --depth 1 -b OpenSSL_1_1_1s+quic https://github.com/quictls/openssl.git && cd /openssl && ./config && make -j$(nproc) && make install_sw; \
14+
elif [ "$SSLLIB" = "AWS-LC" ]; \
15+
then git clone https://github.com/aws/aws-lc && cd aws-lc && cmake -DBUILD_SHARED_LIBS=1 -B build && make -C build && make -C build install; \
16+
elif [ "$SSLLIB" = "LibreSSL" ]; \
17+
then git clone https://github.com/libressl/portable.git libressl && cd /libressl && ./autogen.sh && autoreconf -fvi && ./configure && make && make install; \
18+
else echo "not supported SSLLIB"; exit 1; \
19+
fi
820

921
FROM ubuntu:20.04 AS builder
22+
ARG SSLLIB=QuicTLS
1023

1124
COPY --from=builder-ssl /usr/local/include/openssl/ /usr/local/include/openssl/
1225
COPY --from=builder-ssl \
@@ -23,13 +36,13 @@ RUN apt-get -y update && apt-get -y install git make gcc liblua5.3-0 liblua5.3-d
2336
CC=gcc \
2437
TARGET=linux-glibc \
2538
CPU=generic \
26-
USE_OPENSSL=1 \
39+
$(if [ "$SSLLIB" = "QuicTLS" ]; then echo USE_OPENSSL=1; elif [ "$SSLLIB" = "LibreSSL" ]; then echo USE_OPENSSL=1; elif [ "$SSLLIB" = "AWS-LC" ]; then echo USE_OPENSSL_AWSLC=1; else echo "not supported SSLLIB"; exit 1; fi) \
2740
USE_QUIC=1 \
2841
SSL_INC=/usr/local/include/ \
2942
SSL_LIB=/usr/local/lib/ \
3043
SMALL_OPTS="" \
3144
CPU_CFLAGS.generic="-O0" \
32-
DEBUG_CFLAGS="-g -Wno-deprecated-declarations" \
45+
ARCH_FLAGS="-g -Wno-deprecated-declarations" \
3346
ERR=1 \
3447
DEBUG="-DDEBUG_DONT_SHARE_POOLS -DDEBUG_MEMORY_POOLS -DDEBUG_STRICT=2 -DDEBUG_TASK -DDEBUG_FAIL_ALLOC" \
3548
LDFLAGS="-fuse-ld=gold" \
@@ -39,6 +52,7 @@ RUN apt-get -y update && apt-get -y install git make gcc liblua5.3-0 liblua5.3-d
3952
&& make install
4053

4154
FROM martenseemann/quic-network-simulator-endpoint:latest
55+
ARG SSLLIB=QuicTLS
4256

4357
# Required for lighttpd
4458
ENV TZ=Europe/Paris
@@ -48,9 +62,13 @@ RUN apt-get -y update && apt-get -y install lighttpd liblua5.3-0 && rm -rf /var/
4862
COPY --from=builder-ssl \
4963
/usr/local/lib/libssl.so* /usr/local/lib/libcrypto.so* /usr/local/lib/
5064
COPY --from=builder /usr/local/sbin/haproxy /usr/local/sbin/
51-
COPY quic.cfg lighttpd.cfg /
65+
COPY quic.cfg quic-libressl.cfg lighttpd.cfg /
5266
COPY sslkeylogger.lua /
5367

68+
RUN if [ "$SSLLIB" = "LibreSSL" ]; \
69+
then mv /quic-libressl.cfg /quic.cfg; \
70+
fi
71+
5472
COPY run_endpoint.sh .
5573
RUN chmod +x run_endpoint.sh
5674

quic-libressl.cfg

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
global
2+
cluster-secret what-a-secret!
3+
4+
#tune.ssl.keylog on
5+
lua-load sslkeylogger.lua
6+
7+
defaults
8+
mode http
9+
timeout connect 5s
10+
timeout client 60s
11+
timeout server 5s
12+
timeout tunnel 1h
13+
14+
frontend fe
15+
bind quic4@:443 proto quic ssl allow-0rtt crt /tmp/cert.pem alpn hq-interop,h3 "${HAP_EXTRA_ARGS}"
16+
bind quic6@:443 proto quic ssl allow-0rtt crt /tmp/cert.pem alpn hq-interop,h3 "${HAP_EXTRA_ARGS}"
17+
18+
http-request lua.sslkeylog /logs/keys.log
19+
20+
use_backend be
21+
22+
backend be
23+
server lighttpd 127.0.0.1:10080
24+
25+
traces
26+
trace quic sink stderr
27+
trace quic level developer
28+
trace quic verbosity clean
29+
trace quic start now
30+
31+
trace qmux sink stderr
32+
trace qmux level developer
33+
trace qmux verbosity minimal
34+
trace qmux start now
35+
36+
trace h3 sink stderr
37+
trace h3 level developer
38+
trace h3 verbosity minimal
39+
trace h3 start now

0 commit comments

Comments
 (0)