From 9236a8e0f19adce8107c6ae6ceba53b68b0fd55b Mon Sep 17 00:00:00 2001 From: Matt Critchlow Date: Wed, 6 Nov 2019 10:22:19 -0800 Subject: [PATCH] Create push.sh script for managing image updates The push.sh script supports passing multiple alpine tags which will then be built, tagged, and pushed to docker hub --- push.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 push.sh diff --git a/push.sh b/push.sh new file mode 100755 index 0000000..d379012 --- /dev/null +++ b/push.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env sh + +if [ $# -eq 0 ]; then + echo "No alpine build versions supplied" + echo "example usage: ./push.sh latest 3.10 3.9" + exit 1 +fi + +# Authenticate to push images +docker login + +# build, tag, and push alpine versions supplied as script arguments +base_repo=boky/postfix +for alpine_version in "$@" +do + docker build -t "$base_repo":"$alpine_version" --build-arg=ALPINE_VERSION="$alpine_version" . + docker push "$base_repo":"$alpine_version" +done + +