Skip to content

Commit

Permalink
Merge pull request #55 from dell/Update_ubi_dependencies
Browse files Browse the repository at this point in the history
Update ubi dependencies
  • Loading branch information
Sahiba-Gupta authored Jun 11, 2024
2 parents 606f66f + 7a1ec70 commit b3caac2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 7 additions & 1 deletion docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,20 @@ 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)
echo "Building: $(REGISTRY)/$(IMAGENAME):$(MAJOR).$(MINOR).$(PATCH) RELNOTE $(RELNOTE)"
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=mdr-ubimicro:latest)

push:
echo "Pushing MAJOR $(MAJOR) MINOR $(MINOR) PATCH $(PATCH) RELNOTE $(RELNOTE)"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 7 additions & 0 deletions scripts/build_ubi_micro.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b3caac2

Please sign in to comment.