Add labels to Docker Build process

Adding the ability to add a label to the docker image at build
time

Change-Id: I96a4800256af164de140f4554ab9b09d8c2e6722
This commit is contained in:
Stacey Fletcher 2018-02-17 15:06:31 -06:00 committed by Bryan Strassner
parent 6cc7211630
commit 17c3fb0eec
1 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ IMAGE_PREFIX ?= attcomdev
IMAGE_TAG ?= latest
SHIPYARD_IMAGE_NAME ?= shipyard
HELM ?= helm
LABEL ?= commit-id
# Build all docker images for this project
.PHONY: images
images: build_airflow build_shipyard
@ -56,11 +56,11 @@ run_airflow: clean build_airflow
.PHONY: build_airflow
build_airflow:
docker build -t $(IMAGE_PREFIX)/$(AIRFLOW_IMAGE_NAME):$(IMAGE_TAG) images/airflow/
docker build -t $(IMAGE_PREFIX)/$(AIRFLOW_IMAGE_NAME):$(IMAGE_TAG) --label $(LABEL) images/airflow/
.PHONY: build_shipyard
build_shipyard:
docker build -t $(IMAGE_PREFIX)/$(SHIPYARD_IMAGE_NAME):$(IMAGE_TAG) -f images/shipyard/Dockerfile .
docker build -t $(IMAGE_PREFIX)/$(SHIPYARD_IMAGE_NAME):$(IMAGE_TAG) --label $(LABEL) -f images/shipyard/Dockerfile .
.PHONY: clean
clean: