stagex/packages/util-linux/Containerfile

54 lines
1.5 KiB
Text
Raw Normal View History

2024-02-17 20:42:53 +00:00
FROM scratch as base
ENV VERSION=2.39.3
ENV SRC_HASH=d3315ff701890f4fa1dd38ea387767fcb9e1aaeb763eb904677c03d2a7a5bdc1
ENV SRC_FILE=util-linux-${VERSION}.tar.gz
ENV SRC_SITE=https://codeload.github.com/util-linux/util-linux/legacy.tar.gz/v${VERSION}
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE}
FROM fetch as build
COPY --from=stagex/busybox . /
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/perl . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/autoconf . /
COPY --from=stagex/automake . /
COPY --from=stagex/gettext . /
COPY --from=stagex/bison . /
COPY --from=stagex/libtool . /
COPY --from=stagex/linux-headers . /
COPY --from=stagex/m4 . /
COPY --from=stagex/make . /
RUN mkdir util-linux
RUN tar -xvf $SRC_FILE --strip-components=1 -C util-linux
WORKDIR util-linux
RUN --network=none <<-EOF
set -eux
./autogen.sh
./configure \
--build=x86_64-unknown-linux-musl \
--host=x86_64-unknown-linux-musl \
--prefix=/usr \
--exec-prefix=/usr \
--sbindir=/usr/sbin \
--bindir=/usr/bin \
--libdir=/usr/lib \
2024-02-17 20:42:53 +00:00
--with-vendordir=/usr/lib \
--enable-fs-paths-extra=/usr/sbin \
--disable-nls \
2024-02-17 20:42:53 +00:00
--disable-silent-rules \
--disable-gtk-doc \
--enable-newgrp
make -j "$(nproc)"
2024-02-17 20:42:53 +00:00
EOF
FROM build as install
RUN make DESTDIR=/rootfs install
2024-02-17 20:42:53 +00:00
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM stagex/filesystem as package
COPY --from=install /rootfs/. /