mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-21 20:08:54 +00:00
- Enable the kata-cc-rustls-tls feature in image-rs, so that it can get resources from the KBS in order to retrieve the registry credentials. - Also bump to the latest image-rs to pick up protobuf fixes - Add libprotobuf-dev dependency to the agent packaging as it is needed by the new image-rs feature - Add extra env in the agent make test as the new version of the anyhow crate has changed the backtrace capture thus unit tests of kata-agent that compares a raised error with an expected one would fail. To fix this, we need only panics to have backtraces, thus set RUST_BACKTRACE=0 for tests due to document https://docs.rs/anyhow/latest/anyhow/ Fixes #9538 Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com> Signed-off-by: stevenhorsman <steven@uk.ibm.com>
57 lines
1.5 KiB
Docker
57 lines
1.5 KiB
Docker
# Copyright (c) 2023 Intel
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
FROM ubuntu:20.04
|
|
ARG RUST_TOOLCHAIN
|
|
|
|
COPY install_libseccomp.sh /usr/bin/install_libseccomp.sh
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
ENV RUSTUP_HOME="/opt/rustup"
|
|
ENV CARGO_HOME="/opt/cargo"
|
|
ENV PATH="/opt/cargo/bin/:${PATH}"
|
|
ENV OPT_LIB="/opt/lib"
|
|
|
|
ENV LIBSECCOMP_LINK_TYPE=static
|
|
ENV LIBSECCOMP_LIB_PATH=${OPT_LIB}
|
|
|
|
ENV PKG_CONFIG_PATH=${OPT_LIB}/pkgconfig:$PKG_CONFIG_PATH
|
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
RUN mkdir ${RUSTUP_HOME} ${CARGO_HOME} && chmod -R a+rwX /opt
|
|
|
|
RUN apt-get update && \
|
|
apt-get --no-install-recommends -y install \
|
|
ca-certificates \
|
|
clang \
|
|
curl \
|
|
g++ \
|
|
gcc \
|
|
libprotobuf-dev \
|
|
libssl-dev \
|
|
make \
|
|
musl-tools \
|
|
openssl \
|
|
perl \
|
|
protobuf-compiler && \
|
|
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}
|
|
|
|
RUN ARCH=$(uname -m); \
|
|
rust_arch=""; \
|
|
libc=""; \
|
|
case "${ARCH}" in \
|
|
"aarch64") rust_arch="${ARCH}"; libc="musl" ;; \
|
|
"ppc64le") rust_arch="powerpc64le"; libc="gnu" ;; \
|
|
"x86_64") rust_arch="${ARCH}"; libc="musl" ;; \
|
|
"s390x") rust_arch="${ARCH}"; libc="gnu" ;; \
|
|
*) echo "Unsupported architecture: ${ARCH}" && exit 1 ;; \
|
|
esac; \
|
|
rustup target add "${rust_arch}-unknown-linux-${libc}"
|
|
|
|
# aarch64 requires this name -- link for all
|
|
RUN ln -s /usr/bin/musl-gcc "/usr/bin/$(uname -m)-linux-musl-gcc"
|