Merge pull request #90400 from zhlhahaha/1737

fix cross build conformance image error
This commit is contained in:
Kubernetes Prow Robot 2020-05-01 09:34:30 -07:00 committed by GitHub
commit 628b413f8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,6 +34,9 @@ CLUSTER_DIR?=$(shell pwd)/../../../cluster/
BASEIMAGE=debian:stretch-slim
TEMP_DIR:=$(shell mktemp -d -t conformanceXXXXXX)
#output format for docker buildx build [push, load]
OUTPUT=--load
all: build
build:
@ -56,15 +59,14 @@ endif
cd ${TEMP_DIR} && sed -i.back "s|BASEIMAGE|${BASEIMAGE}|g" Dockerfile
docker build --pull -t ${REGISTRY}/conformance-${ARCH}:${VERSION} ${TEMP_DIR}
rm -rf "${TEMP_DIR}"
push: build
docker push ${REGISTRY}/conformance-${ARCH}:${VERSION}
DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --pull --platform linux/$(ARCH) $(OUTPUT) -t ${REGISTRY}/conformance-${ARCH}:${VERSION} ${TEMP_DIR}
ifeq ($(ARCH),amd64)
docker rmi ${REGISTRY}/conformance:${VERSION} 2>/dev/null || true
docker tag ${REGISTRY}/conformance-${ARCH}:${VERSION} ${REGISTRY}/conformance:${VERSION}
docker push ${REGISTRY}/conformance:${VERSION}
DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --pull --platform linux/$(ARCH) $(OUTPUT) -t ${REGISTRY}/conformance:${VERSION} ${TEMP_DIR}
endif
rm -rf "${TEMP_DIR}"
push: OUTPUT=--push
push: build
.PHONY: build push all