FROM scratch AS base ENV VERSION=1.7.1 ENV SRC_HASH=0d024b589e15d79eac8506cd67df7b53cf91e9e6a493c8319f33cd29b5f36426 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/. /