docker/riot/build.sh

43 lines
718 B
Bash
Raw Normal View History

2020-01-28 17:42:19 +00:00
#!/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:"
2020-02-17 20:11:35 +00:00
echo " tag: The tag of the riot-web image the target image is based on"
2020-01-28 17:42:19 +00:00
}
require "$TAG" tag
2020-01-28 17:52:45 +00:00
set -xe
2020-01-28 17:42:19 +00:00
sed "s/VERSION/$TAG/g" Dockerfile > "Dockerfile.$TAG"
docker build \
2020-01-28 17:52:45 +00:00
--pull \
--no-cache \
2020-01-28 17:42:19 +00:00
-f "Dockerfile.$TAG" \
-t "asonix/riot-web:$TAG-arm64v8" \
-t asonix/riot-web:latest-arm64v8 \
-t asonix/riot-web:latest \
2020-01-28 17:52:45 +00:00
.
2020-01-28 17:42:19 +00:00
docker push "asonix/riot-web:$TAG-arm64v8"
docker push asonix/riot-web:latest-arm64v8
docker push asonix/riot-web:latest
rm "Dockerfile.$TAG"