From 8f211739ae4348b772d2b4d6824facdfaf651fd9 Mon Sep 17 00:00:00 2001 From: Kevin Date: Fri, 3 Jan 2025 10:38:53 -0500 Subject: [PATCH] create builder to use for multiarch Signed-off-by: Kevin --- Makefile | 10 ++++------ cmd/experimental/kueue-viz/frontend/Dockerfile | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 1987efacba..f31f99b2ef 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,6 @@ 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 CLI_PLATFORMS ?= linux/amd64,linux/arm64,darwin/amd64,darwin/arm64 -VIZ_PLATFORMS ?= linux/amd64,linux/arm64,linux/s390x,linux/ppc64le DOCKER_BUILDX_CMD ?= docker buildx IMAGE_BUILD_CMD ?= $(DOCKER_BUILDX_CMD) build IMAGE_BUILD_EXTRA_OPTS ?= @@ -331,14 +330,14 @@ importer-image: PLATFORMS=linux/amd64 importer-image: PUSH=--load importer-image: importer-image-build - # Build the kueue-viz dashboard images (frontend and backend) .PHONY: kueue-viz-image-build kueue-viz-image-build: + 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=$(VIZ_PLATFORMS) \ + --platform=$(PLATFORMS) \ --build-arg BASE_IMAGE=$(BASE_IMAGE) \ --build-arg BUILDER_IMAGE=$(BUILDER_IMAGE) \ --build-arg CGO_ENABLED=$(CGO_ENABLED) \ @@ -347,9 +346,10 @@ 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=$(VIZ_PLATFORMS) \ + --platform=$(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 @@ -357,8 +357,6 @@ 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: PUSH=--load kueue-viz-image: kueue-viz-image-build diff --git a/cmd/experimental/kueue-viz/frontend/Dockerfile b/cmd/experimental/kueue-viz/frontend/Dockerfile index 4319f5e703..55eef478f3 100644 --- a/cmd/experimental/kueue-viz/frontend/Dockerfile +++ b/cmd/experimental/kueue-viz/frontend/Dockerfile @@ -4,7 +4,7 @@ FROM node:23 AS build ENV NPM_CONFIG_CACHE=/tmp/.npm-cache WORKDIR /app COPY package*.json ./ -RUN npm install +RUN npm install -g COPY . . # Build the production-ready static files