ARCH=linux/arm/v6 #ARCH=linux/amd64 TAG=develop HELP="USAGE: sh build_docker.sh \n [ -a | --architecture ] Select a architecture. Default is auto\n [ -t | --tag ] Set a docker tag. Default is develop \n [ -h | --help ] Get this dialog" docker_build(){ docker build --build-arg TARGETPLATFORM=$ARCH --platform $ARCH --tag dasmoorhuhn/atc-mithermometer-gateway:$TAG . } while [ "$1" != "" ]; do case $1 in -a | --architecture ) shift ARCH=$1 shift ;; -t | --tag ) shift TAG=$1 shift ;; -h | --help ) echo $HELP exit ;; * ) echo $HELP exit 1 esac done docker_build