From ef12cdcef58caa995bf72a85fa25f93227715065 Mon Sep 17 00:00:00 2001 From: Aode Date: Tue, 28 Jan 2020 11:42:19 -0600 Subject: [PATCH] Add build script for riot --- riot/Dockerfile | 2 +- riot/build.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100755 riot/build.sh diff --git a/riot/Dockerfile b/riot/Dockerfile index 119fab4..b1ece49 100644 --- a/riot/Dockerfile +++ b/riot/Dockerfile @@ -1,4 +1,4 @@ -FROM vectorim/riot-web as builder +FROM vectorim/riot-web:VERSION as builder FROM arm64v8/nginx:1.17.8-alpine diff --git a/riot/build.sh b/riot/build.sh new file mode 100755 index 0000000..1e495ce --- /dev/null +++ b/riot/build.sh @@ -0,0 +1,40 @@ +#!/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" +} + +set -xe + +require "$TAG" tag + +sed "s/VERSION/$TAG/g" Dockerfile > "Dockerfile.$TAG" + +docker build \ + -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"