1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-14 04:11:48 -05:00
sdrangel/swagger/docker/server/build.sh

44 lines
921 B
Bash
Raw Normal View History

#!/bin/sh
OPTIND=1 # Reset in case getopts has been used previously in the shell.
# Get options:
show_help() {
cat << EOF
Usage: ${0##*/} [-b name] [-c label] [-t version] [-h]
Build SDRangel image.
-t tag Docker image tag version (default latest)
-f file Specify a Dockerfile (default is Dockerfile in current directory i.e. '.')
-h Print this help.
EOF
}
image_name="sdrangel/swagger/server"
image_tag="latest"
2023-03-18 07:48:21 -04:00
uid=1000
docker_file="."
while getopts "h?t:f:" opt; do
case "$opt" in
h|\?)
show_help
exit 0
;;
t) image_tag=${OPTARG}
;;
f) docker_file="-f ${OPTARG} ."
;;
esac
done
shift $((OPTIND-1))
[ "${1:-}" = "--" ] && shift
# End of get options
IMAGE_NAME=${image_name}:${image_tag}
DOCKER_BUILDKIT=1 docker build \
--build-arg uid=${uid} \
--target codegen_server \
-t ${IMAGE_NAME} ${docker_file}