ci: install swtpm in Docker container

Add steps to build and install swtpm and its dependencies in
ci docker container.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
This commit is contained in:
Praveen K Paladugu 2023-01-12 19:33:02 +00:00 committed by Bo Chen
parent ec45daac19
commit a4ef6e57a7
2 changed files with 24 additions and 2 deletions

View File

@ -58,7 +58,10 @@ RUN update-alternatives --set ovs-vswitchd /usr/lib/openvswitch-switch-dpdk/ovs-
RUN if [ "$TARGETARCH" = "amd64" ]; then \ RUN if [ "$TARGETARCH" = "amd64" ]; then \
apt-get update \ apt-get update \
&& apt-get -yq upgrade \ && apt-get -yq upgrade \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq gcc-multilib \ && DEBIAN_FRONTEND=noninteractive apt-get install -yq gcc-multilib gawk \
libtool expect gnutls-dev gnutls-bin libfuse-dev \
libjson-glib-dev libgmp-dev libtasn1-dev python3-twisted \
net-tools softhsm2 \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/*; fi && rm -rf /var/lib/apt/lists/*; fi
@ -125,6 +128,25 @@ RUN if [ "$TARGETARCH" = "amd64" ]; then \
&& cp -r ./scripts/rpc /usr/local/bin/spdk-nvme \ && cp -r ./scripts/rpc /usr/local/bin/spdk-nvme \
&& cd .. && rm -rf spdk; fi && cd .. && rm -rf spdk; fi
# install swtpm only for x86_64 arch
RUN if [ "$TARGETARCH" = "amd64" ]; then \
git clone https://github.com/stefanberger/libtpms libtpms_build \
&& cd libtpms_build \
&& git checkout v0.8.8 \
&& ./autogen.sh \
&& make \
&& make install \
&& cd .. \
&& git clone https://github.com/stefanberger/swtpm swtpm_build \
&& cd swtpm_build \
&& git checkout v0.8.0 \
&& ./autogen.sh \
&& make \
&& make install \
&& cd .. \
&& ldconfig \
&& rm -rf swtpm_build libtpms_build; fi
# install ethr tool for performance tests # install ethr tool for performance tests
RUN if [ "$TARGETARCH" = "amd64" ]; then \ RUN if [ "$TARGETARCH" = "amd64" ]; then \
wget https://github.com/microsoft/ethr/releases/latest/download/ethr_linux.zip \ wget https://github.com/microsoft/ethr/releases/latest/download/ethr_linux.zip \

View File

@ -7,7 +7,7 @@
CLI_NAME="Cloud Hypervisor" CLI_NAME="Cloud Hypervisor"
CTR_IMAGE_TAG="cloudhypervisor/dev" CTR_IMAGE_TAG="cloudhypervisor/dev"
CTR_IMAGE_VERSION="20230116-0" CTR_IMAGE_VERSION="20230123-0"
CTR_IMAGE="${CTR_IMAGE_TAG}:${CTR_IMAGE_VERSION}" CTR_IMAGE="${CTR_IMAGE_TAG}:${CTR_IMAGE_VERSION}"
DOCKER_RUNTIME="docker" DOCKER_RUNTIME="docker"