FROM scratch AS base ENV VERSION=1.7.2 ENV SRC_HASH=fd6fcc25e8140f613b3bf44b02eda4a8a429ee4939fb777f474e2c829f7b472c ENV SRC_FILE=pcsc-tools-${VERSION}.tar.bz2 ENV SRC_SITE=https://pcsc-tools.apdu.fr/${SRC_FILE} FROM base as fetch ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} FROM fetch as build COPY --from=stagex/busybox . / COPY --from=stagex/m4 . / COPY --from=stagex/musl . / COPY --from=stagex/gcc . / COPY --from=stagex/binutils . / COPY --from=stagex/make . / COPY --from=stagex/perl . / COPY --from=stagex/flex . / COPY --from=stagex/pkgconf . / COPY --from=stagex/pcsc-lite . / RUN tar -xvjf $SRC_FILE WORKDIR pcsc-tools-${VERSION} RUN --network=none <<-EOF set -eux ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --localstatedir=/var make -j "$(nproc)" EOF FROM build as install RUN --network=none make DESTDIR=/rootfs install FROM stagex/filesystem as package COPY --from=install /rootfs/. /