1
0
mirror of https://github.com/dcarrillo/docker-nginx.git synced 2024-11-14 21:41:13 +00:00
docker-nginx/build.sh

36 lines
766 B
Bash
Raw Normal View History

2019-12-15 11:10:37 +00:00
#!/usr/bin/env sh
set -e
2020-03-07 18:08:09 +00:00
# shellcheck disable=SC1090
2019-12-15 11:10:37 +00:00
. "$(dirname "$0")"/conf.env
while [ $# -gt 0 ]; do
case $1 in
--push)
PUSH=true
shift
;;
--latest)
LATEST=true
shift
;;
*)
shift
;;
esac
done
docker build --build-arg=ARG_NGINX_VERSION="$NGINX_VERSION" \
--build-arg=ARG_NGX_GEOIP2_VERSION="$NGX_GEOIP2_VERSION" \
-t "$DOCKER_IMAGE":"$NGINX_VERSION" .
if [ x$PUSH = "xtrue" ]; then
docker push "$DOCKER_IMAGE":"$NGINX_VERSION"
fi
if [ x$LATEST = "xtrue" ]; then
docker tag "$DOCKER_IMAGE":"$NGINX_VERSION" "$DOCKER_IMAGE":latest
2019-12-24 16:19:08 +00:00
[ x$PUSH = "xtrue" ] && docker push "$DOCKER_IMAGE":latest
2019-12-15 11:10:37 +00:00
fi