summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Gorshunov <roman.gorshunov@att.com>2018-06-22 14:47:57 +0200
committerRoman Gorshunov <roman.gorshunov@att.com>2018-06-22 14:47:57 +0200
commit18a82a0a70fa807e5c6147951720a6375dca31a8 (patch)
treef0c3e3b875181e948edc6cc41313ad8143e62579
parentb0b0ba021eb8f773f9e93bfce2ea9f71e983b152 (diff)
Unifying proxy variables for docker build
This patch adds proxy-related variables to 'docker build' command. Change-Id: I02f25639a700983ad5f2431bcd917a84375dadb9
Notes
Notes (review): Code-Review+2: Felipe Monteiro <felipe.monteiro@att.com> Code-Review+2: Pete Birley <pete@port.direct> Workflow+1: Pete Birley <pete@port.direct> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 22 Jun 2018 17:13:33 +0000 Reviewed-on: https://review.openstack.org/577413 Project: openstack/airship-maas Branch: refs/heads/master
-rw-r--r--Makefile46
1 files changed, 27 insertions, 19 deletions
diff --git a/Makefile b/Makefile
index 47c091a..69b4a44 100644
--- a/Makefile
+++ b/Makefile
@@ -12,24 +12,25 @@
12# See the License for the specific language governing permissions and 12# See the License for the specific language governing permissions and
13# limitations under the License. 13# limitations under the License.
14 14
15DOCKER_REGISTRY ?= quay.io 15DOCKER_REGISTRY ?= quay.io
16REGION_SUFFIX ?= maas-region 16REGION_SUFFIX ?= maas-region
17IMG_COMMON_DIR ?= images 17IMG_COMMON_DIR ?= images
18REGION_IMG_DIR ?= images/maas-region-controller 18REGION_IMG_DIR ?= images/maas-region-controller
19RACK_SUFFIX ?= maas-rack 19RACK_SUFFIX ?= maas-rack
20RACK_IMG_DIR ?= images/maas-rack-controller 20RACK_IMG_DIR ?= images/maas-rack-controller
21CACHE_SUFFIX ?= maas-cache 21CACHE_SUFFIX ?= maas-cache
22CACHE_IMG_DIR ?= images/sstream-cache 22CACHE_IMG_DIR ?= images/sstream-cache
23IMAGE_PREFIX ?= airshipit 23IMAGE_PREFIX ?= airshipit
24IMAGE_TAG ?= untagged 24IMAGE_TAG ?= untagged
25PROXY ?= http://one.proxy.att.com:8080 25PROXY ?= http://proxy.foo.com:8000
26USE_PROXY ?= false 26NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local
27PUSH_IMAGE ?= false 27USE_PROXY ?= false
28LABEL ?= commit-id 28PUSH_IMAGE ?= false
29IMAGE_NAME := maas-rack-controller maas-region-controller sstream-cache 29LABEL ?= commit-id
30BUILD_DIR := $(shell mktemp -d) 30IMAGE_NAME := maas-rack-controller maas-region-controller sstream-cache
31HELM := $(BUILD_DIR)/helm 31BUILD_DIR := $(shell mktemp -d)
32SSTREAM_IMAGE := "https://images.maas.io/ephemeral-v3/daily/" 32HELM := $(BUILD_DIR)/helm
33SSTREAM_IMAGE := "https://images.maas.io/ephemeral-v3/daily/"
33 34
34.PHONY: images 35.PHONY: images
35#Build all images in the list 36#Build all images in the list
@@ -65,7 +66,14 @@ helm-install:
65.PHONY: build 66.PHONY: build
66build: 67build:
67ifeq ($(USE_PROXY), true) 68ifeq ($(USE_PROXY), true)
68 docker build -t $(IMAGE) --network=host --label $(LABEL) -f $(IMAGE_DIR)/Dockerfile --build-arg SSTREAM_IMAGE=$(SSTREAM_IMAGE) --build-arg http_proxy=$(PROXY) --build-arg https_proxy=$(PROXY) $(IMAGE_DIR) 69 docker build -t $(IMAGE) --network=host --label $(LABEL) -f $(IMAGE_DIR)/Dockerfile --build-arg SSTREAM_IMAGE=$(SSTREAM_IMAGE) \
70 --build-arg http_proxy=$(PROXY) \
71 --build-arg https_proxy=$(PROXY) \
72 --build-arg HTTP_PROXY=$(PROXY) \
73 --build-arg HTTPS_PROXY=$(PROXY) \
74 --build-arg no_proxy=$(NO_PROXY) \
75 --build-arg NO_PROXY=$(NO_PROXY) \
76 $(IMAGE_DIR)
69else 77else
70 docker build -t $(IMAGE) --network=host --label $(LABEL) --build-arg SSTREAM_IMAGE=$(SSTREAM_IMAGE) -f $(IMAGE_DIR)/Dockerfile $(IMAGE_DIR) 78 docker build -t $(IMAGE) --network=host --label $(LABEL) --build-arg SSTREAM_IMAGE=$(SSTREAM_IMAGE) -f $(IMAGE_DIR)/Dockerfile $(IMAGE_DIR)
71endif 79endif