Browse Source

Unifying proxy variables for docker build

This patch adds proxy-related variables to 'docker build' command.

Change-Id: I02f25639a700983ad5f2431bcd917a84375dadb9
Roman Gorshunov 10 months ago
parent
commit
18a82a0a70
1 changed files with 27 additions and 19 deletions
  1. 27
    19
      Makefile

+ 27
- 19
Makefile View File

@@ -12,24 +12,25 @@
12 12
 # See the License for the specific language governing permissions and
13 13
 # limitations under the License.
14 14
 
15
-DOCKER_REGISTRY            ?= quay.io
16
-REGION_SUFFIX              ?= maas-region
17
-IMG_COMMON_DIR             ?= images
18
-REGION_IMG_DIR             ?= images/maas-region-controller
19
-RACK_SUFFIX                ?= maas-rack
20
-RACK_IMG_DIR               ?= images/maas-rack-controller
21
-CACHE_SUFFIX               ?= maas-cache
22
-CACHE_IMG_DIR              ?= images/sstream-cache
23
-IMAGE_PREFIX               ?= airshipit
24
-IMAGE_TAG                  ?= untagged
25
-PROXY                      ?= http://one.proxy.att.com:8080
26
-USE_PROXY                  ?= false
27
-PUSH_IMAGE                 ?= false
28
-LABEL                      ?= commit-id
29
-IMAGE_NAME                 := maas-rack-controller maas-region-controller sstream-cache
30
-BUILD_DIR                  := $(shell mktemp -d)
31
-HELM                       := $(BUILD_DIR)/helm
32
-SSTREAM_IMAGE              := "https://images.maas.io/ephemeral-v3/daily/"
15
+DOCKER_REGISTRY ?= quay.io
16
+REGION_SUFFIX   ?= maas-region
17
+IMG_COMMON_DIR  ?= images
18
+REGION_IMG_DIR  ?= images/maas-region-controller
19
+RACK_SUFFIX     ?= maas-rack
20
+RACK_IMG_DIR    ?= images/maas-rack-controller
21
+CACHE_SUFFIX    ?= maas-cache
22
+CACHE_IMG_DIR   ?= images/sstream-cache
23
+IMAGE_PREFIX    ?= airshipit
24
+IMAGE_TAG       ?= untagged
25
+PROXY           ?= http://proxy.foo.com:8000
26
+NO_PROXY        ?= localhost,127.0.0.1,.svc.cluster.local
27
+USE_PROXY       ?= false
28
+PUSH_IMAGE      ?= false
29
+LABEL           ?= commit-id
30
+IMAGE_NAME      := maas-rack-controller maas-region-controller sstream-cache
31
+BUILD_DIR       := $(shell mktemp -d)
32
+HELM            := $(BUILD_DIR)/helm
33
+SSTREAM_IMAGE   := "https://images.maas.io/ephemeral-v3/daily/"
33 34
 
34 35
 .PHONY: images
35 36
 #Build all images in the list
@@ -65,7 +66,14 @@ helm-install:
65 66
 .PHONY: build
66 67
 build:
67 68
 ifeq ($(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)
69 77
 else
70 78
 	docker build -t $(IMAGE) --network=host --label $(LABEL) --build-arg SSTREAM_IMAGE=$(SSTREAM_IMAGE) -f $(IMAGE_DIR)/Dockerfile $(IMAGE_DIR)
71 79
 endif

Loading…
Cancel
Save