FROM scratch as base ARG ARCH=x86_64 ENV VERSION=2.5.2 ENV SRC_HASH=39bf67452fa41d0948c2197601053f48b3d78a029389734332a6309a680c6c87 ENV SRC_FILE=attr-${VERSION}.tar.gz ENV SRC_SITE=https://download.savannah.nongnu.org/releases/attr/${SRC_FILE} FROM base as fetch ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} FROM fetch as build COPY --from=stagex/musl . / COPY --from=stagex/gcc . / COPY --from=stagex/busybox . / COPY --from=stagex/binutils . / COPY --from=stagex/make . / COPY --from=stagex/perl . / RUN tar -xf ${SRC_FILE} WORKDIR attr-${VERSION} RUN --network=none <<-EOF set -eux ./configure \ --prefix=/usr \ --exec-prefix=/ \ --sbindir=/bin \ --bindir=/usr/bin \ --libdir=/usr/lib \ --libexecdir=/usr/lib \ --includedir=/usr/include \ --mandir=/usr/share/man \ --docdir=/usr/share/doc/attr \ --datadir=/usr/share \ --disable-nls make EOF FROM build as install RUN make DESTDIR=/rootfs install RUN find /rootfs -exec touch -hcd "@0" "{}" + FROM stagex/filesystem as package COPY --from=install /rootfs/. /