Unifying proxy variables for docker build
This patch adds proxy-related variables to 'docker build' command. Change-Id: Ia494f1a90328c80681f9cbe31763b4d2058042b1
This commit is contained in:
parent
45654cc90b
commit
d30e9b8660
27
Makefile
27
Makefile
@ -12,15 +12,16 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
DOCKER_REGISTRY ?= quay.io
|
DOCKER_REGISTRY ?= quay.io
|
||||||
IMAGE_NAME ?= deckhand
|
IMAGE_NAME ?= deckhand
|
||||||
IMAGE_PREFIX ?= attcomdev
|
IMAGE_PREFIX ?= attcomdev
|
||||||
IMAGE_TAG ?= latest
|
IMAGE_TAG ?= latest
|
||||||
HELM ?= helm
|
HELM ?= helm
|
||||||
PROXY ?= http://proxy.foo.com:8000
|
PROXY ?= http://proxy.foo.com:8000
|
||||||
USE_PROXY ?= false
|
NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local
|
||||||
PUSH_IMAGE ?= false
|
USE_PROXY ?= false
|
||||||
LABEL ?= commit-id
|
PUSH_IMAGE ?= false
|
||||||
|
LABEL ?= commit-id
|
||||||
|
|
||||||
IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}
|
IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}
|
||||||
|
|
||||||
@ -52,7 +53,13 @@ tests:
|
|||||||
.PHONY: build_deckhand
|
.PHONY: build_deckhand
|
||||||
build_deckhand:
|
build_deckhand:
|
||||||
ifeq ($(USE_PROXY), true)
|
ifeq ($(USE_PROXY), true)
|
||||||
docker build --network host -t $(IMAGE) --label $(LABEL) -f images/deckhand/Dockerfile . --build-arg HTTP_PROXY=$(PROXY) --build-arg HTTPS_PROXY=$(PROXY)
|
docker build --network host -t $(IMAGE) --label $(LABEL) -f images/deckhand/Dockerfile \
|
||||||
|
--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
|
else
|
||||||
docker build --network host -t $(IMAGE) --label $(LABEL) -f images/deckhand/Dockerfile .
|
docker build --network host -t $(IMAGE) --label $(LABEL) -f images/deckhand/Dockerfile .
|
||||||
endif
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user