diff --git a/Makefile b/Makefile index cfeb98edb..a5715a9ea 100644 --- a/Makefile +++ b/Makefile @@ -311,8 +311,14 @@ endif .PHONY: ci-images-build ci-images-build: IMAGE_ORG=$(FORCED_CI_ORG) -ci-images-build: image-build ## Build OCI image with the manager. - $(OCI_BIN) build --build-arg BASE_IMAGE=$(IMAGE) -t $(IMAGE_SHA) -f ./shortlived.Dockerfile . +ci-images-build: ## Build OCI image with the manager. + ifeq ($(VERSION), main) +# Also tag "latest" only for branch "main" + $(OCI_BIN) build -t $(IMAGE) -t $(IMAGE_TAG_BASE):latest . +else + $(OCI_BIN) build -t $(IMAGE) . +endif + $(OCI_BIN) build --build-arg BASE_IMAGE=$(IMAGE) -t $(IMAGE_SHA) -f shortlived.Dockerfile . .PHONY: ci-images-push ci-images-push: IMAGE_ORG=$(FORCED_CI_ORG)