From 60908d4669a470fc35292fed7d153718aed9a9b3 Mon Sep 17 00:00:00 2001 From: Jared Watts Date: Wed, 17 Sep 2025 13:46:04 -0700 Subject: [PATCH] build: enable multi-platform image publishing again This used to work with the old build submodule and image.mk. With crossplane/build and imagelight.mk, we need to do the following: - use --platform $(IMAGE_PLATFORMS) for docker buildx to build for all platforms - copy all architectures of the compiled test binary to IMAGE_TEMP_DIR - copy specific compiled conformance test binary in Dockerfile Signed-off-by: Jared Watts --- cluster/images/conformance/Dockerfile | 5 ++++- cluster/images/conformance/Makefile | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cluster/images/conformance/Dockerfile b/cluster/images/conformance/Dockerfile index b602980..4553fdb 100644 --- a/cluster/images/conformance/Dockerfile +++ b/cluster/images/conformance/Dockerfile @@ -3,8 +3,11 @@ WORKDIR /go RUN go get -u github.com/jstemmer/go-junit-report@v0.9.1 FROM BASEIMAGE +ARG TARGETOS +ARG TARGETARCH + COPY --from=0 /go/bin/go-junit-report /usr/local/bin/ -ADD conformance /usr/local/bin/ +COPY tests/${TARGETOS}_${TARGETARCH}/tests /usr/local/bin/conformance ADD run.sh /usr/local/bin/ EXPOSE 8080 USER 65532 diff --git a/cluster/images/conformance/Makefile b/cluster/images/conformance/Makefile index 0437539..fd9c442 100755 --- a/cluster/images/conformance/Makefile +++ b/cluster/images/conformance/Makefile @@ -32,11 +32,11 @@ endif img.build.shared: @cp Dockerfile $(IMAGE_TEMP_DIR) || $(FAIL) - @cp $(OUTPUT_DIR)/tests/linux_$(ARCH)/tests $(IMAGE_TEMP_DIR)/conformance || $(FAIL) + @cp -r $(OUTPUT_DIR)/tests/ $(IMAGE_TEMP_DIR)/tests || $(FAIL) @cp ../../../run.sh $(IMAGE_TEMP_DIR) || $(FAIL) @cd $(IMAGE_TEMP_DIR) && $(SED_CMD) 's|BASEIMAGE|$(OSBASEIMAGE)|g' Dockerfile || $(FAIL) @docker buildx build $(BUILD_ARGS) \ - --platform linux/$(ARCH) \ + --platform $(IMAGE_PLATFORMS) \ -t $(IMAGE) \ $(IMAGE_TEMP_DIR) || $(FAIL)