diff --git a/image-builder/Makefile b/image-builder/Makefile index 6b0a327..4dfa7af 100644 --- a/image-builder/Makefile +++ b/image-builder/Makefile @@ -196,7 +196,18 @@ endif done krm_base_image: + set -ex +ifneq ($(PROXY), ) + sudo -E docker build krm-function -t $(KRM_BASE_IMAGE) \ + --build-arg http_proxy=$(PROXY) \ + --build-arg https_proxy=$(PROXY) \ + --build-arg HTTP_PROXY=$(PROXY) \ + --build-arg HTTPS_PROXY=$(PROXY) \ + --build-arg no_proxy=$(NO_PROXY) \ + --build-arg NO_PROXY=$(NO_PROXY) +else sudo -E docker build krm-function -t $(KRM_BASE_IMAGE) +endif docker_build: set -ex diff --git a/image-builder/krm-function/Dockerfile b/image-builder/krm-function/Dockerfile index e1db97f..4ca66c8 100644 --- a/image-builder/krm-function/Dockerfile +++ b/image-builder/krm-function/Dockerfile @@ -1,4 +1,13 @@ -FROM quay.io/airshipit/golang:1.16.8-buster +ARG FROM=quay.io/airshipit/golang:1.16.8-buster +FROM ${FROM} + +ARG HTTP_PROXY +ARG HTTPS_PROXY +ARG NO_PROXY +ARG http_proxy +ARG https_proxy +ARG no_proxy + ENV CGO_ENABLED=0 WORKDIR /go/src/