intel-device-plugins-for-ku.../build/docker/build-image.sh
Mikko Ylinen aee9dd20f8 images: force buildah to use runc
buildah 1.19.4 and its dependencies when installed from the
libcontainers OBS repo, defaulted to crun and that made the
image builds to fail.

By forcing buildah to use runc instead, everything works OK.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-02-26 11:48:59 +02:00

40 lines
941 B
Bash
Executable File

#!/bin/sh -e
IMG=$1
DOCKERFILE="$(dirname $0)/$(basename ${IMG}).Dockerfile"
if [ -z "$IMG" ]; then
(>&2 echo "Usage: $0 <Dockerfile>")
exit 1
fi
if [ ! -e "${DOCKERFILE}" ]; then
(>&2 echo "File ${DOCKERFILE} doesn't exist")
exit 1
fi
shift
if [ "$1" = 'docker' -o "$1" = 'buildah' ]; then
BUILDER=$1
shift
fi
TAG=${TAG:-devel}
BUILD_ARGS=$@
if [ -d $(dirname $0)/../../vendor ] ; then
echo "Building images with vendored code"
BUILD_ARGS="${BUILD_ARGS} --build-arg DIR=/go/src/github.com/intel/intel-device-plugins-for-kubernetes --build-arg GO111MODULE=off"
fi
if [ -z "${BUILDER}" -o "${BUILDER}" = 'docker' ] ; then
docker build --pull -t ${IMG}:${TAG} ${BUILD_ARGS} -f ${DOCKERFILE} .
elif [ "${BUILDER}" = 'buildah' ] ; then
BUILDAH_RUNTIME=runc buildah bud --pull-always -t ${IMG}:${TAG} ${BUILD_ARGS} -f ${DOCKERFILE} .
else
(>&2 echo "Unknown builder ${BUILDER}")
exit 1
fi