Add EXTRA_BUILD_ARGS when build images with make

This ps adds EXTRA_BUILD_ARGS parameter to docker build in Makefile
to allow additional arguments like labels and proxy to be passed
during image build

Change-Id: Ib5d42d3493ffbba274c2dcb8721428141143db49
This commit is contained in:
Thippaiah, Balachandra (bt061u) 2019-01-28 06:55:51 -05:00
parent 1a57f1fea7
commit 96048a62fa
1 changed files with 5 additions and 1 deletions

View File

@ -39,24 +39,28 @@ build_$(IMAGE_NAME):
ifeq ($(OS_RELEASE), ubuntu_xenial)
docker build -f $(IMAGE_NAME)/Dockerfile.$(OS_RELEASE) \
--network host \
$(EXTRA_BUILD_ARGS) \
-t $(IMAGE) \
.
else ifeq ($(OS_RELEASE), suse_15)
docker build -f $(IMAGE_NAME)/Dockerfile.$(OS_RELEASE) \
--network host \
$(EXTRA_BUILD_ARGS) \
-t $(IMAGE) \
.
else ifeq ($(OS_RELEASE), debian)
docker build -f $(IMAGE_NAME)/Dockerfile.$(OS_RELEASE) \
--network host \
$(EXTRA_BUILD_ARGS) \
-t $(IMAGE) \
.
else ifeq ($(OS_RELEASE), centos_7)
docker build -f $(IMAGE_NAME)/Dockerfile.$(OS_RELEASE) \
--network host \
$(EXTRA_BUILD_ARGS) \
-t $(IMAGE) \
.
else
docker build -t $(IMAGE) --network=host -f $(IMAGE_NAME)/Dockerfile.simple \
docker build -t $(IMAGE) --network=host $(EXTRA_BUILD_ARGS) -f $(IMAGE_NAME)/Dockerfile.simple \
.
endif