From 455c3215dbed904a68f4e9371e73d247f701170b Mon Sep 17 00:00:00 2001 From: Stacey Fletcher Date: Sat, 17 Feb 2018 15:19:25 -0600 Subject: [PATCH] Add labels to Docker image This ps allows labels to be added to the docker image at build time Change-Id: Iff40db4b34a549c976b0ac27f4ed0cba3bcb235c --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 4dd05d01..e3af01d4 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ HELM ?= helm PROXY ?= http://one.proxy.att.com:8080 USE_PROXY ?= false PUSH_IMAGE ?= false - +LABEL ?= commit-id export # Build all docker images for this project @@ -65,9 +65,9 @@ dry-run: clean .PHONY: build_drydock build_drydock: ifeq ($(USE_PROXY), true) - docker build -t $(IMAGE_PREFIX)/$(DRYDOCK_IMAGE_NAME):$(IMAGE_TAG) -f images/drydock/Dockerfile . --build-arg http_proxy=$(PROXY) --build-arg https_proxy=$(PROXY) + docker build -t $(IMAGE_PREFIX)/$(DRYDOCK_IMAGE_NAME):$(IMAGE_TAG) --label $(LABEL) -f images/drydock/Dockerfile . --build-arg http_proxy=$(PROXY) --build-arg https_proxy=$(PROXY) else - docker build -t $(IMAGE_PREFIX)/$(DRYDOCK_IMAGE_NAME):$(IMAGE_TAG) -f images/drydock/Dockerfile . + docker build -t $(IMAGE_PREFIX)/$(DRYDOCK_IMAGE_NAME):$(IMAGE_TAG) --label $(LABEL) -f images/drydock/Dockerfile . endif ifeq ($(PUSH_IMAGE), true) docker push $(IMAGE_PREFIX)/$(DRYDOCK_IMAGE_NAME):$(IMAGE_TAG)