2024-02-14 18:36:15 +00:00
|
|
|
FROM scratch as base
|
|
|
|
ARG ARCH=x86_64
|
|
|
|
ENV VERSION=3.10
|
|
|
|
ENV SRC_HASH=90e5e93cc724e4ebe12ede80df1634063c7a855692685919bfe60b556c9bd09e
|
|
|
|
ENV SRC_FILE=diffutils-${VERSION}.tar.xz
|
|
|
|
ENV SRC_SITE=https://ftp.gnu.org/gnu/diffutils/${SRC_FILE}
|
|
|
|
|
|
|
|
FROM base as fetch
|
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
|
|
|
|
|
|
|
FROM fetch as build
|
2024-02-15 15:22:38 +00:00
|
|
|
COPY --from=stagex/busybox . /
|
|
|
|
COPY --from=stagex/binutils . /
|
|
|
|
COPY --from=stagex/musl . /
|
|
|
|
COPY --from=stagex/make . /
|
|
|
|
COPY --from=stagex/gcc . /
|
2024-02-14 18:36:15 +00:00
|
|
|
RUN tar -xf ${SRC_FILE}
|
|
|
|
WORKDIR diffutils-${VERSION}
|
|
|
|
RUN --network=none <<-EOF
|
|
|
|
set -ex
|
|
|
|
./configure \
|
|
|
|
--build=${ARCH}-linux-musl \
|
|
|
|
--host=${ARCH}-linux-musl \
|
|
|
|
--prefix=/usr \
|
|
|
|
--mandir=/usr/share/man \
|
|
|
|
--infodir=/usr/share/info \
|
|
|
|
--disable-nls
|
|
|
|
make -j "$(nproc)"
|
|
|
|
EOF
|
|
|
|
|
|
|
|
FROM build as install
|
|
|
|
RUN --network=none make DESTDIR="/rootfs" install
|
|
|
|
|
2024-03-01 18:30:23 +00:00
|
|
|
FROM stagex/filesystem as package
|
|
|
|
COPY --from=install /rootfs/. /
|