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>
This commit is contained in:
Jose Carlos Venegas Munoz 2020-08-06 15:37:32 +00:00 committed by Bo Chen
parent 04b156f604
commit 39b53f4467
2 changed files with 17 additions and 5 deletions

View File

@ -11,7 +11,13 @@ set -o pipefail
script_dir=$(dirname $(readlink -f "$0"))
docker_image="cloud-hypervisor-builder"
sudo docker build -t "${docker_image}" "${script_dir}"
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"
@ -20,7 +26,7 @@ else
echo "INFO: not tty build"
fi
sudo docker run \
sudo "${DOCKER_CLI}" run \
--rm \
-v "$(pwd):/$(pwd)" \
-w "$(pwd)" \

View File

@ -13,6 +13,12 @@ script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${script_dir}/../../scripts/lib.sh"
source "${script_dir}/../qemu.blacklist"
DOCKER_CLI="docker"
if ! command -v docker &>/dev/null && command -v podman &>/dev/null; then
DOCKER_CLI="podman"
fi
kata_version="${kata_version:-}"
packaging_dir="${script_dir}/../.."
qemu_virtiofs_repo=$(get_from_kata_deps "assets.hypervisor.qemu-experimental.url" "${kata_version}")
@ -27,7 +33,7 @@ http_proxy="${http_proxy:-}"
https_proxy="${https_proxy:-}"
prefix="${prefix:-"/opt/kata"}"
sudo docker build \
sudo "${DOCKER_CLI}" build \
--no-cache \
--build-arg http_proxy="${http_proxy}" \
--build-arg https_proxy="${https_proxy}" \
@ -39,7 +45,7 @@ sudo docker build \
-f "${script_dir}/Dockerfile" \
-t qemu-virtiofs-static
sudo docker run \
sudo "${DOCKER_CLI}" run \
-i \
-v "${PWD}":/share qemu-virtiofs-static \
mv "/tmp/qemu-virtiofs-static/${qemu_virtiofs_tar}" /share/