FROM scratch AS base ENV VERSION=1.2.7 ENV SRC_FILE=libnftnl-${VERSION}.tar.xz ENV SRC_SITE=https://netfilter.org/projects/libnftnl/files/${SRC_FILE} ENV SRC_HASH=9122774f968093d5c0bacddd67de480f31fa4073405a7fc058a34b0f387aecb3 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/. /