From 46c41f893ce1aa9038649c433922f29640d55e46 Mon Sep 17 00:00:00 2001 From: M00nF1sh Date: Tue, 12 Apr 2022 18:51:05 -0700 Subject: [PATCH] fix image name during build (#1968) --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index fe521e48f5..6a76972be1 100644 --- a/Makefile +++ b/Makefile @@ -44,14 +44,18 @@ HELM_CHART_NAME ?= "aws-vpc-cni" TEST_IMAGE = amazon-k8s-cni-test TEST_IMAGE_NAME = $(TEST_IMAGE)$(IMAGE_ARCH_SUFFIX):$(VERSION) +UNAME_ARCH = $(shell uname -m) +ARCH = $(lastword $(subst :, ,$(filter $(UNAME_ARCH):%,x86_64:amd64 aarch64:arm64))) +# This is only applied to the arm64 container image by default. Override to +# provide an alternate suffix or to omit. +IMAGE_ARCH_SUFFIX = $(addprefix -,$(filter $(ARCH),arm64)) + # Mandate usage of docker buildkit as platform arguments are available only with buildkit # Refer to https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope # and https://docs.docker.com/develop/develop-images/build_enhancements/#to-enable-buildkit-builds export DOCKER_BUILDKIT=1 GOARCH = $(TARGETARCH) -# This is only applied to the arm64 container image by default. Override to -# provide an alternate suffix or to omit. -IMAGE_ARCH_SUFFIX = $(addprefix -,$(filter $(GOARCH),arm64)) + # GOLANG_IMAGE is the building golang container image used. GOLANG_IMAGE = public.ecr.aws/docker/library/golang:1.17-stretch # For the requested build, these are the set of Go specific build environment variables.