ungleich-containers/build-version-via-dockerfile.sh

29 lines
431 B
Bash
Raw Normal View History

2024-10-05 05:44:42 +00:00
#!/bin/sh
set -exu
if [ $# -lt 1 ]; then
echo "$0 <container> [push]" >&2
exit 1
fi
container=$1; shift
name=harbor.k8s.ungleich.ch/ungleich-public/${container}
push=""
if [ $# -ge 1 ]; then
push=yes
fi
cd $container
for df in Dockerfile_*; do
version=$(echo $df | cut -d_ -f 2)
tag=${name}:${version}
docker build -t ${tag} -f ${df} .
if [ "$push" ]; then
docker push ${tag}
fi
done