stagex/packages/tpm2-tss/Containerfile

56 lines
1.5 KiB
Text
Raw Normal View History

2024-05-02 00:12:06 +00:00
FROM scratch as base
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}
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch as build
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}
WORKDIR tpm2-tss-${VERSION}
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
FROM build as install
RUN --network=none <<-EOF
set -eux
make DESTDIR=/rootfs install
rm -rf /rootfs/var/run
EOF
FROM stagex/filesystem as package
COPY --from=install /rootfs/. /