stagex/packages/swtpm/Containerfile

61 lines
1.6 KiB
Text
Raw Normal View History

2024-09-06 22:09:10 +00:00
FROM scratch AS base
ARG ARCH=x86_64
ENV VERSION=0.9.0
ENV SRC_HASH=9679ca171e8aaa3c4e4053e8bc1d10c8dabf0220bd4b16aba78743511c25f731
ENV SRC_FILE=v${VERSION}.tar.gz
ENV SRC_SITE=https://github.com/stefanberger/swtpm/archive/${SRC_FILE}
FROM base AS fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch AS build
COPY --from=stagex/busybox . /
COPY --from=stagex/binutils . /
COPY --from=stagex/musl . /
COPY --from=stagex/make . /
COPY --from=stagex/gcc . /
COPY --from=stagex/m4 . /
COPY --from=stagex/perl . /
COPY --from=stagex/autoconf . /
COPY --from=stagex/automake . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/libtool . /
COPY --from=stagex/openssl . /
COPY --from=stagex/libtasn1 . /
COPY --from=stagex/libtpms . /
COPY --from=stagex/libffi . /
COPY --from=stagex/zlib . /
COPY --from=stagex/pcre2 . /
COPY --from=stagex/gmp . /
COPY --from=stagex/glib . /
COPY --from=stagex/json-glib . /
COPY --from=stagex/bash . /
COPY --from=stagex/expect . /
COPY --from=stagex/gettext . /
COPY --from=stagex/gawk . /
COPY --from=stagex/socat . /
COPY --from=stagex/python . /
COPY --from=stagex/libseccomp . /
COPY --from=stagex/linux-headers . /
RUN tar -xf ${SRC_FILE}
WORKDIR /swtpm-${VERSION}
RUN --network=none <<-EOF
set -ex
NOCONFIGURE=1 ./autogen.sh
./configure \
--build=${ARCH}-linux-musl \
--host=${ARCH}-linux-musl \
--prefix=/usr \
--libdir=/usr/lib \
--with-openssl \
--with-tss-user=root \
--with-tss-group=root
make -j "$(nproc)"
EOF
FROM build AS install
RUN --network=none make DESTDIR="/rootfs" install
FROM stagex/filesystem AS package
COPY --from=install /rootfs/. /