FROM scratch as base ENV VERSION=8.9.1 ENV SRC_HASH=f292f6cc051d5bbabf725ef85d432dfeacc8711dd717ea97612ae590643801e5 ENV SRC_FILE=curl-${VERSION}.tar.xz ENV SRC_SITE=https://curl.se/download/${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/make . / COPY --from=stagex/musl . / COPY --from=stagex/gcc . / COPY --from=stagex/openssl . / COPY --from=stagex/perl . / COPY --from=stagex/ca-certificates . / RUN tar -xf curl-${VERSION}.tar.xz WORKDIR curl-${VERSION} RUN --network=none <<-EOF set -eux ./configure \ --build=x86_64-linux-musl \ --host=x86_64-linux-musl \ --prefix=/usr \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \ --with-openssl \ --enable-static-link make -j "$(nproc)" EOF FROM build as install RUN --network=none make install DESTDIR=/rootfs FROM stagex/filesystem as package COPY --from=install /rootfs/. /