FROM scratch AS base ARG ARCH=x86_64 ENV VERSION=0.9.6 ENV SRC_HASH=2807466f1563ebe45fdd12dd26e501e8a0c4fbb99c7c428fbb508789efd221c0 ENV SRC_FILE=v${VERSION}.tar.gz ENV SRC_SITE=https://github.com/stefanberger/libtpms/archive/${SRC_FILE} FROM base AS fetch ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} . FROM fetch AS build COPY --from=stagex/busybox . / COPY --from=stagex/binutils . / COPY --from=stagex/musl . / COPY --from=stagex/make . / COPY --from=stagex/gcc . / COPY --from=stagex/m4 . / COPY --from=stagex/perl . / COPY --from=stagex/autoconf . / COPY --from=stagex/automake . / COPY --from=stagex/pkgconf . / COPY --from=stagex/libtool . / COPY --from=stagex/openssl . / COPY --from=stagex/libtasn1 . / RUN tar -xf ${SRC_FILE} WORKDIR /libtpms-${VERSION} RUN --network=none <<-EOF set -ex NOCONFIGURE=1 ./autogen.sh ./configure \ --build=${ARCH}-linux-musl \ --host=${ARCH}-linux-musl \ --prefix=/usr \ --libdir=/usr/lib \ --with-openssl \ --with-tss-user=root \ --with-tss-group=root make -j "$(nproc)" EOF FROM build AS install RUN --network=none make DESTDIR="/rootfs" install FROM stagex/filesystem AS package COPY --from=install /rootfs/. /