feat: add parted

This commit is contained in:
Lance R. Vick 2024-10-09 15:49:15 -07:00
parent 6ab34a5f45
commit c2561d9e4d
No known key found for this signature in database
GPG key ID: 8E47A1EC35A1551D

View file

@ -0,0 +1,42 @@
FROM scratch AS base
ARG ARCH=x86_64
ENV VERSION=3.6
ENV SRC_HASH=3b43dbe33cca0f9a18601ebab56b7852b128ec1a3df3a9b30ccde5e73359e612
ENV SRC_FILE=parted-${VERSION}.tar.xz
ENV SRC_SITE=https://ftp.gnu.org/gnu/parted/${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/util-linux . /
COPY --from=stagex/linux-headers . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/musl . /
COPY --from=stagex/make . /
COPY --from=stagex/gcc . /
RUN tar -xf ${SRC_FILE}
WORKDIR /parted-${VERSION}
RUN --network=none <<-EOF
set -ex
./configure \
--build=${ARCH}-linux-musl \
--host=${ARCH}-linux-musl \
--target=${ARCH}-linux-musl \
--prefix=/usr \
--enable-debug \
--enable-shared \
--without-readline \
--disable-nls \
--disable-shared \
--disable-device-mapper
make -j "$(nproc)"
EOF
FROM build AS install
RUN --network=none make DESTDIR="/rootfs" install
FROM stagex/filesystem AS package
COPY --from=install /rootfs/. /