blob: d6141d9a30c8a36aff3ec4634506b02d2a72b631 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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"]
|