feat: package iproute2

This commit is contained in:
Lance R. Vick 2024-09-18 14:45:41 -07:00
parent bcb8724ea5
commit e9a6775570
No known key found for this signature in database
GPG key ID: 8E47A1EC35A1551D

View file

@ -0,0 +1,34 @@
FROM scratch AS base
ENV VERSION=6.10.0
ENV SRC_HASH=91a62f82737b44905a00fa803369c447d549e914e9a2a4018fdd75b1d54e8dce
ENV SRC_FILE=iproute2-${VERSION}.tar.xz
ENV SRC_SITE=http://mirrors.edge.kernel.org/pub/linux/utils/net/iproute2/${SRC_FILE}
FROM base AS fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch AS build
COPY --from=stagex/busybox . /
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/linux-headers . /
COPY --from=stagex/m4 . /
COPY --from=stagex/bison . /
COPY --from=stagex/flex . /
COPY --from=stagex/elfutils . /
RUN tar -xvf $SRC_FILE
WORKDIR /iproute2-${VERSION}
RUN --network=none make -j "$(nproc)" V=1
FROM build AS install
RUN <<-EOF
make DESTDIR=/rootfs install
mv /rootfs/sbin /rootfs/usr/sbin
install -D -m644 include/libnetlink.h /rootfs/usr/include/libnetlink.h
install -D -m644 lib/libnetlink.a /rootfs/usr/lib/libnetlink.a
EOF
FROM stagex/filesystem AS package
COPY --from=install /rootfs/. /