Docker: support build behind proxy
This PS adds support to build behind a corp proxy. Change-Id: I6dbcb84dc731084bdca29c0561c1fb3694157888 Signed-off-by: Pete Birley <pete@port.direct>
This commit is contained in:
parent
84694989b6
commit
d9d67c60cc
12
Makefile
12
Makefile
@ -18,6 +18,9 @@ IMAGE_PREFIX ?= attcomdev
|
||||
IMAGE_NAME ?= armada
|
||||
IMAGE_TAG ?= latest
|
||||
HELM ?= helm
|
||||
PROXY ?= http://proxy.foo.com:8000
|
||||
USE_PROXY ?= false
|
||||
PUSH_IMAGE ?= false
|
||||
LABEL ?= commit-id
|
||||
PYTHON = python3
|
||||
CHARTS := $(patsubst charts/%/.,%,$(wildcard charts/*/.))
|
||||
@ -98,7 +101,14 @@ build_docs:
|
||||
|
||||
.PHONY: build_armada
|
||||
build_armada:
|
||||
docker build -t $(IMAGE) --label $(LABEL) .
|
||||
ifeq ($(USE_PROXY), true)
|
||||
docker build --network host -t $(IMAGE) --label $(LABEL) -f ./Dockerfile . --build-arg http_proxy=$(PROXY) --build-arg https_proxy=$(PROXY)
|
||||
else
|
||||
docker build --network host -t $(IMAGE) --label $(LABEL) -f ./Dockerfile .
|
||||
endif
|
||||
ifeq ($(PUSH_IMAGE), true)
|
||||
docker push $(IMAGE)
|
||||
endif
|
||||
|
||||
# make tools
|
||||
.PHONY: protoc
|
||||
|
Loading…
Reference in New Issue
Block a user