ubuntu/debian: create aarch64-specific Dockerfile.in

The musl package in ubuntu/debian could not provide everything we need
on aarch64.
e.g. we need `aarch64-linux-musl-gcc` as linker, and it's not provided
in package.

Fixes: #411

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
This commit is contained in:
Penny Zheng 2020-02-20 10:57:15 +08:00
parent 9cba8c4c27
commit 41aaa36e6f
3 changed files with 83 additions and 2 deletions

View File

@ -0,0 +1,35 @@
#
# Copyright (c) 2020 ARM Limited
#
# SPDX-License-Identifier: Apache-2.0
# NOTE: OS_VERSION is set according to config.sh
from docker.io/debian:@OS_VERSION@
# RUN commands
RUN apt-get update && apt-get install -y \
autoconf \
automake \
binutils \
build-essential \
chrony \
cmake \
coreutils \
curl \
debianutils \
debootstrap \
g++ \
gcc \
git \
libc-dev \
libstdc++-6-dev \
m4 \
make \
sed \
systemd \
tar \
vim
# This will install the proper golang to build Kata components
@INSTALL_GO@
@INSTALL_MUSL@
@INSTALL_RUST@

View File

@ -0,0 +1,39 @@
#
# Copyright (c) 2020 ARM Limited
#
# SPDX-License-Identifier: Apache-2.0
#ubuntu: docker image to be used to create a rootfs
#@OS_VERSION@: Docker image version to build this dockerfile
from docker.io/ubuntu:@OS_VERSION@
# This dockerfile needs to provide all the componets need to build a rootfs
# Install any package need to create a rootfs (package manager, extra tools)
# RUN commands
RUN apt-get update && apt-get install -y \
autoconf \
automake \
binutils \
build-essential \
chrony \
cmake \
coreutils \
curl \
debianutils \
debootstrap \
g++ \
gcc \
git \
libc6-dev \
libstdc++-8-dev \
m4 \
make \
sed \
systemd \
tar \
vim
# This will install the proper golang to build Kata components
@INSTALL_GO@
@INSTALL_MUSL@
@INSTALL_RUST@

View File

@ -274,7 +274,6 @@ generate_dockerfile()
curlOptions=("-OL") curlOptions=("-OL")
[ -n "${http_proxy:-}" ] && curlOptions+=("-x ${http_proxy:-}") [ -n "${http_proxy:-}" ] && curlOptions+=("-x ${http_proxy:-}")
readonly dockerfile_template="Dockerfile.in"
readonly install_go=" readonly install_go="
RUN cd /tmp ; curl ${curlOptions[@]} https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${goarch}.tar.gz RUN cd /tmp ; curl ${curlOptions[@]} https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${goarch}.tar.gz
RUN tar -C /usr/ -xzf /tmp/go${GO_VERSION}.linux-${goarch}.tar.gz RUN tar -C /usr/ -xzf /tmp/go${GO_VERSION}.linux-${goarch}.tar.gz
@ -344,7 +343,15 @@ RUN ln -sf /usr/bin/g++ /bin/musl-g++
# rust agent still need go to build # rust agent still need go to build
# because grpc-sys need go to build # because grpc-sys need go to build
pushd ${dir} pushd ${dir}
[ -f "${dockerfile_template}" ] || die "${dockerfile_template}: file not found" dockerfile_template="Dockerfile.in"
dockerfile_arch_template="Dockerfile-${architecture}.in"
# if arch-specific docker file exists, swap the univesal one with it.
if [ -f "${dockerfile_arch_template}" ]; then
dockerfile_template="${dockerfile_arch_template}"
else
[ -f "${dockerfile_template}" ] || die "${dockerfile_template}: file not found"
fi
# powerpc have no musl target, don't setup rust enviroment # powerpc have no musl target, don't setup rust enviroment
# since we cannot static link agent. Besides, there is # since we cannot static link agent. Besides, there is
# also long double representation problem when building musl-libc # also long double representation problem when building musl-libc