Skip to content

Commit

Permalink
Fixed build-docker-image.
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepd-nv committed Oct 11, 2023
1 parent 1d65aef commit d7403e5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions continuous_integration/build-docker-image
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ set -xuo pipefail

#Set the options of the getopt command
# NOTE: local-build is optional
format=$(getopt -n "$0" -l "base-image:,image-tag:,source-dir:,build-type:,local-build:" -- -- "$@")
format=$(getopt -n "$0" -l "base-image:,image-tag:,source-dir:,build-type:,local-build" -- -- "$@")
if [ $? != 0 ]; then
echo "Getopt failed"
exit 1
fi

if [ $# -lt 5 ]; then
echo "Wrong number of arguments passed."
exit
Expand All @@ -20,7 +25,8 @@ do
--source-dir) SOURCE_DIR="$2"; shift;;
--build-type) BUILD_TYPE="$2"; shift;;
--local-build) LOCAL_BUILD="1";;
--) shift;;
--) shift; break;;
*) echo "Invalid option: $1"; exit 1;;
esac
shift;
done
Expand All @@ -32,7 +38,7 @@ mkdir -p "$SOURCE_DIR/.creds"

export DOCKER_BUILDKIT=1

if [ -z ${LOCAL_BUILD+x} ]; then
if [[ -z "${LOCAL_BUILD+x}" ]]; then
docker build \
--build-arg BASE_IMAGE="$BASE_IMAGE" \
--build-arg AWS_REGION="$AWS_REGION" \
Expand Down

0 comments on commit d7403e5

Please sign in to comment.