~fincham/static-binary-zoo

ref: e79e3898beb4586fb1a60be3f747649c0b38029e static-binary-zoo/Dockerfile.socat-1.7.4.1 -rw-r--r-- 883 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
26
27
ARG MUSL_TARGET=x86_64-linux-musl
FROM openssl-1.1.1k-${MUSL_TARGET} AS openssl
FROM readline-8.1-${MUSL_TARGET} AS readline
FROM zlib-1.2.11-${MUSL_TARGET} AS zlib
FROM musl-cross-make-${MUSL_TARGET}
ARG MUSL_TARGET

COPY --from=openssl /output /output
COPY --from=readline /output /output
COPY --from=zlib /output /output

WORKDIR /build
RUN download http://www.dest-unreach.org/socat/download/socat-1.7.4.1.tar.gz source.tar.gz 0c7e635070af1b9037fd96869fc45eacf9845cb54547681de9d885044538736d && tar xf source.tar.gz
RUN export PATH=/build/cross/bin:$PATH && \
cd socat-* && \
CC="${MUSL_TARGET}-gcc" \
CPPFLAGS="-static -frandom-seed=pulse -I/output/include" \
LDFLAGS="-L/output/lib" \
LIBS="-lssl -lcrypto -lz" \
./configure \
--prefix=/output \
--host=$($MUSL_TARGET-gcc -dumpmachine) && \
make -j$(nproc) && \
make install && \
$MUSL_TARGET-strip /output/bin/socat

CMD bash