39 lines
950 B
Text
39 lines
950 B
Text
|
FROM scratch as base
|
||
|
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}
|
||
|
|
||
|
FROM base as fetch
|
||
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
||
|
|
||
|
FROM fetch as build
|
||
|
COPY --from=busybox . /
|
||
|
COPY --from=binutils . /
|
||
|
COPY --from=musl . /
|
||
|
COPY --from=make . /
|
||
|
COPY --from=gcc . /
|
||
|
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 \
|
||
|
--sysconfdir=/etc
|
||
|
make -j "$(nproc)"
|
||
|
EOF
|
||
|
|
||
|
FROM build as install
|
||
|
RUN --network=none make DESTDIR="/rootfs" install
|
||
|
RUN find /rootfs -exec touch -hcd "@0" "{}" +
|
||
|
|
||
|
FROM scratch as package
|
||
|
COPY --from=install /rootfs /
|