mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-28 16:27:50 +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"))
|
script_dir=$(dirname $(readlink -f "$0"))
|
||||||
docker_image="cloud-hypervisor-builder"
|
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
|
if test -t 1; then
|
||||||
USE_TTY="-ti"
|
USE_TTY="-ti"
|
||||||
@ -20,7 +26,7 @@ else
|
|||||||
echo "INFO: not tty build"
|
echo "INFO: not tty build"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo docker run \
|
sudo "${DOCKER_CLI}" run \
|
||||||
--rm \
|
--rm \
|
||||||
-v "$(pwd):/$(pwd)" \
|
-v "$(pwd):/$(pwd)" \
|
||||||
-w "$(pwd)" \
|
-w "$(pwd)" \
|
||||||
|
@ -13,6 +13,12 @@ script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||||||
source "${script_dir}/../../scripts/lib.sh"
|
source "${script_dir}/../../scripts/lib.sh"
|
||||||
source "${script_dir}/../qemu.blacklist"
|
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:-}"
|
kata_version="${kata_version:-}"
|
||||||
packaging_dir="${script_dir}/../.."
|
packaging_dir="${script_dir}/../.."
|
||||||
qemu_virtiofs_repo=$(get_from_kata_deps "assets.hypervisor.qemu-experimental.url" "${kata_version}")
|
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:-}"
|
https_proxy="${https_proxy:-}"
|
||||||
prefix="${prefix:-"/opt/kata"}"
|
prefix="${prefix:-"/opt/kata"}"
|
||||||
|
|
||||||
sudo docker build \
|
sudo "${DOCKER_CLI}" build \
|
||||||
--no-cache \
|
--no-cache \
|
||||||
--build-arg http_proxy="${http_proxy}" \
|
--build-arg http_proxy="${http_proxy}" \
|
||||||
--build-arg https_proxy="${https_proxy}" \
|
--build-arg https_proxy="${https_proxy}" \
|
||||||
@ -39,7 +45,7 @@ sudo docker build \
|
|||||||
-f "${script_dir}/Dockerfile" \
|
-f "${script_dir}/Dockerfile" \
|
||||||
-t qemu-virtiofs-static
|
-t qemu-virtiofs-static
|
||||||
|
|
||||||
sudo docker run \
|
sudo "${DOCKER_CLI}" run \
|
||||||
-i \
|
-i \
|
||||||
-v "${PWD}":/share qemu-virtiofs-static \
|
-v "${PWD}":/share qemu-virtiofs-static \
|
||||||
mv "/tmp/qemu-virtiofs-static/${qemu_virtiofs_tar}" /share/
|
mv "/tmp/qemu-virtiofs-static/${qemu_virtiofs_tar}" /share/
|
||||||
|
Loading…
Reference in New Issue
Block a user