mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-02 00:02:01 +00:00
Use `multistrap` for building Ubuntu rootfs. Adds support for building for foreign architectures using the `ARCH` environment variable. In the process, the Ubuntu rootfs workflow is vastly simplified. Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
30 lines
919 B
Docker
30 lines
919 B
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@
|
|
|
|
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" = x86_64 ] && gcc_arch=x86-64 && libc_arch=amd64; \
|
|
echo "gcc-$gcc_arch-linux-gnu libc6-dev-$libc_arch-cross")) \
|
|
git \
|
|
make \
|
|
multistrap \
|
|
musl-tools \
|
|
protobuf-compiler
|
|
# aarch64 requires this name -- link for all
|
|
RUN ln -s /usr/bin/musl-gcc "/usr/bin/$(uname -m)-linux-musl-gcc"
|
|
|
|
@INSTALL_RUST@
|