diff --git a/Makefile b/Makefile index 9c9598c..8c4b4c9 100644 --- a/Makefile +++ b/Makefile @@ -4,18 +4,24 @@ ifeq ($(ARCH),) ARCH=$(shell go env GOARCH) endif +BUILD_META=-build$(shell date +%Y%m%d) ORG ?= rancher -TAG ?= v3.6 +TAG ?= v3.6$(BUILD_META) ifneq ($(DRONE_TAG),) TAG := $(DRONE_TAG) endif +ifeq (,$(filter %$(BUILD_META),$(TAG))) +$(error TAG needs to end with build metadata: $(BUILD_META)) +endif + .PHONY: image-build image-build: docker build \ + --pull \ --build-arg ARCH=$(ARCH) \ - --build-arg TAG=$(TAG) \ + --build-arg TAG=$(TAG:$(BUILD_META)=) \ --tag $(ORG)/hardened-multus-cni:$(TAG) \ --tag $(ORG)/hardened-multus-cni:$(TAG)-$(ARCH) \ .