FROM scratch as base ENV VERSION=3.4.2 ENV SRC_HASH=27d05534699735dc69e86add5b808d6cb35900ad3fd63fa82e3eb644336abfa0 ENV SRC_FILE=bison-${VERSION}.tar.xz ENV SRC_SITE=http://mirrors.kernel.org/gnu/bison/${SRC_FILE} FROM base as fetch ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} . FROM fetch as build COPY --from=musl . / COPY --from=busybox . / COPY --from=gcc . / COPY --from=binutils . / COPY --from=perl . / COPY --from=autoconf . / COPY --from=automake . / COPY --from=make . / COPY --from=m4 . / RUN tar -xf ${SRC_FILE} WORKDIR bison-${VERSION} ENV M4=/usr/bin/m4 RUN --network=none <<-EOF set -eux ./configure \ --prefix=/usr \ --disable-nls make -j1 MAKEINFO=false EOF from build as install RUN --network=none make DESTDIR=/rootfs install RUN find /rootfs -exec touch -hcd "@0" "{}" + FROM scratch as package COPY --from=install /rootfs /