From 7b6f09cc92e6fe93b80b21317df15a0c0802e95c Mon Sep 17 00:00:00 2001 From: Victor Morales Date: Fri, 16 Jun 2017 12:28:06 -0500 Subject: Add proxy support It was included the instructions to build dcae-controller image behind a corporate proxy. Change-Id: I8a22aa69fa5d2a82aa0f7f6035cc9b5f56f6cb59 Signed-off-by: Victor Morales --- dcae-demo-controller/src/main/docker-build/build.sh | 10 ++++++++-- .../src/main/docker-build/controller-install.sh | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dcae-demo-controller/src/main/docker-build/build.sh b/dcae-demo-controller/src/main/docker-build/build.sh index 2500aa8..4c83ccb 100644 --- a/dcae-demo-controller/src/main/docker-build/build.sh +++ b/dcae-demo-controller/src/main/docker-build/build.sh @@ -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 diff --git a/dcae-demo-controller/src/main/docker-build/controller-install.sh b/dcae-demo-controller/src/main/docker-build/controller-install.sh index 51c4f82..2c4d23a 100644 --- a/dcae-demo-controller/src/main/docker-build/controller-install.sh +++ b/dcae-demo-controller/src/main/docker-build/controller-install.sh @@ -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 -- cgit 1.2.3-korg