From f165082caf47cc3cc487138081589a373a36ac36 Mon Sep 17 00:00:00 2001 From: Phil Sphicas Date: Mon, 28 Oct 2019 12:56:28 -0700 Subject: [PATCH] Pass extra build args to Docker image builds This change updates the generic container image build Makefile to allow the passing of extra build args to the container build Dockerfiles. For example, to build the calicoctl-utility container with an alternative version of calicoctl: make build EXTRA_BUILD_ARGS='--build-arg CALICOCTL_VERSION=v3.8.1' ... Change-Id: I2af072d72fd60389a9080ce18cdc38860bcb30b3 --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 3783b393..7ec1de76 100644 --- a/Makefile +++ b/Makefile @@ -153,6 +153,7 @@ ifeq ($(USE_PROXY), true) --label "org.opencontainers.image.created=$(shell date --rfc-3339=seconds --utc)" \ --label "org.opencontainers.image.title=$(IMAGE_NAME)" \ -f $(DOCKERFILE) \ + $(EXTRA_BUILD_ARGS) \ $(_BASE_IMAGE_ARG) \ --build-arg http_proxy=$(PROXY) \ --build-arg https_proxy=$(PROXY) \ @@ -166,6 +167,7 @@ else --label "org.opencontainers.image.created=$(shell date --rfc-3339=seconds --utc)" \ --label "org.opencontainers.image.title=$(IMAGE_NAME)" \ -f $(DOCKERFILE) \ + $(EXTRA_BUILD_ARGS) \ $(_BASE_IMAGE_ARG) images/$(subst porthole-,,$(IMAGE_NAME))/ endif ifeq ($(PUSH_IMAGE), true)