mirror of
https://github.com/dcarrillo/docker-nginx.git
synced 2024-11-14 16:01:12 +00:00
35 lines
694 B
Bash
Executable File
35 lines
694 B
Bash
Executable File
#!/usr/bin/env sh
|
|
|
|
set -e
|
|
|
|
# shellcheck disable=SC1090
|
|
. "$(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" \
|
|
-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
|
|
[ x$PUSH = "xtrue" ] && docker push "$DOCKER_IMAGE":latest
|
|
fi
|