From b74a818eb0dca5b424753964614e0c2a1a468b1e Mon Sep 17 00:00:00 2001 From: Abhishek Choudhary Date: Fri, 30 Aug 2024 12:39:15 +0545 Subject: [PATCH] set arch based on CPU --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile b/Makefile index 3bcd504a8..cf2366c0d 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,16 @@ image_tag="20.04" endif # Set arch to linux/amd64 if it's not defined arch ?= linux/amd64 + +# Detect the CPU architecture +CPU_ARCH := $(shell uname -m) +# Map the architecture to Docker platform +ifeq ($(CPU_ARCH), arm64) + arch := linux/arm64 +else ifeq ($(CPU_ARCH), aarch64) + arch := linux/arm64 +endif + buildx=0 cache_from=type=local,src=/tmp/.buildx-cache cache_to=type=local,dest=/tmp/.buildx-cache