#!/usr/bin//env bash TAG=$1 function require() { if [ "$1" = "" ]; then echo "input '$2' required" print_help exit 1 fi } function print_help() { echo "build.sh" echo "" echo "Usage:" echo " build.sh [tag]" echo "" echo "Args:" echo " tag: The tag of the riot-web image the target image is based on" } require "$TAG" tag set -xe sed "s/VERSION/$TAG/g" Dockerfile > "Dockerfile.$TAG" docker build \ --pull \ --no-cache \ -f "Dockerfile.$TAG" \ -t "asonix/riot-web:$TAG-arm64v8" \ -t asonix/riot-web:latest-arm64v8 \ -t asonix/riot-web:latest \ . docker push "asonix/riot-web:$TAG-arm64v8" docker push asonix/riot-web:latest-arm64v8 docker push asonix/riot-web:latest rm "Dockerfile.$TAG"