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

Modifying image to use csm-base-image #688

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
8 changes: 3 additions & 5 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,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
27 changes: 11 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,19 @@ 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.
podman build . -t ${DEFAULT_IMG} --build-arg BASEIMAGE=$(DEFAULT_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.
podman build --no-cache . -t ${DEFAULT_IMG} --build-arg BASEIMAGE=$(DEFAULT_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 . -t ${DEFAULT_IMG} --build-arg BASEIMAGE=$(DEFAULT_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 +204,8 @@ 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.
docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) --build-arg BASEIMAGE=$(DEFAULT_BASEIMAGE) .


.PHONY: bundle-push
Expand Down Expand Up @@ -255,13 +255,8 @@ 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/base-image-improvements/config/csm-common.mk
$(eval include csm-common.mk)
23 changes: 0 additions & 23 deletions scripts/build-ubi-micro.sh

This file was deleted.

Loading