2024-08-08 07:47:42 +00:00
|
|
|
FROM scratch AS base
|
2024-02-14 16:00:24 +00:00
|
|
|
ARG ARCH=x86_64
|
|
|
|
ENV VERSION=1.35
|
|
|
|
ENV SRC_HASH=4d62ff37342ec7aed748535323930c7cf94acf71c3591882b26a7ea50f3edc16
|
|
|
|
ENV SRC_FILE=tar-${VERSION}.tar.xz
|
|
|
|
ENV SRC_SITE=https://ftp.gnu.org/gnu/tar/${SRC_FILE}
|
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM base AS fetch
|
2024-02-14 16:00:24 +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/gcc . /
|
2024-02-14 16:00:24 +00:00
|
|
|
RUN tar -xf tar-${VERSION}.tar.xz
|
|
|
|
WORKDIR tar-${VERSION}
|
|
|
|
ENV FORCE_UNSAFE_CONFIGURE=1
|
|
|
|
RUN --network=none <<-EOF
|
|
|
|
set -ex
|
|
|
|
./configure \
|
|
|
|
--build=${ARCH}-linux-musl \
|
|
|
|
--host=${ARCH}-linux-musl \
|
|
|
|
--target=${ARCH}-linux-musl \
|
|
|
|
--prefix=/usr \
|
|
|
|
--mandir=/usr/share/man \
|
|
|
|
--localstatedir=/var \
|
2024-02-15 03:52:39 +00:00
|
|
|
--sysconfdir=/etc \
|
|
|
|
gl_cv_func_getcwd_path_max="no, but it is partly working"
|
2024-02-14 16:00:24 +00:00
|
|
|
make -j "$(nproc)"
|
|
|
|
EOF
|
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM build AS install
|
2024-02-14 16:00:24 +00:00
|
|
|
RUN --network=none make DESTDIR="/rootfs" install
|
|
|
|
|
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/. /
|