From 88fda3b1435e4d87d1220d9bfde81e27bd03941c Mon Sep 17 00:00:00 2001 From: Devansh Sehgal Date: Tue, 7 Oct 2025 06:24:40 +0530 Subject: [PATCH] Add buildx multi-arch build target to backup/pvc Makefile Introduce PLATFORMS default (arm64, amd64, s390x, ppc64le) and a docker-buildx target to build and push multi-arch images (IMG=...). The target generates a Dockerfile.cross with platform support, creates and uses a buildx builder, passes UID/GID build args, and cleans up. Mirrors the root Makefile to enable cross-arch image builds. Fixes #1124 --- backup/pvc/Makefile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/backup/pvc/Makefile b/backup/pvc/Makefile index 4999ae7a..8ac19c5d 100644 --- a/backup/pvc/Makefile +++ b/backup/pvc/Makefile @@ -186,3 +186,18 @@ endif @echo "Dependencies:" dep status @echo + +# Multi-arch (buildx) support mirroring root Makefile +PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le + +.PHONY: docker-buildx +docker-buildx: check-env ## Build and push multi-arch image (set IMG=quay.io/...:tag) + @echo "+ $@" + sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross + - docker buildx create --name backup-pvc-builder + docker buildx use backup-pvc-builder + - docker buildx build --push --platform=$(PLATFORMS) \ + --build-arg UID=$(UID) --build-arg GID=$(GID) \ + --tag ${IMG} -f Dockerfile.cross . + - docker buildx rm backup-pvc-builder + rm Dockerfile.cross