Add proxy support 61/5061/1
authorVictor Morales <victor.morales@intel.com>
Fri, 16 Jun 2017 17:28:06 +0000 (12:28 -0500)
committerVictor Morales <victor.morales@intel.com>
Fri, 16 Jun 2017 17:28:06 +0000 (12:28 -0500)
It was included the instructions to build dcae-controller image
behind a corporate proxy.

Change-Id: I8a22aa69fa5d2a82aa0f7f6035cc9b5f56f6cb59
Signed-off-by: Victor Morales <victor.morales@intel.com>
dcae-demo-controller/src/main/docker-build/build.sh
dcae-demo-controller/src/main/docker-build/controller-install.sh

index 2500aa8..4c83ccb 100644 (file)
@@ -31,5 +31,11 @@ if [ "$1" == "nobuild" ]; then exit; fi
 
 ## build Docker
 
-docker build -t dcae-controller:$VERSION .
-
+docker_build="docker build -t dcae-controller:$VERSION ."
+if [ $http_proxy ]; then
+    docker_build+=" --build-arg http_proxy=$http_proxy"
+fi
+if [ $https_proxy ]; then
+    docker_build+=" --build-arg https_proxy=$https_proxy"
+fi
+eval $docker_build
index 51c4f82..2c4d23a 100644 (file)
@@ -1,6 +1,9 @@
 
 set -e
 
+if [ ! -z ${http_proxy} ]; then echo "Acquire::http::proxy  \"${http_proxy}\";" >> /etc/apt/apt.conf; fi && \
+if [ ! -z ${https_proxy} ]; then echo "Acquire::https::proxy \"${https_proxy}\";" >> /etc/apt/apt.conf; fi
+
 apt-get update ; apt-get install -y maven openjdk-7-jdk curl dnsutils zip telnet
 
 ### GROOVY