diff --git a/packages/iproute2/Containerfile b/packages/iproute2/Containerfile new file mode 100644 index 0000000..5f01e6f --- /dev/null +++ b/packages/iproute2/Containerfile @@ -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/. /