FROM scratch as base ENV VERSION=1.3.1 ENV SRC_FILE=meson-${VERSION}.tar.gz ENV SRC_SITE=https://github.com/mesonbuild/meson/releases/download/${VERSION}/${SRC_FILE} ENV SRC_HASH=6020568bdede1643d4fb41e28215be38eff5d52da28ac7d125457c59e0032ad7 FROM base as fetch ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} . FROM fetch as build COPY --from=stagex/busybox . / COPY --from=stagex/musl . / COPY --from=stagex/python . / COPY --from=stagex/py-setuptools . / COPY --from=stagex/zlib . / RUN tar -xf ${SRC_FILE} WORKDIR meson-${VERSION} RUN python setup.py build FROM build as install RUN --network=none python setup.py install --root=/rootfs RUN find /rootfs -exec touch -hcd "@0" "{}" + FROM scratch as package COPY --from=install /rootfs /