From 3eb59aac76c444155c22d32f02ea0de53ab0d992 Mon Sep 17 00:00:00 2001 From: Trevor Dawe Date: Tue, 14 Nov 2023 08:36:28 -0400 Subject: [PATCH] Use common base image (#231) --- docker.mk | 12 ++++++++---- overrides.mk | 9 --------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/docker.mk b/docker.mk index b9b15aae..eb7484bd 100644 --- a/docker.mk +++ b/docker.mk @@ -8,10 +8,11 @@ docker-build-image-push: @echo "Pushing: $(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" docker push "$(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" -podman-build: - @echo "Base Image is set to: $(BASEIMAGE)" - @echo "Adding Driver dependencies to $(BASEIMAGE)" - bash ./buildubimicro.sh $(BASEIMAGE) +podman-build: download-csm-common + $(eval include csm-common.mk) + @echo "Base Image is set to: $(DEFAULT_BASEIMAGE)" + @echo "Adding Driver dependencies to $(DEFAULT_BASEIMAGE)" + bash ./buildubimicro.sh $(DEFAULT_BASEIMAGE) @echo "Base image build: SUCCESS" $(eval BASEIMAGE=localhost/csipowerscale-ubimicro:latest) @echo "Building: $(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" $(BUILDER) build -t "$(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" -f Dockerfile.podman --target $(BUILDSTAGE) --build-arg GOPROXY=$(GOPROXY) --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOVERSION=$(GOVERSION) . @@ -23,3 +24,6 @@ podman-build-image-push: version: @echo "MAJOR $(MAJOR) MINOR $(MINOR) PATCH $(PATCH) BUILD ${BUILD} TYPE ${TYPE} RELNOTE $(RELNOTE) SEMVER $(SEMVER)" @echo "Target Version: $(VERSION)" + +download-csm-common: + curl -O -L https://raw.githubusercontent.com/dell/csm/main/config/csm-common.mk \ No newline at end of file diff --git a/overrides.mk b/overrides.mk index e790b29d..bee53190 100644 --- a/overrides.mk +++ b/overrides.mk @@ -15,8 +15,6 @@ # # DEFAULT values -# ubi9/ubi-micro:9.2-13 -DEFAULT_BASEIMAGE="registry.access.redhat.com/ubi9/ubi-micro@sha256:630cf7bdef807f048cadfe7180d6c27eb3aaa99323ffc3628811da230ed3322a" DEFAULT_GOVERSION="1.21" DEFAULT_REGISTRY="" DEFAULT_IMAGENAME="isilon" @@ -27,11 +25,6 @@ endif DEFAULT_IMAGETAG=$(BUILD_TIMESTAMP) DEFAULT_GOPROXY="" -# set the BASEIMAGE if needed -ifeq ($(BASEIMAGE),) -export BASEIMAGE="$(DEFAULT_BASEIMAGE)" -endif - # set the GOVERSION if needed ifeq ($(GOVERSION),) export GOVERSION="$(DEFAULT_GOVERSION)" @@ -76,8 +69,6 @@ overrides-help: @echo @echo "GOVERSION - The version of Go to build with, default is: $(DEFAULT_GOVERSION)" @echo " Current setting is: $(GOVERSION)" - @echo "BASEIMAGE - The base container image to build from, default is: $(DEFAULT_BASEIMAGE)" - @echo " Current setting is: $(BASEIMAGE)" @echo "REGISTRY - The registry to push images to, default is: $(DEFAULT_REGISTRY)" @echo " Current setting is: $(REGISTRY)" @echo "IMAGENAME - The image name to be built, defaut is: $(DEFAULT_IMAGENAME)"