stagex/packages/libarchive/Containerfile

34 lines
838 B
Text
Raw Normal View History

2024-08-08 07:47:42 +00:00
FROM scratch AS base
2024-08-04 17:43:52 +00:00
ARG ARCH=x86_64
ENV VERSION=3.7.4
ENV SRC_HASH=f887755c434a736a609cbd28d87ddbfbe9d6a3bb5b703c22c02f6af80a802735
ENV SRC_FILE=libarchive-${VERSION}.tar.xz
ENV SRC_SITE=https://libarchive.org/downloads/${SRC_FILE}
2024-08-08 07:47:42 +00:00
FROM base AS fetch
2024-08-04 17:43:52 +00:00
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
2024-08-08 07:47:42 +00:00
FROM fetch AS build
2024-08-04 17:43:52 +00:00
COPY --from=stagex/busybox . /
COPY --from=stagex/binutils . /
COPY --from=stagex/musl . /
COPY --from=stagex/make . /
COPY --from=stagex/gcc . /
RUN tar -xf ${SRC_FILE}
WORKDIR libarchive-${VERSION}
RUN --network=none <<-EOF
set -ex
./configure \
--build=${ARCH}-linux-musl \
--host=${ARCH}-linux-musl \
--prefix=/usr \
--without-xml2
make -j "$(nproc)"
EOF
2024-08-08 07:47:42 +00:00
FROM build AS install
2024-08-04 17:43:52 +00:00
RUN --network=none make DESTDIR="/rootfs" install
2024-08-08 07:47:42 +00:00
FROM stagex/filesystem AS package
2024-08-04 17:43:52 +00:00
COPY --from=install /rootfs/. /