mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-18 07:58:36 +00:00
Multistrap requires usrmerge package which was dropped in Ubuntu 24.04 (Noble). Based on details from [0], the rootfs build process was switched to mmdebstrap. Some additional minor tweaks were needed around chrony as the version from Noble has very strict systemd sandboxing configured and it doesn't work with readonly root by default. [0] https://lists.debian.org/debian-dpkg/2023/05/msg00080.html Fixes: #11245 Signed-off-by: Jacek Tomasiak <jtomasiak@arista.com> Signed-off-by: Jacek Tomasiak <jacek.tomasiak@gmail.com>
88 lines
3.0 KiB
Docker
88 lines
3.0 KiB
Docker
# Copyright (c) 2018 Yash Jain, 2022 IBM Corp.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
ARG IMAGE_REGISTRY=docker.io
|
|
FROM ${IMAGE_REGISTRY}/ubuntu:@OS_VERSION@
|
|
@SET_PROXY@
|
|
|
|
ENV GO_HOME="/opt"
|
|
ENV GOCACHE="${GO_HOME}/.cache"
|
|
ENV RUSTUP_HOME="/opt/rustup"
|
|
ENV CARGO_HOME="/opt/cargo"
|
|
ENV PATH="/opt/cargo/bin/:/opt/go/bin:${PATH}"
|
|
|
|
ARG GO_VERSION
|
|
ARG RUST_TOOLCHAIN
|
|
ENV PATH="/opt/go/bin:${PATH}"
|
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
RUN mkdir ${RUSTUP_HOME} ${CARGO_HOME} ${GOCACHE} && \
|
|
chmod -R a+rwX ${RUSTUP_HOME} ${CARGO_HOME} ${GO_HOME}
|
|
|
|
# makedev tries to mknod from postinst
|
|
RUN [ -x /usr/bin/systemd-detect-virt ] || ( echo "echo docker" >/usr/bin/systemd-detect-virt && chmod +x /usr/bin/systemd-detect-virt )
|
|
# hadolint ignore=DL3009,SC2046
|
|
RUN apt-get update && \
|
|
DEBIAN_FRONTEND=noninteractive \
|
|
apt-get --no-install-recommends -y install \
|
|
ca-certificates \
|
|
curl \
|
|
g++ \
|
|
$(gcc_arch="@ARCH@" && [ "$(uname -m)" != "$gcc_arch" ] && ( \
|
|
libc_arch="$gcc_arch" && \
|
|
[ "$gcc_arch" = aarch64 ] && libc_arch=arm64; \
|
|
[ "$gcc_arch" = ppc64le ] && gcc_arch=powerpc64le && libc_arch=ppc64el; \
|
|
[ "$gcc_arch" = s390x ] && gcc_arch=s390x && libc_arch=s390x; \
|
|
[ "$gcc_arch" = x86_64 ] && gcc_arch=x86-64 && libc_arch=amd64; \
|
|
echo "gcc-$gcc_arch-linux-gnu libc6-dev-$libc_arch-cross")) \
|
|
git \
|
|
gnupg2 \
|
|
libclang-dev \
|
|
make \
|
|
makedev \
|
|
mmdebstrap \
|
|
musl \
|
|
musl-dev \
|
|
musl-tools \
|
|
protobuf-compiler \
|
|
xz-utils \
|
|
pip \
|
|
python3-dev \
|
|
libclang-dev \
|
|
zstd && \
|
|
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); \
|
|
goarch=""; \
|
|
kernelname=$(uname -s | tr '[:upper:]' '[:lower:]'); \
|
|
case "${ARCH}" in \
|
|
"aarch64") goarch="arm64" ;; \
|
|
"ppc64le") goarch=${ARCH} ;; \
|
|
"x86_64") goarch="amd64" ;; \
|
|
"s390x") goarch=${ARCH} ;; \
|
|
*) echo "Unsupported architecture: ${ARCH}" && exit 1 ;; \
|
|
esac; \
|
|
curl -OL "https://storage.googleapis.com/golang/go${GO_VERSION}.${kernelname}-${goarch}.tar.gz" && \
|
|
tar -C "${GO_HOME}" -xzf "go${GO_VERSION}.${kernelname}-${goarch}.tar.gz" && \
|
|
rm "go${GO_VERSION}.${kernelname}-${goarch}.tar.gz"
|
|
|
|
# aarch64 requires this name -- link for all
|
|
RUN if [ ! -f "/usr/bin/$(uname -m)-linux-musl-gcc" ]; then ln -s /usr/bin/musl-gcc "/usr/bin/$(uname -m)-linux-musl-gcc"; fi
|
|
|
|
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}"
|
|
|
|
RUN pip install --no-cache-dir pyinstaller==6.9.0 || pip install --no-cache-dir pyinstaller==6.9.0 --break-system-packages
|