Files
api-gateway/deploy/scripts/image-build.sh
2025-12-13 15:51:57 +01:00

19 lines
485 B
Bash
Executable File

#!/bin/sh
# RUN IN REPO ROOT DIR !!
export IMAGE_NAME="git.ego.freeddns.org/egommerce/api-gateway"
# export IMAGE_NAME="localhost:32000/egommerce/api-gateway"
export BUILD_TIME=$(date +"%Y%m%d%H%M%S")
TARGET=${1:-latest}
echo "Building: $IMAGE_NAME:$TARGET"
if [ $TARGET = "dev" ]
then
docker build --rm --no-cache -t "$IMAGE_NAME:dev" . # >/dev/null 2>&1
else
docker build --rm --cache-from "$IMAGE_NAME:$TARGET" -t "$IMAGE_NAME:$TARGET" . >/dev/null 2>&1
fi
echo "Done."