From ba19450fb9addd33e91027f74c85fea055340dc7 Mon Sep 17 00:00:00 2001 From: Shubham Rajvanshi Date: Tue, 17 Oct 2023 23:21:13 -0700 Subject: [PATCH] PCP-2001: updated builder image and makefile --- Dockerfile | 3 ++- Makefile | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b35268417..68597ed41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ +ARG BUILDER_GOLANG_VERSION # Build the manager binary -FROM --platform=linux/amd64 gcr.io/spectro-images-public/golang:1.19-alpine as builder +FROM --platform=linux/amd64 gcr.io/spectro-images-public/golang:${BUILDER_GOLANG_VERSION}-alpine as builder ARG HELM=./bin/helm-linux-amd64 ARG HELM_CHART=./bin/vcluster-0.13.0.tgz diff --git a/Makefile b/Makefile index 4b6dd651c..5c1b3feec 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,14 @@ .DEFAULT_GOAL:=help +BUILDER_GOLANG_VERSION ?= 1.21 +BUILD_DATE:=$(shell date +%Y%m%d) IMG_NAME ?= cluster-api-virtual-controller -IMG_URL ?= gcr.io/spectro-dev-public/release/cluster-api-virtual -IMG_TAG ?= v0.1.3-spectro-20221213 +# IMG_URL ?= gcr.io/spectro-images-public/release/cluster-api-virtual/ +IMG_URL ?= gcr.io/spectro-common-dev/${USER}/cluster-api-virtual +IMG_TAG ?= v0.1.3-spectro-${BUILD_DATE} IMG ?= $(IMG_URL)/$(IMG_NAME):$(IMG_TAG) +BUILD_ARGS = --build-arg CRYPTO_LIB=${FIPS_ENABLE} --build-arg BUILDER_GOLANG_VERSION=${BUILDER_GOLANG_VERSION} # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. ENVTEST_K8S_VERSION = 1.23 @@ -87,7 +91,7 @@ run: manifests generate fmt vet ## Run a controller from your host. .PHONY: docker-build docker-build: binaries ## Build docker image with the manager. - docker build -t ${IMG} . + docker build ${BUILD_ARGS} -t ${IMG} . .PHONY: docker-push docker-push: ## Push docker image with the manager.