1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-11-17 22:01:49 -05:00
aprsd/docker/build.sh
Hemna 23e3876e7b Refactor utils usage
This patch separates out the config from the utils.py
utils.py has grown into a catchall for everything and this
patch is the start of that cleanup.
2021-09-16 17:08:30 -04:00

65 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# Official docker image build script.
usage() {
cat << EOF
usage: $0 options
OPTIONS:
-t The tag/version (${TAG}) (default = master)
-d Use Dockerfile-dev for a git clone build
EOF
}
ALL_PLATFORMS=0
DEV=0
TAG="master"
while getopts “t:da” OPTION
do
case $OPTION in
t)
TAG=$OPTARG
;;
a)
ALL_PLATFORMS=1
;;
d)
DEV=1
;;
?)
usage
exit
;;
esac
done
VERSION="2.3.1"
if [ $ALL_PLATFORMS -eq 1 ]
then
PLATFORMS="linux/arm/v7,linux/arm/v6,linux/arm64,linux/amd64"
else
PLATFORMS="linux/amd64"
fi
if [ $DEV -eq 1 ]
then
# Use this script to locally build the docker image
docker buildx build --push --platform $PLATFORMS \
-t harbor.hemna.com/hemna6969/aprsd:$TAG \
-f Dockerfile-dev --no-cache .
else
# Use this script to locally build the docker image
docker buildx build --push --platform $PLATFORMS \
-t hemna6969/aprsd:$VERSION \
-t hemna6969/aprsd:latest \
-t harbor.hemna.com/hemna6969/aprsd:latest \
-t harbor.hemna.com/hemna6969/aprsd:$VERSION \
-f Dockerfile .
fi