mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #90400 from zhlhahaha/1737
fix cross build conformance image error
This commit is contained in:
commit
628b413f8e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user