FROM scratch as base ENV VERSION=3.45.1 ENV SRC_HASH=af857d9ba958d26486639e2e0ffcd8be9d9f0d725fed0b174e017aa916d82d48 ENV SRC_FILE=vesion-${VERSION}.tar.gz ENV SRC_SITE=https://github.com/sqlite/sqlite/archive/refs/tags/${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/gcc . / COPY --from=stagex/tcl . / COPY --from=stagex/make . / COPY --from=stagex/musl . / RUN tar -xf ${SRC_FILE} WORKDIR sqlite-vesion-${VERSION} RUN --network=none <<-EOF set -eux ./configure \ --prefix=/usr 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/. /