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
This commit is contained in:
Matt Critchlow 2019-11-06 10:22:19 -08:00
parent 93c100c031
commit 9236a8e0f1
No known key found for this signature in database
GPG key ID: 5B86D84AB60CAB15

20
push.sh Executable file
View file

@ -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