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 <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2020-07-16 11:33:06 +05:30 committed by mergify[bot]
parent 5208c0fc38
commit b949d5f9c7
2 changed files with 9 additions and 2 deletions

View File

@ -162,8 +162,13 @@ push-image-cephcsi: GOARCH ?= $(shell go env GOARCH 2>/dev/null)
push-image-cephcsi: need-container-cmd image-cephcsi push-image-cephcsi: need-container-cmd image-cephcsi
$(CONTAINER_CMD) tag $(CSI_IMAGE) $(CSI_IMAGE)-$(GOARCH) $(CONTAINER_CMD) tag $(CSI_IMAGE) $(CSI_IMAGE)-$(GOARCH)
$(CONTAINER_CMD) push $(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: clean:
go clean -mod=vendor -r -x go clean -mod=vendor -r -x

View File

@ -77,7 +77,9 @@ build_push_images() {
build_step "make push-image-cephcsi for ${ARCH}" build_step "make push-image-cephcsi for ${ARCH}"
GOARCH=${ARCH} BASE_IMAGE=${base_image} make push-image-cephcsi GOARCH=${ARCH} BASE_IMAGE=${base_image} make push-image-cephcsi
build_step_log "done: make push-image-cephcsi for ${ARCH} (ret=${?})" build_step_log "done: make push-image-cephcsi for ${ARCH} (ret=${?})"
GOARCH=${ARCH} make create-manifest
done done
make push-manifest
} }
if [ "${TRAVIS_BRANCH}" == 'master' ]; then if [ "${TRAVIS_BRANCH}" == 'master' ]; then