Source
FROM scratch AS build
ARG VERSION
COPY --from=stagex/core-busybox . /
COPY --from=stagex/core-perl . /
COPY --from=stagex/core-gcc . /
COPY --from=stagex/core-binutils . /
COPY --from=stagex/core-make . /
COPY --from=stagex/core-m4 . /
COPY --from=stagex/core-libtool . /
COPY --from=stagex/core-autoconf . /
COPY --from=stagex/core-automake . /
COPY --from=stagex/core-bison . /
COPY --from=stagex/core-gettext . /
COPY --from=stagex/core-musl . /
ADD fetch/flex-${VERSION}.tar.gz .
WORKDIR /flex-${VERSION}
RUN --network=none <<-EOF
set -eux
./autogen.sh
./configure \
--prefix=/usr \
--bindir=/usr/bin \
--mandir=/usr/share/man \
--infodir=/usr/share/info
make -j "$(nproc)" LDFLAGS=-static
EOF
RUN --network=none make DESTDIR=/rootfs install
FROM stagex/core-filesystem AS package
COPY --from=build /rootfs/ /