1FROM debian:11 as build 2 3RUN apt-get update && \ 4 apt-get install -y --no-install-recommends \ 5 git clang make binutils autoconf automake autotools-dev libtool \ 6 pkg-config \ 7 zlib1g-dev libev-dev libjemalloc-dev ruby-dev libc-ares-dev bison \ 8 libelf-dev 9 10RUN git clone --depth 1 -b OpenSSL_1_1_1u+quic https://github.com/quictls/openssl && \ 11 cd openssl && \ 12 ./config --openssldir=/etc/ssl && \ 13 make -j$(nproc) && \ 14 make install_sw && \ 15 cd .. && \ 16 rm -rf openssl 17 18RUN git clone --depth 1 -b v0.13.0 https://github.com/ngtcp2/nghttp3 && \ 19 cd nghttp3 && \ 20 autoreconf -i && \ 21 ./configure --enable-lib-only && \ 22 make -j$(nproc) && \ 23 make install-strip && \ 24 cd .. && \ 25 rm -rf nghttp3 26 27RUN git clone --depth 1 -b v0.17.0 https://github.com/ngtcp2/ngtcp2 && \ 28 cd ngtcp2 && \ 29 autoreconf -i && \ 30 ./configure --enable-lib-only \ 31 LIBTOOL_LDFLAGS="-static-libtool-libs" \ 32 OPENSSL_LIBS="-l:libssl.a -l:libcrypto.a -ldl -lpthread" \ 33 PKG_CONFIG_PATH="/usr/local/lib64/pkgconfig" && \ 34 make -j$(nproc) && \ 35 make install-strip && \ 36 cd .. && \ 37 rm -rf ngtcp2 38 39RUN git clone --depth 1 -b v1.2.0 https://github.com/libbpf/libbpf && \ 40 cd libbpf && \ 41 PREFIX=/usr/local make -C src install && \ 42 cd .. && \ 43 rm -rf libbpf 44 45RUN git clone --depth 1 https://github.com/nghttp2/nghttp2.git && \ 46 cd nghttp2 && \ 47 git submodule update --init && \ 48 autoreconf -i && \ 49 ./configure --disable-examples --disable-hpack-tools \ 50 --with-mruby --with-neverbleed \ 51 --enable-http3 --with-libbpf \ 52 CC=clang CXX=clang++ \ 53 LIBTOOL_LDFLAGS="-static-libtool-libs" \ 54 OPENSSL_LIBS="-l:libssl.a -l:libcrypto.a -ldl -pthread" \ 55 LIBEV_LIBS="-l:libev.a" \ 56 JEMALLOC_LIBS="-l:libjemalloc.a" \ 57 LIBCARES_LIBS="-l:libcares.a" \ 58 ZLIB_LIBS="-l:libz.a" \ 59 LIBBPF_LIBS="-L/usr/local/lib64 -l:libbpf.a -l:libelf.a" \ 60 LDFLAGS="-static-libgcc -static-libstdc++" \ 61 PKG_CONFIG_PATH="/usr/local/lib64/pkgconfig" && \ 62 make -j$(nproc) install-strip && \ 63 cd .. && \ 64 rm -rf nghttp2 65 66FROM gcr.io/distroless/base-debian11 67 68COPY --from=build \ 69 /usr/local/share/nghttp2/ \ 70 /usr/local/share/nghttp2/ 71COPY --from=build \ 72 /usr/local/bin/h2load \ 73 /usr/local/bin/nghttpx \ 74 /usr/local/bin/nghttp \ 75 /usr/local/bin/nghttpd \ 76 /usr/local/bin/ 77COPY --from=build /usr/local/lib/nghttp2/reuseport_kern.o \ 78 /usr/local/lib/nghttp2/ 79