This helps to build Policy-os docker image behind a proxy.
Change-Id: Ia31021249108544bfeba0087060dc32b68ff8844
Signed-off-by: Shashank Kumar Shankar <shashank.kumar.shankar@intel.com>
 MVN_VERSION=$(cat target/version)
 MVN_MAJMIN_VERSION=$(cut -f 1,2 -d . target/version)
 TIMESTAMP=$(date -u +%Y%m%dT%H%M%S)
+HTTP_PROXY=""
+HTTPS_PROXY=""
+PROXY_ARGS=""
+
+if [ $HTTP_PROXY ]; then
+    PROXY_ARGS+="--build-arg HTTP_PROXY=${HTTP_PROXY}"
+fi
+if [ $HTTPS_PROXY ]; then
+    PROXY_ARGS+="--build-arg HTTPS_PROXY=${HTTPS_PROXY}"
+fi
 
 echo $DOCKER_REPOSITORY
 echo $MVN_VERSION
 
     echo $TAGS
 
-    docker build --quiet $TAGS target/$image
+    docker build --quiet ${PROXY_ARGS} $TAGS target/$image
 
     if [ $? -ne 0 ]
     then
 
 FROM ubuntu:14.04
 
+ARG HTTP_PROXY=${HTTP_PROXY}
+ARG HTTPS_PROXY=${HTTPS_PROXY}
+
+ENV http_proxy $HTTP_PROXY
+ENV https_proxy $HTTPS_PROXY
+
 RUN \
        apt-get clean && \
        apt-get update && \