~fincham/static-binary-zoo

ref: e79e3898beb4586fb1a60be3f747649c0b38029e static-binary-zoo/Dockerfile.loggedfs-0.9 -rw-r--r-- 967 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
ARG MUSL_TARGET=x86_64-linux-musl
FROM fuse-2.9.9-${MUSL_TARGET} AS fuse
FROM libxml2-2.9.12-${MUSL_TARGET} AS libxml2
FROM pcre-8.45-${MUSL_TARGET} AS pcre
FROM musl-cross-make-${MUSL_TARGET}
ARG MUSL_TARGET

COPY --from=fuse /output /output
COPY --from=libxml2 /output /output
COPY --from=pcre /output /output

WORKDIR /build
RUN download https://github.com/rflament/loggedfs/archive/refs/tags/loggedfs-0.9.tar.gz source.tar.gz 10cd007782c6b91a154758dabac0c3b41e580ca0f9496cab411054219ef52b22 && tar xf source.tar.gz
RUN export PATH=/build/cross/bin:/output/bin:$PATH && \
cd loggedfs-* && \
sed -e 's/^CC=/CC?=/' -e 's/^CFLAGS=/CFLAGS+=/' -e 's/^LDFLAGS=/LDFLAGS+=/' -i Makefile && \
CC="${MUSL_TARGET}-g++ -static -static-libstdc++" \
CFLAGS="-frandom-seed=pulse -I/output/include" \
LDFLAGS="-L/output/lib" \
make -j$(nproc) && \
make install && \
mkdir -p /output/bin && \
mv /usr/bin/loggedfs /output/bin && \
$MUSL_TARGET-strip /output/bin/loggedfs

CMD bash