From f393fa04421c9979bf8f866acaa0ba3b23c6b145 Mon Sep 17 00:00:00 2001 From: Dave Bevan Date: Wed, 25 Jan 2017 17:37:26 +0000 Subject: [PATCH 1/3] Behind-proxy support for herokuish install Inject http proxy envvars to docker build command to allow package installation behind corporate proxies. These envvars (http_proxy and https_proxy) are standard, and usually configured via system-wide /etc/profile.d files. In cases where these envvars are not configured, the additions appear to be mute and non-destructive. --- deb.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deb.mk b/deb.mk index eac9a9ced..ab1e831c7 100644 --- a/deb.mk +++ b/deb.mk @@ -92,7 +92,7 @@ deb-herokuish: @echo " sudo docker rmi gliderlabs/herokuish" >> /tmp/tmp/post-install @echo "fi" >> /tmp/tmp/post-install @echo "echo 'Importing herokuish into docker (around 5 minutes)'" >> /tmp/tmp/post-install - @echo "sudo docker build -t gliderlabs/herokuish /var/lib/herokuish 1> /dev/null" >> /tmp/tmp/post-install + @echo "sudo docker build --build-args http_proxy=$http_proxy --build-args https_proxy=$https_proxy -t gliderlabs/herokuish /var/lib/herokuish 1> /dev/null" >> /tmp/tmp/post-install @echo "-> Cloning repository" git clone -q "https://github.com/$(HEROKUISH_REPO_NAME).git" --branch "v$(HEROKUISH_VERSION)" /tmp/tmp/herokuish > /dev/null From 9f9b3374bda881f80e9bccf63d72236348ae6875 Mon Sep 17 00:00:00 2001 From: Dave Bevan Date: Thu, 26 Jan 2017 10:34:02 +0000 Subject: [PATCH 2/3] Make docker build --build-args optional Change the proxy-sensing --build-args such that they only added if defined. --- deb.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deb.mk b/deb.mk index ab1e831c7..0b38c744d 100644 --- a/deb.mk +++ b/deb.mk @@ -92,7 +92,10 @@ deb-herokuish: @echo " sudo docker rmi gliderlabs/herokuish" >> /tmp/tmp/post-install @echo "fi" >> /tmp/tmp/post-install @echo "echo 'Importing herokuish into docker (around 5 minutes)'" >> /tmp/tmp/post-install - @echo "sudo docker build --build-args http_proxy=$http_proxy --build-args https_proxy=$https_proxy -t gliderlabs/herokuish /var/lib/herokuish 1> /dev/null" >> /tmp/tmp/post-install + @echo 'if [ ! -z ${http_proxy+x} ]; then BUILDARGS="--build-args http_proxy=$http_proxy"; fi' >> /tmp/tmp/post-install + @echo 'if [ ! -z ${https_proxy+x} ]; then BUILDARGS="$BUILDARGS --build-args https_proxy=$https_proxy"; fi' >> /tmp/tmp/post-install + @echo 'if [ ! -z ${BUILDARGS+x} ]; then echo Adding proxy settings to docker build: $BUILDARGS; fi' >> /tmp/tmp/post-install + @echo "sudo docker build $BUILDARGS -t gliderlabs/herokuish /var/lib/herokuish 1> /dev/null" >> /tmp/tmp/post-install @echo "-> Cloning repository" git clone -q "https://github.com/$(HEROKUISH_REPO_NAME).git" --branch "v$(HEROKUISH_VERSION)" /tmp/tmp/herokuish > /dev/null From 96a0c2531da8826f9ae0d29e369d5d0db5a75fd2 Mon Sep 17 00:00:00 2001 From: Dave Bevan Date: Fri, 27 Jan 2017 12:02:55 +0000 Subject: [PATCH 3/3] Update deb.mk Updates as requested --- deb.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deb.mk b/deb.mk index 0b38c744d..1d7221a10 100644 --- a/deb.mk +++ b/deb.mk @@ -92,10 +92,10 @@ deb-herokuish: @echo " sudo docker rmi gliderlabs/herokuish" >> /tmp/tmp/post-install @echo "fi" >> /tmp/tmp/post-install @echo "echo 'Importing herokuish into docker (around 5 minutes)'" >> /tmp/tmp/post-install - @echo 'if [ ! -z ${http_proxy+x} ]; then BUILDARGS="--build-args http_proxy=$http_proxy"; fi' >> /tmp/tmp/post-install - @echo 'if [ ! -z ${https_proxy+x} ]; then BUILDARGS="$BUILDARGS --build-args https_proxy=$https_proxy"; fi' >> /tmp/tmp/post-install - @echo 'if [ ! -z ${BUILDARGS+x} ]; then echo Adding proxy settings to docker build: $BUILDARGS; fi' >> /tmp/tmp/post-install - @echo "sudo docker build $BUILDARGS -t gliderlabs/herokuish /var/lib/herokuish 1> /dev/null" >> /tmp/tmp/post-install + @echo 'if [[ ! -z ${http_proxy+x} ]]; then BUILDARGS="--build-args http_proxy=$http_proxy"; fi' >> /tmp/tmp/post-install + @echo 'if [[ ! -z ${https_proxy+x} ]]; then BUILDARGS="$BUILDARGS --build-args https_proxy=$https_proxy"; fi' >> /tmp/tmp/post-install + @echo 'if [[ ! -z ${BUILDARGS+x} ]]; then echo Adding proxy settings to docker build: $BUILDARGS; fi' >> /tmp/tmp/post-install + @echo 'sudo docker build $BUILDARGS -t gliderlabs/herokuish /var/lib/herokuish 1> /dev/null' >> /tmp/tmp/post-install @echo "-> Cloning repository" git clone -q "https://github.com/$(HEROKUISH_REPO_NAME).git" --branch "v$(HEROKUISH_VERSION)" /tmp/tmp/herokuish > /dev/null