2024-08-08 07:47:42 +00:00
|
|
|
FROM scratch AS base
|
2024-02-14 18:36:15 +00:00
|
|
|
ARG ARCH=x86_64
|
|
|
|
ENV VERSION=1.20
|
|
|
|
ENV SRC_HASH=c6030defe6ae172f1687906d7354054c75a6a9130af319d4e73c50a91959c5a6
|
|
|
|
ENV SRC_FILE=ed-${VERSION}.tar.lz
|
|
|
|
ENV SRC_SITE=https://ftp.gnu.org/gnu/ed/${SRC_FILE}
|
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM base AS fetch
|
2024-02-14 18:36:15 +00:00
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
|
|
|
|
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/binutils . /
|
|
|
|
COPY --from=stagex/musl . /
|
|
|
|
COPY --from=stagex/make . /
|
|
|
|
COPY --from=stagex/tar . /
|
|
|
|
COPY --from=stagex/lzip . /
|
|
|
|
COPY --from=stagex/gcc . /
|
2024-02-14 18:36:15 +00:00
|
|
|
RUN tar --lzip -xf ${SRC_FILE}
|
2024-08-26 01:18:52 +00:00
|
|
|
WORKDIR /ed-${VERSION}
|
2024-02-14 18:36:15 +00:00
|
|
|
RUN --network=none <<-EOF
|
|
|
|
set -ex
|
|
|
|
./configure \
|
|
|
|
--build=${ARCH}-linux-musl \
|
|
|
|
--host=${ARCH}-linux-musl \
|
|
|
|
--target=${ARCH}-linux-musl \
|
|
|
|
--prefix=/usr \
|
2024-03-01 18:30:23 +00:00
|
|
|
--bindir=/usr/bin \
|
2024-02-14 18:36:15 +00:00
|
|
|
--mandir=/usr/share/man
|
|
|
|
make -j "$(nproc)"
|
|
|
|
EOF
|
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM build AS install
|
2024-04-11 20:09:20 +00:00
|
|
|
RUN make DESTDIR="/rootfs" install
|
2024-02-14 18:36:15 +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/. /
|