From 7d535c3bc1248fec7f2eb093e3ea374d1c72b67d Mon Sep 17 00:00:00 2001 From: Wesley Hayutin Date: Thu, 6 Feb 2025 18:57:41 -0700 Subject: [PATCH 1/2] Ensure instructions to build work on arm and amd w/o using dockerx builds the normal docker-build, docker-push failed to work properly as the setup documentation stated on ARM clusters. This change simply makes the build work more like oadp-operator. --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 184b367d..fff40c4d 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,13 @@ GOBIN=$(shell go env GOPATH)/bin else GOBIN=$(shell go env GOBIN) endif +OC_CLI ?= $(shell which oc) +TARGETARCH = $(shell $(OC_CLI) get node -o jsonpath='{.items[0].status.nodeInfo.architecture}' 2> /dev/null) + + +# .PHONY: print-arch +# print-arch: ## Print the target architecture +# @echo $(TARGETARCH) # CONTAINER_TOOL defines the container tool to be used for building images. # Be aware that the target commands are only tested with Docker which is @@ -93,7 +100,7 @@ run: manifests generate fmt vet ## Run a controller from your host. # More info: https://docs.docker.com/develop/develop-images/build_enhancements/ .PHONY: docker-build docker-build: ## Build docker image with the manager. - $(CONTAINER_TOOL) build -t ${IMG} . + $(CONTAINER_TOOL) build --platform=linux/${TARGETARCH} -t ${IMG} . .PHONY: docker-push docker-push: ## Push docker image with the manager. From adb126f0b210bc99196dde01c324f18d5c075226 Mon Sep 17 00:00:00 2001 From: Wesley Hayutin Date: Fri, 7 Feb 2025 08:15:04 -0700 Subject: [PATCH 2/2] remove arch printout test --- Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Makefile b/Makefile index fff40c4d..acb13aeb 100644 --- a/Makefile +++ b/Makefile @@ -15,9 +15,6 @@ OC_CLI ?= $(shell which oc) TARGETARCH = $(shell $(OC_CLI) get node -o jsonpath='{.items[0].status.nodeInfo.architecture}' 2> /dev/null) -# .PHONY: print-arch -# print-arch: ## Print the target architecture -# @echo $(TARGETARCH) # CONTAINER_TOOL defines the container tool to be used for building images. # Be aware that the target commands are only tested with Docker which is