FROM scratch AS base ARG ARCH=x86_64 ENV VERSION=1.47.1 ENV SRC_HASH=db95ff1cb6ef741c9aa8875d9f3f52a34168360febba765b6377b80bada09a8c ENV SRC_FILE=v${VERSION}.tar.gz ENV SRC_SITE=https://github.com/tytso/e2fsprogs/archive/${SRC_FILE} FROM base AS fetch ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} . FROM fetch AS build COPY --from=stagex/bash . / COPY --from=stagex/binutils . / COPY --from=stagex/pkgconf . / COPY --from=stagex/busybox . / COPY --from=stagex/make . / COPY --from=stagex/linux-headers . / COPY --from=stagex/util-linux . / COPY --from=stagex/musl . / COPY --from=stagex/gcc . / RUN tar -xzf ${SRC_FILE} WORKDIR /e2fsprogs-${VERSION} RUN --network=none <<-EOF ./configure \ --build=${ARCH}-linux-musl \ --host=${ARCH}-linux-musl \ --prefix=/usr \ --mandir=/usr/share/man \ --enable-elf-shlibs \ --enable-symlink-install \ --disable-fsck \ --disable-uuidd \ --disable-libuuid \ --disable-libblkid \ --disable-nls make -j "$(nproc)" EOF FROM build AS install RUN make DESTDIR=/rootfs install FROM stagex/filesystem AS package COPY --from=install /rootfs/. /