diff --git a/docker/Dockerfile b/docker/Dockerfile index 2c6588660455977fb4956918856691fd03562208..e1f0360ed7ed997482beca4d9fe9336f872d4472 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,9 +1,10 @@ -FROM k8s.gcr.io/debian-base-amd64:v2.0.0 +FROM debian:10 as build -RUN /usr/local/bin/clean-install \ +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ git g++ make binutils autoconf automake autotools-dev libtool \ - pkg-config libev-dev libjemalloc-dev \ - libev4 libjemalloc1 ca-certificates mime-support && \ + pkg-config libev-dev libjemalloc-dev \ + ca-certificates mime-support && \ git clone --depth 1 -b OpenSSL_1_1_1g-quic-draft-29 https://github.com/tatsuhiro-t/openssl && \ cd openssl && ./config enable-tls1_3 --openssldir=/etc/ssl && make -j$(nproc) && make install_sw && cd .. && rm -rf openssl && \ git clone --depth 1 https://github.com/ngtcp2/nghttp3 && \ @@ -12,11 +13,25 @@ RUN /usr/local/bin/clean-install \ make -j$(nproc) && make install-strip && cd .. && rm -rf nghttp3 && \ git clone --depth 1 https://github.com/ngtcp2/ngtcp2 && \ cd ngtcp2 && autoreconf -i && \ - ./configure && \ - make -j$(nproc) && make install-strip && cp examples/server examples/client /usr/local/bin && cd .. && rm -rf ngtcp2 && \ - strip /usr/local/lib/*.so.*.* /usr/local/lib/engines-*/*.so && \ - rm -rf /usr/local/lib/libssl.so /usr/local/lib/libcrypto.so /usr/local/lib/libssl.a /usr/local/lib/libcrypto.a /usr/local/lib/pkgconfig/*ssl.pc /usr/local/include/openssl/* && \ - apt-get -y purge git g++ make binutils autoconf automake autotools-dev libtool pkg-config \ - libev-dev libjemalloc-dev && \ + ./configure \ + LIBS="-ldl -pthread" \ + OPENSSL_LIBS="-l:libssl.a -l:libcrypto.a" \ + LIBEV_LIBS="-l:libev.a" \ + JEMALLOC_LIBS="-l:libjemalloc.a" && \ + make -j$(nproc) LDFLAGS="-static-libtool-libs" && \ + strip examples/client examples/server && \ + cp examples/client examples/server /usr/local/bin && \ + cd .. && rm -rf ngtcp2 && \ + apt-get -y purge \ + git g++ 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-debian10 + +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"]