stagex/packages/tpm2-tss/Containerfile

56 lines
1.5 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=4.1.0
ENV SRC_HASH=4f6c53010b9f422107235d748178daf77817bd2bbe856befa3d54cab9f2f07e4
ENV SRC_FILE=${VERSION}.tar.gz
ENV SRC_SITE=https://github.com/tpm2-software/tpm2-tss/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/json-c . /
RUN tar -xf ${SRC_FILE}
2024-08-26 01:18:52 +00:00
WORKDIR /tpm2-tss-${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 \
--sysconfdir=/etc \
--localstatedir=/var \
--with-tctidefaultmodule=device \
--with-tctidefaultconfig=/dev/tpmrm0 \
--with-crypto=ossl
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/. /