stagex/packages/tpm2-tools/Containerfile

51 lines
1.4 KiB
Text
Raw Normal View History

2024-08-08 07:47:42 +00:00
FROM scratch AS base
2024-05-02 00:12:06 +00:00
ENV VERSION=5.6
ENV SRC_HASH=7169fac7b5afb3ce20091b8d66ee13a69cf0b107ea1e17f5d1aa087d99bcf8e2
ENV SRC_FILE=${VERSION}.tar.gz
ENV SRC_SITE=https://github.com/tpm2-software/tpm2-tools/archive/refs/tags/${SRC_FILE}
2024-08-08 07:47:42 +00:00
FROM base AS fetch
2024-05-02 00:12:06 +00:00
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
2024-08-08 07:47:42 +00:00
FROM fetch AS build
2024-05-02 00:12:06 +00:00
COPY --from=stagex/busybox . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/musl . /
COPY --from=stagex/linux-headers . /
COPY --from=stagex/util-linux . /
COPY --from=stagex/perl . /
COPY --from=stagex/openssl . /
COPY --from=stagex/autoconf . /
COPY --from=stagex/autoconf-archive . /
COPY --from=stagex/automake . /
COPY --from=stagex/libtool . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/m4 . /
COPY --from=stagex/curl . /
COPY --from=stagex/tpm2-tss . /
RUN tar -xf ${SRC_FILE}
2024-08-26 01:18:52 +00:00
WORKDIR /tpm2-tools-${VERSION}
2024-05-02 00:12:06 +00:00
RUN --network=none <<-EOF
set -eux
printf "${VERSION}" > VERSION
cat bootstrap | grep -ve ^git > bootstrap-nogit
sh bootstrap-nogit
./configure \
--build=x86_64-unknown-linux-musl \
--host=x86_64-unknown-linux-musl \
--prefix=/usr
make -j "$(nproc)"
EOF
2024-08-08 07:47:42 +00:00
FROM build AS install
2024-05-02 00:12:06 +00:00
RUN --network=none <<-EOF
set -eux
make DESTDIR=/rootfs install
rm -rf /rootfs/var/run
EOF
2024-08-08 07:47:42 +00:00
FROM stagex/filesystem AS package
2024-05-02 00:12:06 +00:00
COPY --from=install /rootfs/. /