diff --git a/Makefile b/Makefile index dcd8529fef..a16a1e2e42 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,7 @@ GO_VERSION := $(shell awk '/^go /{print $$2}' go.mod|head -n1) GIT_TAG ?= $(shell git describe --tags --dirty --always) # Image URL to use all building/pushing image targets PLATFORMS ?= linux/amd64,linux/arm64,linux/s390x,linux/ppc64le +VIZ_PLATFORMS ?= linux/amd64,linux/arm64,linux/s390x,linux/ppc64le CLI_PLATFORMS ?= linux/amd64,linux/arm64,darwin/amd64,darwin/arm64 DOCKER_BUILDX_CMD ?= docker buildx IMAGE_BUILD_CMD ?= $(DOCKER_BUILDX_CMD) build @@ -330,15 +331,20 @@ importer-image: PLATFORMS=linux/amd64 importer-image: PUSH=--load importer-image: importer-image-build +# Install multiarch build dependencies and then create a builder instance to build the kueue-viz dashboard images +kueue-viz-image-multiarch: + docker run --privileged --rm tonistiigi/binfmt --install all + BUILDER=$(shell $(DOCKER_BUILDX_CMD) create --use) + $(MAKE) kueue-viz-image-build + $(DOCKER_BUILDX_CMD) rm $$BUILDER + # Build the kueue-viz dashboard images (frontend and backend) .PHONY: kueue-viz-image-build kueue-viz-image-build: - docker run --privileged --rm tonistiigi/binfmt --install all - BUILDER=$(shell $(DOCKER_BUILDX_CMD) create --use) $(IMAGE_BUILD_CMD) \ -t $(IMAGE_REGISTRY)/kueue-viz-backend:$(GIT_TAG) \ -t $(IMAGE_REGISTRY)/kueue-viz-backend:$(RELEASE_BRANCH)-latest \ - --platform=$(PLATFORMS) \ + --platform=$(VIZ_PLATFORMS) \ --build-arg BASE_IMAGE=$(BASE_IMAGE) \ --build-arg BUILDER_IMAGE=$(BUILDER_IMAGE) \ --build-arg CGO_ENABLED=$(CGO_ENABLED) \ @@ -347,10 +353,9 @@ kueue-viz-image-build: $(IMAGE_BUILD_CMD) \ -t $(IMAGE_REGISTRY)/kueue-viz-frontend:$(GIT_TAG) \ -t $(IMAGE_REGISTRY)/kueue-viz-frontend:$(RELEASE_BRANCH)-latest \ - --platform=$(PLATFORMS) \ + --platform=$(VIZ_PLATFORMS) \ $(PUSH) \ -f ./cmd/experimental/kueue-viz/frontend/Dockerfile ./cmd/experimental/kueue-viz/frontend; \ - $(DOCKER_BUILDX_CMD) rm $$BUILDER .PHONY: kueue-viz-image-push kueue-viz-image-push: PUSH=--push @@ -358,6 +363,8 @@ kueue-viz-image-push: kueue-viz-image-build # Build a docker local us-central1-docker.pkg.dev/k8s-staging-images/kueue/kueue-viz image .PHONY: kueue-viz-image +kueue-viz-image: VIZ_PLATFORMS=linux/amd64 +kueue-viz-image: IMAGE_BUILD_EXTRA_OPTS=--load kueue-viz-image: kueue-viz-image-build