-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.curl-7.79.1
33 lines (30 loc) · 1.06 KB
/
Dockerfile.curl-7.79.1
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
ARG MUSL_TARGET=x86_64-linux-musl
FROM openssl-1.1.1k-${MUSL_TARGET} AS openssl
FROM musl-cross-make-$MUSL_TARGET
ARG MUSL_TARGET
COPY --from=openssl /output /output
# curl really doesn't like keeping -static in the CFLAGS / CPPFLAGS so this uses a wrapper script around CC instead
WORKDIR /build
RUN download https://curl.se/download/curl-7.79.1.tar.gz source.tar.gz 370b11201349816287fb0ccc995e420277fbfcaf76206e309b3f60f0eda090c2 && tar xf source.tar.gz
RUN export PATH=/build/cross/bin:$PATH && \
cd curl-* && \
echo '#!/bin/sh\nexec $MUSL_TARGET-gcc -static "$@"' > /usr/local/bin/gcc && \
chmod +x /usr/local/bin/gcc && \
export CC="/usr/local/bin/gcc" && \
export CFLAGS="-frandom-seed=pulse" && \
export CPPFLAGS="-I/output/include" && \
export LDFLAGS="-L/output/lib" && \
./configure \
--disable-ldap \
--enable-ipv6 \
--enable-static \
--disable-shared \
--enable-threaded-resolver \
--host=$($MUSL_TARGET-gcc -dumpmachine) \
--prefix=/output \
--with-ca-fallback \
--with-openssl && \
make -j$(nproc) && \
make install && \
${MUSL_TARGET}-strip /output/bin/curl
CMD bash