VOL-621 add build hook to support build args on docker cloud

Change-Id: I2b5acfdd7ef96896751687f56480e68267334718
diff --git a/docker/hooks/build b/docker/hooks/build
new file mode 100755
index 0000000..618a914
--- /dev/null
+++ b/docker/hooks/build
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+echo "=> Using custom build hook to add build arguments"
+echo "=> set DEBUG=true to see debug information"
+
+if [ "$DEBUG" == "true" ]; then
+  env | sort
+fi
+
+cd /src/${BUILD_CODE}${BUILD_PATH}
+
+if [ "$DEBUG" == "true" ]; then
+  echo docker build --build-arg REPOSITORY=$REPOSITORY --build-arg REGISTRY=$REGISTRY --build-arg TAG=${TAG:-latest} -t $IMAGE_NAME -f $DOCKERFILE_PATH .
+fi
+
+docker build --build-arg REPOSITORY=$REPOSITORY --build-arg REGISTRY=$REGISTRY --build-arg TAG=${TAG:-latest} -t $IMAGE_NAME -f $DOCKERFILE_PATH .