summaryrefslogtreecommitdiffstats
path: root/docker/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'docker/Dockerfile')
-rw-r--r--docker/Dockerfile39
1 files changed, 39 insertions, 0 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile
new file mode 100644
index 0000000..d6141d9
--- /dev/null
+++ b/docker/Dockerfile
@@ -0,0 +1,39 @@
+FROM debian:11 as build
+
+RUN apt-get update && \
+ apt-get install -y --no-install-recommends \
+ git g++ clang-11 make binutils autoconf automake autotools-dev libtool \
+ pkg-config libev-dev libjemalloc-dev \
+ ca-certificates mime-support && \
+ git clone --depth 1 -b OpenSSL_1_1_1s+quic https://github.com/quictls/openssl && \
+ cd openssl && ./config --openssldir=/etc/ssl && make -j$(nproc) && make install_sw && cd .. && rm -rf openssl && \
+ git clone --depth 1 https://github.com/ngtcp2/nghttp3 && \
+ cd nghttp3 && autoreconf -i && \
+ ./configure --enable-lib-only CC=clang-11 CXX=clang++-11 && \
+ make -j$(nproc) && make install-strip && cd .. && rm -rf nghttp3 && \
+ git clone --depth 1 https://github.com/ngtcp2/ngtcp2 && \
+ cd ngtcp2 && autoreconf -i && \
+ ./configure \
+ CC=clang-11 \
+ CXX=clang++-11 \
+ LIBTOOL_LDFLAGS="-static-libtool-libs" \
+ OPENSSL_LIBS="-l:libssl.a -l:libcrypto.a -ldl -pthread" \
+ LIBEV_LIBS="-l:libev.a" \
+ JEMALLOC_LIBS="-l:libjemalloc.a -lm" && \
+ make -j$(nproc) && \
+ strip examples/client examples/server && \
+ cp examples/client examples/server /usr/local/bin && \
+ cd .. && rm -rf ngtcp2 && \
+ apt-get -y purge \
+ git g++ clang-11 make binutils autoconf automake autotools-dev libtool \
+ pkg-config libev-dev libjemalloc-dev \
+ ca-certificates && \
+ apt-get -y autoremove --purge && \
+ rm -rf /var/log/*
+
+FROM gcr.io/distroless/cc-debian11:latest-amd64
+
+COPY --from=build /usr/local/bin/client /usr/local/bin/server /usr/local/bin/
+COPY --from=build /etc/mime.types /etc/
+
+CMD ["/usr/local/bin/client"]