stagex/packages/libcap/Containerfile

38 lines
1.1 KiB
Text
Raw Permalink Normal View History

2024-08-08 07:47:42 +00:00
FROM scratch AS base
2024-02-21 15:27:37 +00:00
ENV VERSION=2.69
ENV SRC_HASH=9cc2fa3ee744d881629cdac1a1b54c302e7684fda3e3622056218c7681642ffb
2024-02-21 02:24:03 +00:00
ENV SRC_FILE=libcap-${VERSION}.tar.gz
ENV SRC_SITE=https://git.kernel.org/pub/scm/libs/libcap/libcap.git/snapshot/${SRC_FILE}
2024-02-21 02:24:03 +00:00
2024-08-08 07:47:42 +00:00
FROM base AS fetch
2024-02-21 02:24:03 +00:00
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
2024-08-08 07:47:42 +00:00
FROM fetch AS build
COPY --from=stagex/bash . /
COPY --from=stagex/binutils . /
2024-02-21 02:24:03 +00:00
COPY --from=stagex/busybox . /
COPY --from=stagex/linux-headers . /
2024-02-21 02:24:03 +00:00
COPY --from=stagex/make . /
COPY --from=stagex/musl . /
COPY --from=stagex/perl . /
2024-02-21 02:24:03 +00:00
COPY --from=stagex/gcc . /
RUN tar -xzf ${SRC_FILE}
2024-08-26 01:18:52 +00:00
WORKDIR /libcap-${VERSION}
RUN --network=none make -j "$(nproc)" lib=lib prefix=/usr GOLANG=no DESTDIR=/rootfs
2024-02-21 02:24:03 +00:00
2024-08-08 07:47:42 +00:00
FROM build AS install
RUN --network=none make lib=lib prefix=/usr GOLANG=no DESTDIR=/rootfs install
2024-02-21 02:24:03 +00:00
2024-08-08 07:47:42 +00:00
FROM scratch AS test
2024-02-27 03:42:00 +00:00
COPY --from=install /rootfs /
RUN --network=none <<-EOF
set -eux
getcap --license | grep LICENSE || true
setcap -l | grep LICENSE || true
getpcaps --license | grep LICENSE || true
capsh --license | grep License || true
EOF
2024-02-21 02:24:03 +00:00
2024-08-08 07:47:42 +00:00
FROM stagex/filesystem AS package
2024-02-21 02:24:03 +00:00
COPY --from=install /rootfs /