diff --git a/Makefile b/Makefile index b5bedf79c..b44aa8b91 100644 --- a/Makefile +++ b/Makefile @@ -108,6 +108,11 @@ build-with-docker: prepare-docker-build-image ## Build inside a Docker container -e GIT_COMMIT=${GIT_COMMIT} \ -e BUILD_NUMBER=${BUILD_NUMBER} \ -e BUILD_URL=${BUILD_URL} \ + -e http_proxy="${HTTP_PROXY}" \ + -e HTTP_PROXY="${HTTP_PROXY}" \ + -e https_proxy="${HTTPS_PROXY}" \ + -e HTTPS_PROXY="${HTTPS_PROXY}" \ + -e NO_PROXY="${NO_PROXY}" \ ${DOCKER_BUILDER_IMAGE_NAME} \ make build @@ -119,6 +124,11 @@ test-with-docker: prepare-docker-build-image ## Run tests inside a Docker contai -e GIT_COMMIT=${GIT_COMMIT} \ -e BUILD_NUMBER=${BUILD_NUMBER} \ -e BUILD_URL=${BUILD_URL} \ + -e http_proxy="${HTTP_PROXY}" \ + -e HTTP_PROXY="${HTTP_PROXY}" \ + -e https_proxy="${HTTPS_PROXY}" \ + -e HTTPS_PROXY="${HTTPS_PROXY}" \ + -e NO_PROXY="${NO_PROXY}" \ ${DOCKER_BUILDER_IMAGE_NAME} \ make test @@ -135,6 +145,11 @@ coverage-with-docker: prepare-docker-build-image ## Generates coverage report in -e CI_BUILD_URL=${BUILD_URL} \ -e CI_BRANCH=${GIT_BRANCH} \ -e CI_PULL_REQUEST=${CI_PULL_REQUEST} \ + -e http_proxy="${HTTP_PROXY}" \ + -e HTTP_PROXY="${HTTP_PROXY}" \ + -e https_proxy="${HTTPS_PROXY}" \ + -e HTTPS_PROXY="${HTTPS_PROXY}" \ + -e NO_PROXY="${NO_PROXY}" \ ${DOCKER_BUILDER_IMAGE_NAME} \ make coverage diff --git a/docker/Dockerfile-build b/docker/Dockerfile-build index 2ce5a28bd..e22b9f321 100644 --- a/docker/Dockerfile-build +++ b/docker/Dockerfile-build @@ -1,11 +1,14 @@ FROM python:3.4-slim +ARG APT_HTTP_PROXY + ENV PYTHONUNBUFFERED=1 \ DEBIAN_FRONTEND=noninteractive \ NODEJS_VERSION=6.3.1-1nodesource1~jessie1 RUN \ echo "Install base packages" \ + && ([ -z "$APT_HTTP_PROXY" ] || echo "Acquire::http::Proxy \"${APT_HTTP_PROXY}\";\n" > /etc/apt/apt.conf.d/99HttpProxy) \ && apt-get update \ && apt-get install -y --no-install-recommends \ apt-transport-https \ diff --git a/docker/Makefile b/docker/Makefile index e39e6167e..23f3c32ce 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -7,4 +7,4 @@ help: .PHONY: build-build-image build-build-image: - docker build --pull -f Dockerfile-build -t govuk/notify-admin-builder . + docker build --pull -f Dockerfile-build -t govuk/notify-admin-builder --build-arg APT_HTTP_PROXY="${HTTP_PROXY}" .