diff --git a/Makefile b/Makefile index 8646851..7492fae 100644 --- a/Makefile +++ b/Makefile @@ -4,21 +4,27 @@ ifeq ($(ARCH),) ARCH=$(shell go env GOARCH) endif +BUILD_META=-build$(shell date +%Y%m%d) ORG ?= rancher PKG ?= github.com/kubernetes-sigs/cri-tools SRC ?= github.com/kubernetes-sigs/cri-tools -TAG ?= v1.18.0 +TAG ?= v1.18.0$(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 PKG=$(PKG) \ --build-arg SRC=$(SRC) \ - --build-arg TAG=$(TAG) \ + --build-arg TAG=$(TAG:$(BUILD_META)=) \ --tag $(ORG)/hardened-crictl:$(TAG) \ --tag $(ORG)/hardened-crictl:$(TAG)-$(ARCH) \ .