2024-02-21 02:24:03 +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
|
2024-02-21 02:41:47 +00:00
|
|
|
ENV SRC_SITE=https://git.kernel.org/pub/scm/libs/libcap/libcap.git/snapshot/${SRC_FILE}
|
2024-02-21 02:24:03 +00:00
|
|
|
|
|
|
|
FROM base as fetch
|
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
|
|
|
|
|
|
|
FROM fetch as build
|
2024-02-21 04:11:43 +00:00
|
|
|
COPY --from=stagex/bash . /
|
2024-02-21 02:41:47 +00:00
|
|
|
COPY --from=stagex/binutils . /
|
2024-02-21 02:24:03 +00:00
|
|
|
COPY --from=stagex/busybox . /
|
2024-02-21 04:11:43 +00:00
|
|
|
COPY --from=stagex/linux-headers . /
|
2024-02-21 02:24:03 +00:00
|
|
|
COPY --from=stagex/make . /
|
|
|
|
COPY --from=stagex/musl . /
|
2024-02-21 04:11:43 +00:00
|
|
|
COPY --from=stagex/perl . /
|
2024-02-21 02:24:03 +00:00
|
|
|
COPY --from=stagex/gcc . /
|
2024-02-21 02:41:47 +00:00
|
|
|
# HACK: figure out why gcc package puts these in the wrong path at install time
|
|
|
|
COPY --from=stagex/gcc /usr/lib64/* /usr/lib/
|
2024-02-21 02:24:03 +00:00
|
|
|
RUN tar -xzf ${SRC_FILE}
|
2024-02-21 02:41:47 +00:00
|
|
|
WORKDIR libcap-${VERSION}
|
2024-02-27 03:42:00 +00:00
|
|
|
RUN --network=none ARCH=x86_64 make
|
2024-02-21 02:24:03 +00:00
|
|
|
|
2024-02-21 02:41:47 +00:00
|
|
|
FROM build as install
|
2024-02-21 04:11:43 +00:00
|
|
|
RUN --network=none make DESTDIR=/rootfs install
|
2024-02-21 02:24:03 +00:00
|
|
|
RUN find /rootfs -exec touch -hcd "@0" "{}" +
|
|
|
|
|
2024-02-27 03:42:00 +00:00
|
|
|
FROM scratch as test
|
|
|
|
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-03-09 04:03:35 +00:00
|
|
|
FROM stagex/filesystem as package
|
2024-02-21 02:24:03 +00:00
|
|
|
COPY --from=install /rootfs /
|