From b949d5f9c7cbb5c3835ac74c99239a7c60a203ef Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 16 Jul 2020 11:33:06 +0530 Subject: [PATCH] build: Build and push multi architecture images to dockerhub As quay.io doesnot support the multi architecture images, We need to switch to dockerhub as it supports multi-architecture images. closes: #1003 Signed-off-by: Madhu Rajanna --- Makefile | 9 +++++++-- deploy.sh | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e313f7ea5..013b5fe8d 100644 --- a/Makefile +++ b/Makefile @@ -162,8 +162,13 @@ push-image-cephcsi: GOARCH ?= $(shell go env GOARCH 2>/dev/null) push-image-cephcsi: need-container-cmd image-cephcsi $(CONTAINER_CMD) tag $(CSI_IMAGE) $(CSI_IMAGE)-$(GOARCH) $(CONTAINER_CMD) push $(CSI_IMAGE)-$(GOARCH) - # push amd64 image as default one - if [ $(GOARCH) = amd64 ]; then $(CONTAINER_CMD) push $(CSI_IMAGE); fi + +create-manifest: GOARCH ?= $(shell go env GOARCH 2>/dev/null) +create-manifest: need-container-cmd + $(CONTAINER_CMD) manifest create $(CSI_IMAGE) --amend $(CSI_IMAGE)-$(GOARCH) + +push-manifest: need-container-cmd + $(CONTAINER_CMD) manifest push $(CSI_IMAGE) clean: go clean -mod=vendor -r -x diff --git a/deploy.sh b/deploy.sh index 07e8b47e7..2e1f6c742 100755 --- a/deploy.sh +++ b/deploy.sh @@ -77,7 +77,9 @@ build_push_images() { build_step "make push-image-cephcsi for ${ARCH}" GOARCH=${ARCH} BASE_IMAGE=${base_image} make push-image-cephcsi build_step_log "done: make push-image-cephcsi for ${ARCH} (ret=${?})" + GOARCH=${ARCH} make create-manifest done + make push-manifest } if [ "${TRAVIS_BRANCH}" == 'master' ]; then