From 112374475ac886e43a793a0064fc8fa153b9bac8 Mon Sep 17 00:00:00 2001 From: Jiawei Huang Date: Tue, 21 Nov 2023 20:17:23 -0800 Subject: [PATCH] Add back push-manifests in Makefile Reimplement `push-manifests` in `lib.Makefile` using `docker manifest` command [1]. It was accidentally removed in [2]. [1] https://docs.docker.com/engine/reference/commandline/manifest/ [2] https://github.com/projectcalico/calico/pull/8103/files#diff-abfd44a7d28b43da680f905985a06fe893b7e4aa8920d87fee8070b261645b55L915 --- lib.Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib.Makefile b/lib.Makefile index 493591155b1..f69702b98f7 100644 --- a/lib.Makefile +++ b/lib.Makefile @@ -876,6 +876,12 @@ push-image-arch-to-registry-%: $(NOECHO) $(NOOP)\ ) +# push multi-arch manifest where supported. +push-manifests: var-require-all-IMAGETAG $(addprefix sub-manifest-,$(call escapefs,$(PUSH_MANIFEST_IMAGES))) +sub-manifest-%: + $(DOCKER) manifest create $(call unescapefs,$*):$(IMAGETAG) $(addprefix --amend ,$(addprefix $(call unescapefs,$*):$(IMAGETAG)-,$(VALIDARCHES))) + $(DOCKER) manifest push $(call unescapefs,$*):$(IMAGETAG) + # cd-common tags and pushes images with the branch name and git version. This target uses PUSH_IMAGES, BUILD_IMAGE, # and BRANCH_NAME env variables to figure out what to tag and where to push it to. cd-common: var-require-one-of-CONFIRM-DRYRUN var-require-all-BRANCH_NAME