Skip to content

Instantly share code, notes, and snippets.

@ymstmsys
Created March 13, 2022 07:52
Show Gist options
  • Save ymstmsys/aaa925f4c5ca9f6803fffc07d60a0ff5 to your computer and use it in GitHub Desktop.
Save ymstmsys/aaa925f4c5ca9f6803fffc07d60a0ff5 to your computer and use it in GitHub Desktop.
curl for HTTP/3 with quiche
FROM ubuntu:focal as builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y git
# install quiche
RUN apt-get install -y cargo cmake g++
RUN git clone --recursive https://github.com/cloudflare/quiche /quiche
WORKDIR /quiche
RUN cargo build --package quiche --release --features ffi,pkg-config-meta,qlog
RUN mkdir quiche/deps/boringssl/src/lib
RUN ln -vnf $(find target/release -name libcrypto.a -o -name libssl.a) quiche/deps/boringssl/src/lib/
# install curl
RUN apt-get install -y autoconf libtool pkg-config
RUN git clone https://github.com/curl/curl /curl
WORKDIR /curl
RUN autoreconf -fi
RUN ./configure LDFLAGS="-Wl,-rpath,$PWD/../quiche/target/release" --with-openssl=$PWD/../quiche/quiche/deps/boringssl/src --with-quiche=$PWD/../quiche/target/release
RUN make
RUN make install
# for copy
RUN cp /quiche/target/release/libquiche.so /usr/local/lib/ && tar zcf /curl.tar.gz /usr/local/lib/* /usr/local/bin/*
FROM ubuntu:focal
COPY --from=builder /curl.tar.gz /
RUN tar zxf /curl.tar.gz && rm -f /curl.tar.gz
RUN ldconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment