1
0
mirror of https://github.com/projectacrn/acrn-hypervisor.git synced 2025-05-01 13:14:02 +00:00
acrn-hypervisor/debian/docker/acrn-docker-build.sh
Helmut Buchsbaum 46d302b94c debian: Preinstall build requirements in docker helper
Tracked-On: 
Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
2022-05-10 09:20:14 +08:00

54 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# Helper script to build ACRN with docker
# This also includes building packages required for ACRN build or runtime
VENDOR=${VENDOR:-debian}
DISTRO=${DISTRO:-stable}
TOPDIR=$(git rev-parse --show-toplevel)
DOCKER=$(which docker)
if [ -z "${TOPDIR}" ]; then
echo "Run $0 from inside git repository!"
exit 1
fi
if [ -z "${DOCKER}" ]; then
echo "Cannot find docker binary, please install!"
exit 1
fi
pushd ${TOPDIR} >/dev/null
if [ ! -f debian/docker/Dockerfile ]; then
echo "No Dockerfile available!"
exit 1
fi
set -e
# create docker image for Debian package build
cp debian/control debian/docker/debian-control-${VENDOR}-${DISTRO}
${DOCKER} build \
-f debian/docker/Dockerfile \
--build-arg DISTRO=${DISTRO} \
--build-arg VENDOR=${VENDOR} \
-t acrn-pkg-builder:${DISTRO} debian/docker
rm debian/docker/debian-control-${VENDOR}-${DISTRO}
# build ACRN packages
${DOCKER} run \
--rm \
-e UID=$(id -u) \
-e GID=$(id -g) \
-v $(pwd):/source --entrypoint /usr/local/bin/debian-pkg-build.sh acrn-pkg-builder:${DISTRO} -F --no-sign --git-export-dir=build/${DISTRO} "$@"
# create local apt repository
${DOCKER} run \
--rm \
-e UID=$(id -u) \
-e GID=$(id -g) \
-v $(pwd):/source --entrypoint create-apt-repo.sh acrn-pkg-builder:${DISTRO} build/${DISTRO}
popd >/dev/null