intel-device-plugins-for-ku.../build/docker/build-image.sh
Mikko Ylinen d06f98690f images: tag with intel prefix
In preparations to get some of the images to hub.docker.com/intel,
start using intel/ prefix.

Moreover, set the Makefile variables so that the images built
by make [images|demos] can easily be pushed to any registry/org
by 'docker push' (e.g., by Jenkins).

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2019-08-29 13:21:19 +03:00

31 lines
696 B
Bash
Executable File

#!/bin/sh -e
IMG=$1
BUILDER=$2
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
TAG=${TAG:-devel}
SRCREV=$(git rev-parse HEAD)
if [ -z "${BUILDER}" -o "${BUILDER}" = 'docker' ] ; then
docker build --pull -t ${IMG}:${TAG} -f ${DOCKERFILE} .
docker tag ${IMG}:${TAG} ${IMG}:${SRCREV}
elif [ "${BUILDER}" = 'buildah' ] ; then
buildah bud --pull-always -t ${IMG}:${TAG} -f ${DOCKERFILE} .
buildah tag ${IMG}:${TAG} ${IMG}:${SRCREV}
else
(>&2 echo "Unknown builder ${BUILDER}")
exit 1
fi