FROM scratch AS base ENV VERSION=2.5.5 ENV SRC_HASH=248a2c8a4d9b9858aa6baf52712c34afefcf9c9e94b76dce02c1c9aa25fb3375 ENV SRC_FILE=libseccomp-${VERSION}.tar.gz ENV SRC_SITE=https://github.com/seccomp/libseccomp/releases/download/v${VERSION}/${SRC_FILE} 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/gperf . / COPY --from=stagex/linux-headers . / COPY --from=stagex/binutils . / COPY --from=stagex/python . / COPY --from=stagex/cython . / COPY --from=stagex/make . / COPY --from=stagex/musl . / COPY --from=stagex/zlib . / RUN tar -xf ${SRC_FILE} WORKDIR /libseccomp-${VERSION} RUN --network=none <<-EOF set -eux; ./configure \ --build=x86_64-linux-musl \ --host=x86_64-linux-musl \ --prefix=/usr \ --infodir=/usr/share/info \ --sysconfdir=/etc \ --localstatedir=/var \ --enable-python \ --enable-static make -j "$(nproc)" EOF FROM build AS install RUN --network=none make DESTDIR=/rootfs install FROM stagex/filesystem AS package COPY --from=install /rootfs/. /