stagex/packages/libcap/Containerfile

38 lines
1.1 KiB
Text
Raw Normal View History

2024-08-08 07:47:42 +00:00
FROM scratch AS base
ENV VERSION=2.70
ENV SRC_HASH=18f00ea97c7541af86379dec9d4d8ea838aac4a1f70177d81d91657e4e43b808
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 /