Merge lp:~ricardokirkner/isitdeployable/docker-build-arg-http-proxy into lp:isitdeployable

Proposed by Ricardo Kirkner
Status: Merged
Approved by: Ricardo Kirkner
Approved revision: 231
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: lp:~ricardokirkner/isitdeployable/docker-build-arg-http-proxy
Merge into: lp:isitdeployable
Diff against target: 25 lines (+7/-1)
1 file modified
Makefile.k8s (+7/-1)
To merge this branch: bzr merge lp:~ricardokirkner/isitdeployable/docker-build-arg-http-proxy
Reviewer Review Type Date Requested Status
Ricardo Kirkner (community) Approve
Review via email: mp+329032@code.launchpad.net

Commit message

pass http proxy as build-arg if defined in environ

To post a comment you must log in.
Revision history for this message
Ricardo Kirkner (ricardokirkner) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile.k8s'
2--- Makefile.k8s 2017-08-14 19:34:53 +0000
3+++ Makefile.k8s 2017-08-15 11:51:31 +0000
4@@ -13,6 +13,8 @@
5 TLS_CRT ?= $(shell cat deployment/$(DOMAIN).crt | base64 -w0)
6 TLS_KEY ?= $(shell cat deployment/$(DOMAIN).key | base64 -w0)
7
8+HTTP_PROXY ?= $(http_proxy)
9+
10 # public targets
11
12 k8s-bootstrap: $(ENV) fetch-sourcedeps ## Bootstrap k8s environment
13@@ -28,7 +30,11 @@
14 k8s-build: fetch-sourcedeps ## Build container image
15 @echo 'Building image on:' $(shell lsb_release -cs)
16 @echo 'Building image using docker version:' $(shell docker version -f "Server: {{.Server.Version}} Client: {{.Client.Version}}")
17- docker build --build-arg BUILD_REVISION="r$(shell bzr revno)" -t $(IMAGE_NAME):$(IMAGE_TAG) .
18+ $(eval BUILD_ARGS = --build-arg BUILD_REVISION="r$(shell bzr revno)")
19+ifneq ($(HTTP_PROXY),)
20+ $(eval BUILD_ARGS = $(BUILD_ARGS) --build-arg HTTP_PROXY=$(HTTP_PROXY))
21+endif
22+ docker build $(BUILD_ARGS) -t $(IMAGE_NAME):$(IMAGE_TAG) .
23
24 k8s-upload: ## Upload image to registry
25 docker tag $(IMAGE_NAME):$(IMAGE_TAG) $(DOCKER_REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG)

Subscribers

People subscribed via source and target branches