Skip to content

Commit 43d3027

Browse files
author
Ray Wainman
committed
small tweaks to makefile to ensure it works in Cloud Build
1 parent a992141 commit 43d3027

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

cluster-autoscaler/Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LDFLAGS?=-s
77
ENVVAR=CGO_ENABLED=0
88
GOOS?=linux
99
GOARCH?=$(shell go env GOARCH)
10-
REGISTRY?=staging-k8s.gcr.io
10+
REGISTRY?=us-central1-docker.pkg.dev/rwainman-gke-dev/cluster-autoscaler
1111
DOCKER_NETWORK?=default
1212
SUPPORTED_BUILD_TAGS=$(shell ls cloudprovider/builder/ | grep -e '^builder_.*\.go' | sed 's/builder_\(.*\)\.go/\1/')
1313
ifdef BUILD_TAGS
@@ -64,7 +64,8 @@ dev-release-arch-%: build-arch-% make-image-arch-% push-image-arch-%
6464
make-image: make-image-arch-$(GOARCH)
6565

6666
make-image-arch-%:
67-
GOOS=$(GOOS) GOARCH=$* docker buildx build --pull --platform linux/$* \
67+
GOOS=$(GOOS) docker buildx build --pull --platform linux/$* \
68+
--build-arg "GOARCH=$*" \
6869
-t ${IMAGE}-$*:${TAG} \
6970
-f Dockerfile .
7071
@echo "Image ${TAG}${FOR_PROVIDER}-$* completed"
@@ -74,12 +75,15 @@ push-image: push-image-arch-$(GOARCH)
7475
push-image-arch-%:
7576
./push_image.sh ${IMAGE}-$*:${TAG}
7677

78+
push-release-image-arch-%:
79+
docker push ${IMAGE}-$*:${TAG}
80+
7781
push-manifest:
7882
docker manifest create ${IMAGE}:${TAG} \
7983
$(addprefix $(REGISTRY)/cluster-autoscaler$(PROVIDER)-, $(addsuffix :$(TAG), $(ALL_ARCH)))
8084
docker manifest push --purge ${IMAGE}:${TAG}
8185

82-
execute-release: $(addprefix make-image-arch-,$(ALL_ARCH)) $(addprefix push-image-arch-,$(ALL_ARCH)) push-manifest
86+
execute-release: $(addprefix make-image-arch-,$(ALL_ARCH)) $(addprefix push-release-image-arch-,$(ALL_ARCH)) push-manifest
8387
@echo "Release ${TAG}${FOR_PROVIDER} completed"
8488

8589
clean: clean-arch-$(GOARCH)

0 commit comments

Comments
 (0)