Files
mailu/build.sh
2021-04-26 20:23:45 +02:00

27 lines
543 B
Bash
Executable File

#!/bin/bash -e
TAG="1.5-$(date +%Y%m%d)"
build() {
image=$1
echo "[INFO] Building ${image}"
docker build -t ${image} .
docker push ${image}
}
if [ -z "$1" ]; then
find . -name Dockerfile | while read i; do
dir=$(dirname $i)
pushd ${dir} >/dev/null
image="genunix/mailu-$(basename $dir):${TAG}"
build ${image}
popd >/dev/null
done
else
dir=$(basename $1)
image="genunix/mailu-$(basename $dir):${TAG}"
pushd "$1" >/dev/null
build "$image"
popd >/dev/null
fi