mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00

Added alternative builder for project images: buildah https://github.com/containers/buildah Considering that some of our plugins use CRI-O runtime it could be a good idea to get rid of docker as a builder. It should allow us not to run docker daemon at all, even for build purposes. Kubernetes also goes this way encouraging users to switch to CRI runtimes (CRI-O and containerd), so having non-docker builds supported looks good from this perspective too.
29 lines
581 B
Bash
Executable File
29 lines
581 B
Bash
Executable File
#!/bin/sh -e
|
|
|
|
IMG=$1
|
|
BUILDER=$2
|
|
|
|
if [ -z "$IMG" ]; then
|
|
(>&2 echo "Usage: $0 <image directory>")
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -d "$IMG" ]; then
|
|
(>&2 echo "Directory $IMG doesn't exist")
|
|
exit 1
|
|
fi
|
|
|
|
CWD=`dirname $0`
|
|
TAG=`git rev-parse HEAD`
|
|
|
|
if [ -z "$BUILDER" -o "$BUILDER" = 'docker' ] ; then
|
|
docker build --rm -t ${IMG}:${TAG} "$CWD/$IMG/"
|
|
docker tag ${IMG}:${TAG} ${IMG}:devel
|
|
elif [ "$BUILDER" = 'buildah' ] ; then
|
|
buildah bud -t ${IMG}:${TAG} "$CWD/$IMG/"
|
|
buildah tag ${IMG}:${TAG} ${IMG}:devel
|
|
else
|
|
(>&2 echo "Unknown builder $BUILDER")
|
|
exit 1
|
|
fi
|