~fincham/static-binary-zoo

ref: e79e3898beb4586fb1a60be3f747649c0b38029e static-binary-zoo/Dockerfile.openssl-1.1.1k -rw-r--r-- 811 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
25
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://www.openssl.org/source/openssl-1.1.1k.tar.gz source.tar.gz 892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5 && tar xf source.tar.gz
RUN export PATH=/build/cross/bin:$PATH && \
cd openssl-* && \
CC="gcc" \
CFLAGS="-static -frandom-seed=pulse -I/output/include" \
LDFLAGS="-L/output/lib" \
./Configure \
--cross-compile-prefix=$MUSL_TARGET- \
-static \
no-shared no-engine 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