Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating ubi micro dependencies #594

Merged
merged 3 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,17 @@ jobs:
- name: Checkout the code
uses: actions/checkout@v4
- name: Build Docker Images
run: DEFAULT_IMG=csm-operator:latest make -o gen-semver docker-build
run: |
chmod +x ./scripts/build-ubi-micro.sh
make build-base-image
make -o gen-semver
podman build -t docker.io/csm-operator -f ./Dockerfile --build-arg GOIMAGE=golang:latest --build-arg BASEIMAGE="localhost/csm-operator-ubimicro"
podman save docker.io/library/csm-operator -o /tmp/csm-operator.tar
docker load -i /tmp/csm-operator.tar
- name: Scan controller Image
uses: Azure/container-scan@v0
env:
DOCKLE_HOST: "unix:///var/run/docker.sock"
with:
image-name: csm-operator:latest
image-name: csm-operator
severity-threshold: HIGH
24 changes: 14 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,11 @@ build: gen-semver fmt vet ## Build manager binary.
run: generate gen-semver fmt vet static-manifests ## Run a controller from your host.
go run ./main.go

podman-build: gen-semver download-csm-common ## Build podman image with the manager.
$(eval include csm-common.mk)
podman build . -t ${DEFAULT_IMG} --build-arg BASEIMAGE=$(DEFAULT_BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE)
podman-build: gen-semver build-base-image ## Build podman image with the manager.
podman build . -t ${DEFAULT_IMG} --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE)

docker-build: gen-semver download-csm-common ## Build docker image with the manager.
$(eval include csm-common.mk)
docker build . -t ${DEFAULT_IMG} --build-arg BASEIMAGE=$(DEFAULT_BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE)
docker-build: gen-semver build-base-image ## Build docker image with the manager.
docker build . -t ${DEFAULT_IMG} --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE)

docker-push: docker-build ## Builds, tags and pushes docker image with the manager.
docker tag ${DEFAULT_IMG} ${IMG}
Expand Down Expand Up @@ -166,9 +164,9 @@ bundle: static-manifests gen-semver kustomize ## Generate bundle manifests and m
operator-sdk bundle validate ./bundle

.PHONY: bundle-build
bundle-build: gen-semver download-csm-common ## Build the bundle image.
$(eval include csm-common.mk)
docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) --build-arg BASEIMAGE=$(DEFAULT_BASEIMAGE) .
bundle-build: gen-semver build-base-image ## Build the bundle image.
docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) --build-arg BASEIMAGE=$(BASEIMAGE) .


.PHONY: bundle-push
bundle-push: gen-semver ## Push the bundle image.
Expand Down Expand Up @@ -217,7 +215,13 @@ catalog-push: gen-semver ## Push a catalog image.
lint: build
golangci-lint run --fix

.PHONY: build-base-image
build-base-image: download-csm-common
$(eval include csm-common.mk)
sh ./scripts/build-ubi-micro.sh $(DEFAULT_BASEIMAGE)
$(eval BASEIMAGE=csm-operator-ubimicro:latest)

# Download common CSM configuration file used for builds
.PHONY: download-csm-common
download-csm-common:
curl -O -L https://raw.githubusercontent.com/dell/csm/main/config/csm-common.mk
curl -O -L https://raw.githubusercontent.com/dell/csm/main/config/csm-common.mk
8 changes: 8 additions & 0 deletions scripts/build-ubi-micro.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/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 -y
dnf clean all --installroot $micromount
buildah umount $microcontainer
buildah commit $microcontainer csm-operator-ubimicro
Loading