photoprism/scripts/docker-build.sh
Michael Mayer 9d887ca5d2 CI: Update Drone config and Makefile for new release branch
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-12-26 17:02:15 +01:00

15 lines
586 B
Bash
Executable file

#!/usr/bin/env bash
if [[ -z $1 ]] && [[ -z $2 ]]; then
echo "Please provide a container image name and version" 1>&2
exit 1
elif [[ $1 ]] && [[ -z $2 ]]; then
DOCKER_TAG=$(date -u +%Y%m%d)
echo "Building 'photoprism/$1:preview'...";
docker build --no-cache --build-arg BUILD_TAG="${DOCKER_TAG}" -t photoprism/$1:preview -f docker/${1/-//}/Dockerfile .
echo "Done"
else
echo "Building 'photoprism/$1:$2'...";
docker build --no-cache --build-arg BUILD_TAG=$2 -t photoprism/$1:latest -t photoprism/$1:$2 -f docker/${1/-//}/Dockerfile .
echo "Done"
fi