Skip to content

Commit

Permalink
Use CSM common base image. (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
donatwork authored Jan 28, 2025
1 parent 171abbc commit d425d89
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 35 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ jobs:
run: go mod download
- name: Build csm-metrics-powerstore Docker Image
run: |
chmod +x ./scripts/build_ubi_micro.sh
make build-base-image
podman build -t docker.io/csm-metrics-powerstore -f ./Dockerfile --build-arg GOIMAGE=golang:latest --build-arg BASEIMAGE="localhost/mpst-ubimicro"
podman build -t docker.io/csm-metrics-powerstore -f ./Dockerfile --build-arg GOIMAGE=golang:latest --build-arg BASEIMAGE="quay.io/dell/container-storage-modules/csm-base-image:nightly"
podman save docker.io/library/csm-metrics-powerstore -o /tmp/csm-metrics-powerstore.tar
docker load -i /tmp/csm-metrics-powerstore.tar
- name: Run Trivy action
Expand Down
16 changes: 4 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ help:
@echo

.PHONY: build
build:
build:
@$(foreach svc,$(shell ls cmd), CGO_ENABLED=0 GOOS=linux go build -o ./cmd/${svc}/bin/service ./cmd/${svc}/;)

.PHONY: clean
Expand All @@ -29,18 +29,10 @@ generate:
test:
go test -count=1 -cover -race -timeout 30s -short ./...

.PHONY: build-base-image
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=mpst-ubimicro:latest)

# Pre-requisites: RHEL, buildah, podman
.PHONY: podman
podman: build-base-image
podman build $(NOCACHE) -t csm-metrics-powerstore -f Dockerfile --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) .
podman: download-csm-common
$(eval include csm-common.mk)
podman build --pull $(NOCACHE) -t csm-metrics-powerstore -f Dockerfile --build-arg BASEIMAGE=$(CSM_BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) .

.PHONY: podman-no-cache
podman-no-cache:
Expand Down
20 changes: 0 additions & 20 deletions scripts/build_ubi_micro.sh

This file was deleted.

0 comments on commit d425d89

Please sign in to comment.