43 lines
1.2 KiB
Docker
43 lines
1.2 KiB
Docker
FROM scratch as base
|
|
ENV VERSION=2.6.4
|
|
ENV SRC_HASH=e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995
|
|
ENV SRC_FILE=flex-${VERSION}.tar.gz
|
|
ENV SRC_SITE=https://github.com/westes/flex/releases/download/v${VERSION}/${SRC_FILE}
|
|
|
|
FROM base as fetch
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
|
|
|
FROM fetch as build
|
|
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 . /
|
|
RUN tar -xzf ${SRC_FILE}
|
|
WORKDIR flex-${VERSION}
|
|
RUN --network=none <<-EOF
|
|
set -eux
|
|
./autogen.sh
|
|
./configure \
|
|
--build=x86_64-unknown-linux-musl \
|
|
--host=x86_64-unknown-linux-musl \
|
|
--prefix=/usr \
|
|
--bindir=/usr/bin \
|
|
--mandir=/usr/share/man \
|
|
--infodir=/usr/share/info
|
|
make -j "$(nproc)" LDFLAGS=-static
|
|
EOF
|
|
|
|
FROM build as install
|
|
RUN --network=none make DESTDIR=/rootfs install
|
|
RUN find /rootfs -exec touch -hcd "@0" "{}" +
|
|
|
|
FROM stagex/filesystem as package
|
|
COPY --from=install /rootfs/. /
|