Support proxy for krm function build

Signed-off-by: Andrii Ostapenko <anost1986@gmail.com>
Change-Id: I749931028e0a2a667619fb497f6b1396fd2ee8ca
This commit is contained in:
Andrii Ostapenko 2021-11-16 20:01:00 -07:00
parent efca83730b
commit 1767e4dac4
No known key found for this signature in database
GPG Key ID: F3E83668DBB223B3
2 changed files with 21 additions and 1 deletions

View File

@ -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

View File

@ -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/