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
This commit is contained in:
Phil Sphicas 2019-10-28 12:56:28 -07:00
parent 8a08f26f4a
commit f165082caf
1 changed files with 2 additions and 0 deletions

View File

@ -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)