mirror of
https://github.com/bokysan/docker-postfix.git
synced 2025-09-07 23:14:39 +08:00
Support alpine versions (#20)
* Support multiple alpine versions in Dockerfile Add an ARG to the Dockerfile to support passing in build-args when running docker build to support different alpine base image versions. * 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:
parent
0f4bd837d0
commit
0feeccbfc3
2 changed files with 22 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
FROM alpine:latest
|
||||
ARG ALPINE_VERSION=latest
|
||||
FROM alpine:${ALPINE_VERSION}
|
||||
LABEL maintaner="Bojan Cekrlic - https://github.com/bokysan/docker-postfix/"
|
||||
|
||||
# See README.md for details
|
||||
|
|
20
push.sh
Executable file
20
push.sh
Executable 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
|
||||
|
||||
|
Loading…
Add table
Reference in a new issue