diff options
author | Shashank Kumar Shankar <shashank.kumar.shankar@intel.com> | 2017-06-27 16:10:28 -0700 |
---|---|---|
committer | Shashank Kumar Shankar <shashank.kumar.shankar@intel.com> | 2017-06-28 16:23:58 +0000 |
commit | 3e5a0c35447d8699dfef7308fa6a3dc287bc0a64 (patch) | |
tree | 5fd5bc4014c069c0445d14c01520700255966173 /docker_build.sh | |
parent | 505888a539cfaf21199795c5b243c182ab3caceb (diff) |
Add proxy support in DockerFile.
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>
Diffstat (limited to 'docker_build.sh')
-rwxr-xr-x | docker_build.sh | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/docker_build.sh b/docker_build.sh index 4b0233c3..746f7101 100755 --- a/docker_build.sh +++ b/docker_build.sh @@ -5,6 +5,16 @@ DOCKER_REPOSITORY=nexus3.onap.org:10003 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 @@ -59,7 +69,7 @@ for image in policy-os policy-nexus policy-db policy-base policy-drools policy-p echo $TAGS - docker build --quiet $TAGS target/$image + docker build --quiet ${PROXY_ARGS} $TAGS target/$image if [ $? -ne 0 ] then |