2024-08-08 07:47:42 +00:00
|
|
|
FROM scratch AS base
|
2024-02-03 13:24:28 +00:00
|
|
|
ENV VERSION=2.6.4
|
|
|
|
ENV SRC_HASH=e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995
|
|
|
|
ENV SRC_FILE=flex-${VERSION}.tar.gz
|
2024-02-09 07:30:28 +00:00
|
|
|
ENV SRC_SITE=https://github.com/westes/flex/releases/download/v${VERSION}/${SRC_FILE}
|
2024-02-02 21:38:33 +00:00
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM base AS fetch
|
2024-02-10 10:37:48 +00:00
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
2024-02-02 21:38:33 +00:00
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM fetch AS build
|
2024-02-15 15:22:38 +00:00
|
|
|
COPY --from=stagex/busybox . /
|
|
|
|
COPY --from=stagex/perl . /
|
|
|
|
COPY --from=stagex/gcc . /
|
|
|
|
COPY --from=stagex/binutils . /
|
|
|
|
COPY --from=stagex/make . /
|
|
|
|
COPY --from=stagex/m4 . /
|
|
|
|
COPY --from=stagex/libtool . /
|
|
|
|
COPY --from=stagex/autoconf . /
|
|
|
|
COPY --from=stagex/automake . /
|
|
|
|
COPY --from=stagex/bison . /
|
|
|
|
COPY --from=stagex/gettext . /
|
|
|
|
COPY --from=stagex/musl . /
|
2024-02-10 10:39:07 +00:00
|
|
|
RUN tar -xzf ${SRC_FILE}
|
|
|
|
WORKDIR flex-${VERSION}
|
2024-02-09 07:30:28 +00:00
|
|
|
RUN --network=none <<-EOF
|
|
|
|
set -eux
|
|
|
|
./autogen.sh
|
|
|
|
./configure \
|
|
|
|
--build=x86_64-unknown-linux-musl \
|
|
|
|
--host=x86_64-unknown-linux-musl \
|
|
|
|
--prefix=/usr \
|
2024-03-01 18:30:23 +00:00
|
|
|
--bindir=/usr/bin \
|
2024-02-09 07:30:28 +00:00
|
|
|
--mandir=/usr/share/man \
|
|
|
|
--infodir=/usr/share/info
|
2024-03-14 07:16:26 +00:00
|
|
|
make -j "$(nproc)" LDFLAGS=-static
|
2024-02-09 07:30:28 +00:00
|
|
|
EOF
|
2024-02-02 21:38:33 +00:00
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM build AS install
|
2024-02-09 07:30:28 +00:00
|
|
|
RUN --network=none make DESTDIR=/rootfs install
|
2024-02-02 21:38:33 +00:00
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM stagex/filesystem AS package
|
2024-03-01 18:30:23 +00:00
|
|
|
COPY --from=install /rootfs/. /
|