Skip to content

Commit

Permalink
Modifying image to use csm-base-image (#688)
Browse files Browse the repository at this point in the history
---------
Co-authored-by: Don Khan <[email protected]>
  • Loading branch information
eric-young authored Feb 5, 2025
1 parent a67dd62 commit 32b6a72
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 44 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@ jobs:
id: go
- name: Checkout the code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build Docker Images
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
DEFAULT_IMG=csm-operator:latest make docker-build
- name: Scan controller Image
uses: aquasecurity/[email protected]
with:
Expand Down
29 changes: 13 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
include docker.mk


# CHANNELS define the bundle channels used in the bundle.
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
# To re-generate a bundle for other specific channels without changing the standard setup, you can:
Expand Down Expand Up @@ -114,18 +113,21 @@ 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 build-base-image ## Build podman image with the manager.
podman build . -t ${DEFAULT_IMG} --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE)
podman-build: gen-semver download-csm-common ## Build podman image with the manager.
$(eval include csm-common.mk)
podman build --pull . -t ${DEFAULT_IMG} --build-arg BASEIMAGE=$(CSM_BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE)

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

podman-push: podman-build ## Builds, tags and pushes docker image with the manager.
podman tag ${DEFAULT_IMG} ${IMG}
podman push ${IMG}

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-build: gen-semver download-csm-common ## Build docker image with the manager.
$(eval include csm-common.mk)
docker build --pull . -t ${DEFAULT_IMG} --build-arg BASEIMAGE=$(CSM_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 @@ -204,8 +206,9 @@ bundle: static-manifests gen-semver kustomize ## Generate bundle manifests and m
operator-sdk bundle validate ./bundle

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


.PHONY: bundle-push
Expand Down Expand Up @@ -256,12 +259,6 @@ 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:
Expand All @@ -270,4 +267,4 @@ download-csm-common:
# build catalog image with File based catalog file
.PHONY: catalog-build-fbc
catalog-build-fbc:
podman build . -f catalog.Dockerfile -t quay.io/community-operator-pipeline-prod/dell-csm-operator-catalog:latest
podman build --pull . -f catalog.Dockerfile -t quay.io/community-operator-pipeline-prod/dell-csm-operator-catalog:latest
23 changes: 0 additions & 23 deletions scripts/build-ubi-micro.sh

This file was deleted.

0 comments on commit 32b6a72

Please sign in to comment.