mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-28 08:17:37 +00:00
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:
parent
04b156f604
commit
39b53f4467
@ -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)" \
|
||||
|
@ -13,11 +13,17 @@ 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}")
|
||||
# This tag will be supported on the runtime versions.yaml
|
||||
qemu_virtiofs_tag=$(get_from_kata_deps "assets.hypervisor.qemu-experimental.tag" "${kata_version}")
|
||||
qemu_virtiofs_tag=$(get_from_kata_deps "assets.hypervisor.qemu-experimental.tag" "${kata_version}")
|
||||
qemu_virtiofs_tar="kata-static-qemu-virtiofsd.tar.gz"
|
||||
qemu_tmp_tar="kata-static-qemu-virtiofsd-tmp.tar.gz"
|
||||
|
||||
@ -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/
|
||||
|
Loading…
Reference in New Issue
Block a user