Files
kata-containers/tools/packaging/static-build/cloud-hypervisor/docker-build/build.sh
Jose Carlos Venegas Munoz 39b53f4467 clh: enable build using Podman
[ Port from packaging commit 4e1b5729f47d5f67902e1344521bc5b121673046 ]

Build clh with Podman, allow build the vmm in the Podman CI

Virtiofs qemu has to be build as this is requried by clh.

Fixes: #461

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-08-20 14:00:31 -07:00

37 lines
628 B
Bash
Executable File

#!/bin/bash
#
# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
set -o errexit
set -o nounset
set -o pipefail
script_dir=$(dirname $(readlink -f "$0"))
docker_image="cloud-hypervisor-builder"
DOCKER_CLI="docker"
if ! command -v docker && command -v podman; then
DOCKER_CLI="podman"
fi
sudo "${DOCKER_CLI}" build -t "${docker_image}" "${script_dir}"
if test -t 1; then
USE_TTY="-ti"
else
USE_TTY=""
echo "INFO: not tty build"
fi
sudo "${DOCKER_CLI}" run \
--rm \
-v "$(pwd):/$(pwd)" \
-w "$(pwd)" \
--env "CARGO_HOME=$(pwd)" \
${USE_TTY} \
"${docker_image}" \
cargo build --release