@@ -19,6 +19,10 @@ include $(ROOT_DIR_RELATIVE)/common.mk
19
19
# If you update this file, please follow
20
20
# https://suva.sh/posts/well-documented-makefiles
21
21
22
+ # Go
23
+ GO_VERSION ?=1.20.6
24
+ GO_CONTAINER_IMAGE ?= public.ecr.aws/docker/library/golang:$(GO_VERSION )
25
+
22
26
# Directories.
23
27
ARTIFACTS ?= $(REPO_ROOT ) /_artifacts
24
28
TOOLS_DIR := hack/tools
@@ -350,7 +354,7 @@ clusterawsadm: ## Build clusterawsadm binary
350
354
351
355
.PHONY : docker-build
352
356
docker-build : docker-pull-prerequisites # # Build the docker image for controller-manager
353
- docker build --build-arg ARCH=$(ARCH ) --build-arg LDFLAGS=" $( LDFLAGS) " . -t $(CORE_CONTROLLER_IMG ) -$(ARCH ) :$(TAG )
357
+ docker build --build-arg ARCH=$(ARCH ) --build-arg builder_image= $( GO_CONTAINER_IMAGE ) --build-arg LDFLAGS=" $( LDFLAGS) " . -t $(CORE_CONTROLLER_IMG ) -$(ARCH ) :$(TAG )
354
358
355
359
.PHONY : docker-build-all # # Build all the architecture docker images
356
360
docker-build-all : $(addprefix docker-build-,$(ALL_ARCH ) )
@@ -383,7 +387,7 @@ generate-test-flavors: $(KUSTOMIZE) ## Generate test template flavors
383
387
384
388
.PHONY : e2e-image
385
389
e2e-image : docker-pull-prerequisites $(TOOLS_BIN_DIR ) /start.sh $(TOOLS_BIN_DIR ) /restart.sh # # Build an e2e test image
386
- docker build -f Dockerfile --tag=" gcr.io/k8s-staging-cluster-api/capa-manager:e2e" .
390
+ docker build --build-arg builder_image= $( GO_CONTAINER_IMAGE ) - f Dockerfile --tag=" gcr.io/k8s-staging-cluster-api/capa-manager:e2e" .
387
391
388
392
.PHONY : install-setup-envtest
389
393
install-setup-envtest : # Install setup-envtest so that setup-envtest's eval is executed after the tool has been installed.
@@ -462,7 +466,7 @@ $(RELEASE_DIR):
462
466
463
467
.PHONY : build-toolchain
464
468
build-toolchain : # # Build the toolchain
465
- docker build --target toolchain -t $(TOOLCHAIN_IMAGE ) .
469
+ docker build --build-arg builder_image= $( GO_CONTAINER_IMAGE ) -- target toolchain -t $(TOOLCHAIN_IMAGE ) .
466
470
467
471
.PHONY : check-github-token
468
472
check-github-token : # # Check if the github token is set
@@ -690,3 +694,8 @@ clean-temporary: ## Remove all temporary files and folders
690
694
rm -rf test/e2e/capi-kubeadm-control-plane-controller-manager
691
695
rm -rf test/e2e/logs
692
696
rm -rf test/e2e/resources
697
+
698
+ # #@ helpers:
699
+
700
+ go-version : # # Print the go version we use to compile our binaries and images
701
+ @echo $(GO_VERSION )
0 commit comments