stagex/packages/gzip/Containerfile

38 lines
967 B
Text
Raw Normal View History

2024-02-14 16:00:24 +00:00
FROM scratch as base
ARG ARCH=x86_64
ENV VERSION=1.13
ENV SRC_HASH=7454eb6935db17c6655576c2e1b0fabefd38b4d0936e0f87f48cd062ce91a057
ENV SRC_FILE=gzip-${VERSION}.tar.xz
ENV SRC_SITE=https://ftp.gnu.org/gnu/gzip/${SRC_FILE}
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch as build
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 ${SRC_FILE}
WORKDIR gzip-${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 \
--infodir=/usr/share/info
make -j "$(nproc)"
EOF
FROM build as install
RUN --network=none make DESTDIR="/rootfs" install
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM stagex/filesystem as package
COPY --from=install /rootfs/. /