packaging: Update guest-components Dockerfile

- Switch to Ubuntu 20.04 for building guest-components as
The rootfs is based on 20.04, so we need matching GLIBC versions.
See #8955
- Add dependencies needed by TDX verifier as we want to build for all platforms

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
This commit is contained in:
stevenhorsman
2024-03-15 17:19:33 +00:00
parent 6d85025e59
commit 101a5bf273

View File

@@ -2,27 +2,40 @@
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
FROM ubuntu:22.04 FROM ubuntu:20.04
ARG RUST_TOOLCHAIN ARG RUST_TOOLCHAIN
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-o", "pipefail", "-c"] SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update && \
apt-get --no-install-recommends install -y \
ca-certificates \
curl \
gnupg && \
apt-get clean && rm -rf /var/lib/apt/lists/
RUN if [ "$(uname -m)" == "x86_64" ]; then curl -sL https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | gpg --dearmor --output /usr/share/keyrings/intel-sgx.gpg && \
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/intel-sgx.gpg] https://download.01.org/intel-sgx/sgx_repo/ubuntu jammy main' | tee /etc/apt/sources.list.d/intel-sgx.list && \
apt-get update && \
apt-get --no-install-recommends -y install libtdx-attest-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/; fi
RUN apt-get update && \ RUN apt-get update && \
apt-get --no-install-recommends -y install \ apt-get --no-install-recommends -y install \
binutils \ binutils \
ca-certificates \
clang \ clang \
curl \
g++ \ g++ \
gcc \ gcc \
git \ git \
gnupg \
libssl-dev \ libssl-dev \
libtss2-dev \
make \ make \
musl-tools \ musl-tools \
openssl \ openssl \
perl \ perl \
pkg-config \
protobuf-compiler && \ protobuf-compiler && \
apt-get clean && rm -rf /var/lib/apt/lists/ && \ apt-get clean && rm -rf /var/lib/apt/lists/ && \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${RUST_TOOLCHAIN} curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${RUST_TOOLCHAIN}
# aarch64 requires this name -- link for all
RUN ln -s /usr/bin/musl-gcc "/usr/bin/$(uname -m)-linux-musl-gcc"