From e5513c0635122eca21d677d6d3ae7c83f750ca4a Mon Sep 17 00:00:00 2001 From: Arash Bannazadeh-Mahani Date: Thu, 30 Jun 2016 10:37:52 -0700 Subject: [PATCH] Adding a flag, use_proxy_at_runtime, to use the same build proxy for runtime. otherwise variables rt_http_proxy and rt_https_proxy are need to be set prior calling make, if there is a need to proxy for runtime. --- Makefile | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 1c3353ad..29745220 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,12 @@ ifdef https_proxy DOCKER_HTTPS_PROXY=--build-arg https_proxy=$(https_proxy) endif -DISABLE_CACHE = 'false' +ifdef use_proxy_at_runtime + rt_http_proxy=$(http_proxy) + rt_https_proxy=$(https_proxy) +endif + +DISABLE_CACHE= 'false' ARCH = rpi# rpi/amd64/i386/armv7hf/armel BASE_DISTRO = @@ -85,13 +90,13 @@ supervisor: gosuper echo "ENV DEFAULT_PUBNUB_PUBLISH_KEY $(PUBNUB_PUBLISH_KEY)" >> Dockerfile echo "ENV DEFAULT_PUBNUB_SUBSCRIBE_KEY $(PUBNUB_SUBSCRIBE_KEY)" >> Dockerfile echo "ENV DEFAULT_MIXPANEL_TOKEN $(MIXPANEL_TOKEN)" >> Dockerfile -ifdef https_proxy - echo "ENV HTTPS_PROXY $(https_proxy)" >> Dockerfile - echo "ENV https_proxy $(https_proxy)" >> Dockerfile +ifdef rt_https_proxy + echo "ENV HTTPS_PROXY $(rt_https_proxy)" >> Dockerfile + echo "ENV https_proxy $(rt_https_proxy)" >> Dockerfile endif -ifdef http_proxy - echo "ENV HTTP_PROXY $(http_proxy)" >> Dockerfile - echo "ENV http_proxy $(http_proxy)" >> Dockerfile +ifdef rt_http_proxy + echo "ENV HTTP_PROXY $(rt_http_proxy)" >> Dockerfile + echo "ENV http_proxy $(rt_http_proxy)" >> Dockerfile endif docker build $(DOCKER_HTTP_PROXY) $(DOCKER_HTTPS_PROXY) --no-cache=$(DISABLE_CACHE) -t $(IMAGE) . -rm Dockerfile