~fincham/static-binary-zoo

ref: e79e3898beb4586fb1a60be3f747649c0b38029e static-binary-zoo/Dockerfile.openssl-0.9.8zh -rw-r--r-- 864 bytes
e79e3898 — Michael Fincham Spelling 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
ARG MUSL_TARGET=x86_64-linux-musl
FROM zlib-1.2.11-${MUSL_TARGET} AS zlib
FROM musl-cross-make-${MUSL_TARGET}
ARG MUSL_TARGET

COPY --from=zlib /output /output

WORKDIR /build
RUN download https://ftp.openssl.org/source/old/0.9.x/openssl-0.9.8zh.tar.gz source.tar.gz f1d9f3ed1b85a82ecf80d0e2d389e1fda3fca9a4dba0bf07adbf231e1a5e2fd6 && tar xf source.tar.gz
COPY patches/openssl-0.9.8zh /build/patches
RUN export PATH=/build/cross/bin:$PATH && \
cd openssl-* && \
find /build/patches -type f -exec patch -p1 -i {} \; && \
CC="$MUSL_TARGET-gcc -frandom-seed=pulse -I/output/include -L/output/lib" \
./Configure \
-static \
no-shared no-asm zlib \
--prefix=/output \
$(if echo "$MUSL_TARGET" | grep 64 >/dev/null; then echo linux-generic64; else echo linux-generic32; fi) && \
make -j$(nproc) && \
make install_sw && \
$MUSL_TARGET-strip /output/bin/openssl

CMD bash