mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +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
|
BASEIMAGE=debian:stretch-slim
|
||||||
TEMP_DIR:=$(shell mktemp -d -t conformanceXXXXXX)
|
TEMP_DIR:=$(shell mktemp -d -t conformanceXXXXXX)
|
||||||
|
|
||||||
|
#output format for docker buildx build [push, load]
|
||||||
|
OUTPUT=--load
|
||||||
|
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@ -56,15 +59,14 @@ endif
|
|||||||
|
|
||||||
cd ${TEMP_DIR} && sed -i.back "s|BASEIMAGE|${BASEIMAGE}|g" Dockerfile
|
cd ${TEMP_DIR} && sed -i.back "s|BASEIMAGE|${BASEIMAGE}|g" Dockerfile
|
||||||
|
|
||||||
docker build --pull -t ${REGISTRY}/conformance-${ARCH}:${VERSION} ${TEMP_DIR}
|
DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --pull --platform linux/$(ARCH) $(OUTPUT) -t ${REGISTRY}/conformance-${ARCH}:${VERSION} ${TEMP_DIR}
|
||||||
rm -rf "${TEMP_DIR}"
|
|
||||||
|
|
||||||
push: build
|
|
||||||
docker push ${REGISTRY}/conformance-${ARCH}:${VERSION}
|
|
||||||
ifeq ($(ARCH),amd64)
|
ifeq ($(ARCH),amd64)
|
||||||
docker rmi ${REGISTRY}/conformance:${VERSION} 2>/dev/null || true
|
docker rmi ${REGISTRY}/conformance:${VERSION} 2>/dev/null || true
|
||||||
docker tag ${REGISTRY}/conformance-${ARCH}:${VERSION} ${REGISTRY}/conformance:${VERSION}
|
DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --pull --platform linux/$(ARCH) $(OUTPUT) -t ${REGISTRY}/conformance:${VERSION} ${TEMP_DIR}
|
||||||
docker push ${REGISTRY}/conformance:${VERSION}
|
|
||||||
endif
|
endif
|
||||||
|
rm -rf "${TEMP_DIR}"
|
||||||
|
|
||||||
|
push: OUTPUT=--push
|
||||||
|
push: build
|
||||||
|
|
||||||
.PHONY: build push all
|
.PHONY: build push all
|
||||||
|
Loading…
Reference in New Issue
Block a user