FROM scratch AS base ENV VERSION=1.2.8 ENV SRC_FILE=libnftnl-${VERSION}.tar.xz ENV SRC_SITE=https://netfilter.org/projects/libnftnl/files/${SRC_FILE} ENV SRC_HASH=37fea5d6b5c9b08de7920d298de3cdc942e7ae64b1a3e8b880b2d390ae67ad95 FROM base AS fetch ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} . FROM fetch AS build COPY --from=stagex/busybox . / COPY --from=stagex/gcc . / COPY --from=stagex/binutils . / COPY --from=stagex/make . / COPY --from=stagex/musl . / COPY --from=stagex/pkgconf . / COPY --from=stagex/m4 . / COPY --from=stagex/libmnl . / COPY --from=stagex/linux-headers . / RUN tar -xf ${SRC_FILE} WORKDIR /libnftnl-${VERSION} RUN --network=none <<-EOF set -eux ./configure \ --build=x86_64-linux-musl \ --host=x86_64-linux-musl \ --prefix=/usr \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --localstatedir=/var \ --enable-static make -j "$(nproc)" EOF FROM build AS install RUN <<-EOF set -eux make install DESTDIR=/rootfs EOF FROM stagex/filesystem AS package COPY --from=install /rootfs/. /