From 2ca3d2c0f910e60cb6ae33a9db197959c749f3f8 Mon Sep 17 00:00:00 2001 From: Sahiba_G Date: Thu, 6 Jun 2024 03:19:27 +0000 Subject: [PATCH 1/4] KRV-24639: Add RPM --- Makefile | 2 +- docker.mk | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 74d476f..377e384 100644 --- a/Makefile +++ b/Makefile @@ -71,7 +71,7 @@ clean: # Generates the docker container (but does not push) docker: go generate . - make -f docker.mk DOCKER_FILE=docker-files/Dockerfile docker + make -f docker.mk DOCKER_FILE=docker-files/Dockerfile build-base-image docker # Same as `docker` but without cached layers and will pull latest version of base image docker-no-cache: diff --git a/docker.mk b/docker.mk index 4cd9481..299eaf8 100644 --- a/docker.mk +++ b/docker.mk @@ -22,7 +22,7 @@ docker: download-csm-common $(eval include csm-common.mk) echo "Building: $(REGISTRY)/$(IMAGENAME):v$(MAJOR).$(MINOR).$(PATCH) RELNOTE $(RELNOTE)" echo "$(DOCKER_FILE)" - $(BUILDER) build -f $(DOCKER_FILE) -t "$(REGISTRY)/$(IMAGENAME):v$(MAJOR).$(MINOR).$(PATCH)$(RELNOTE)" --build-arg BASEIMAGE=$(DEFAULT_BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) . + $(BUILDER) build -f $(DOCKER_FILE) -t "$(REGISTRY)/$(IMAGENAME):v$(MAJOR).$(MINOR).$(PATCH)$(RELNOTE)" --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) . docker-no-cache: download-csm-common $(eval include csm-common.mk) @@ -30,6 +30,12 @@ docker-no-cache: download-csm-common echo "$(DOCKER_FILE) --no-cache" $(BUILDER) build --no-cache --pull -f $(DOCKER_FILE) -t "$(REGISTRY)/$(IMAGENAME):v$(MAJOR).$(MINOR).$(PATCH)$(RELNOTE)" --build-arg BASEIMAGE=$(DEFAULT_BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) . +build-base-image: download-csm-common + $(eval include csm-common.mk) + @echo "Building base image from $(DEFAULT_BASEIMAGE) and loading dependencies..." + ./scripts/build_ubi_micro.sh $(DEFAULT_BASEIMAGE) + @echo "Base image build: SUCCESS" + $(eval BASEIMAGE=localhost/mdr-ubimicro:latest) push: echo "Pushing MAJOR $(MAJOR) MINOR $(MINOR) PATCH $(PATCH) RELNOTE $(RELNOTE)" From 65419b91a32773a73585d2a1b5c508def24d238c Mon Sep 17 00:00:00 2001 From: Sahiba_G Date: Thu, 6 Jun 2024 03:22:15 +0000 Subject: [PATCH 2/4] KRV-24639: Add RPM --- scripts/build_ubi_micro.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 scripts/build_ubi_micro.sh diff --git a/scripts/build_ubi_micro.sh b/scripts/build_ubi_micro.sh new file mode 100755 index 0000000..577f8d1 --- /dev/null +++ b/scripts/build_ubi_micro.sh @@ -0,0 +1,7 @@ +#!/bin/bash +microcontainer=$(buildah from $1) +micromount=$(buildah mount $microcontainer) +dnf install --installroot $micromount --releasever=8 --nodocs --setopt install_weak_deps=false --setopt=reposdir=/etc/yum.repos.d/ rpm tar gzip -y +dnf clean all --installroot $micromount +buildah umount $microcontainer +buildah commit $microcontainer mdr-ubimicro From 2a344fc9ae94c06d09ed063e68ff3813cefb806e Mon Sep 17 00:00:00 2001 From: Sahiba_G Date: Thu, 6 Jun 2024 03:23:04 +0000 Subject: [PATCH 3/4] KRV-24639: Add RPM --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 2e9133d..bf444d3 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/dell/csi-metadata-retriever -go 1.22 +go 1.22.0 require ( github.com/dell/gocsi v1.10.1 From 795e83ddb87b830b0577ec2a4d79933c6f40b518 Mon Sep 17 00:00:00 2001 From: Sahiba_G Date: Thu, 6 Jun 2024 18:48:57 +0000 Subject: [PATCH 4/4] remove localhost --- docker.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker.mk b/docker.mk index 299eaf8..a83936e 100644 --- a/docker.mk +++ b/docker.mk @@ -35,7 +35,7 @@ build-base-image: download-csm-common @echo "Building base image from $(DEFAULT_BASEIMAGE) and loading dependencies..." ./scripts/build_ubi_micro.sh $(DEFAULT_BASEIMAGE) @echo "Base image build: SUCCESS" - $(eval BASEIMAGE=localhost/mdr-ubimicro:latest) + $(eval BASEIMAGE=mdr-ubimicro:latest) push: echo "Pushing MAJOR $(MAJOR) MINOR $(MINOR) PATCH $(PATCH) RELNOTE $(RELNOTE)"