~fincham/static-binary-zoo

ref: e79e3898beb4586fb1a60be3f747649c0b38029e static-binary-zoo/Dockerfile.tcpdump-4.99.1 -rw-r--r-- 693 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
ARG MUSL_TARGET=x86_64-linux-musl
FROM libpcap-1.10.1-${MUSL_TARGET} AS libpcap
FROM musl-cross-make-${MUSL_TARGET}
ARG MUSL_TARGET

COPY --from=libpcap /output /output

WORKDIR /build
RUN download https://www.tcpdump.org/release/tcpdump-4.99.1.tar.gz source.tar.gz 79b36985fb2703146618d87c4acde3e068b91c553fb93f021a337f175fd10ebe && tar xf source.tar.gz
RUN export PATH=/build/cross/bin:$PATH && \
cd tcpdump-* && \ 
CC="${MUSL_TARGET}-gcc" \
CFLAGS="-static -frandom-seed=pulse -I/output/include" \
LDFLAGS="-L/output/lib" \
./configure \
--prefix=/output \
--host=$($MUSL_TARGET-gcc -dumpmachine) && \
make -j$(nproc) && \
make install && \
$MUSL_TARGET-strip /output/bin/tcpdump

CMD bash