-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.ubuntu
63 lines (56 loc) · 2.22 KB
/
Dockerfile.ubuntu
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
FROM ubuntu:22.04 as base-fetch
RUN apt-get update && apt-get install -y git
FROM ubuntu:22.04 as base-build
RUN apt-get update && apt-get install -y build-essential pkg-config
FROM base-fetch as fetch-quiche
WORKDIR /root
RUN git clone --recursive --depth 1 https://github.com/cloudflare/quiche
RUN mkdir quiche/deps/boringssl/build
FROM base-build as prepare-quiche
RUN apt-get update && apt-get install -y cmake golang-go
COPY --from=fetch-quiche /root/quiche /root/quiche
WORKDIR /root/quiche/deps/boringssl/build
RUN cmake -DCMAKE_POSITION_INDEPENDENT_CODE=on ..
RUN make -j`nproc`
WORKDIR /root/quiche/deps/boringssl
RUN mkdir .openssl/lib -p
RUN cp build/crypto/libcrypto.a build/ssl/libssl.a .openssl/lib
RUN ln -s $PWD/include .openssl
FROM base-build as build-quiche
WORKDIR /root
RUN apt-get update && apt-get install -y wget ca-certificates && \
wget https://sh.rustup.rs -O install.sh \
&& chmod +x install.sh \
&& ./install.sh -y \
&& rm -rf install.sh && \
apt-get purge -y --auto-remove wget
COPY --from=prepare-quiche /root/quiche /root/quiche
WORKDIR /root/quiche/
RUN QUICHE_BSSL_PATH=$PWD/deps/boringssl \
$HOME/.cargo/bin/cargo \
build \
--release \
--features \
pkg-config-meta
FROM base-fetch as fetch-curl
WORKDIR /root
RUN git clone --depth 1 https://github.com/curl/curl
FROM base-build as build-curl
RUN apt-get update && apt-get install -y autoconf libtool
COPY --from=fetch-curl /root/curl /root/curl
WORKDIR /root/curl
RUN ./buildconf
COPY --from=build-quiche /root/quiche /root/quiche
RUN ./configure LDFLAGS="-Wl,-rpath,$PWD/../quiche/target/release" \
--with-ssl=$PWD/../quiche/deps/boringssl/.openssl \
--with-quiche=$PWD/../quiche/target/release
RUN make -j`nproc`
RUN make install
FROM ubuntu:22.04 as executor
COPY --from=build-curl /etc/ld.so.conf.d/libc.conf /etc/ld.so.conf.d/libcurl.conf
COPY --from=build-curl /usr/local/lib/libcurl.so.4 /usr/local/lib/libcurl.so.4
COPY --from=build-curl /etc/ld.so.conf.d/libc.conf /etc/ld.so.conf.d/libquiche.conf
COPY --from=build-curl /root/quiche/target/release/libquiche.so /usr/local/lib/libquiche.so
COPY --from=build-curl /usr/local/bin/curl /usr/local/bin/curl
RUN ldconfig
CMD ["bash"]