Skip to content

Commit

Permalink
Merge pull request #278 from dell/build-no-cache
Browse files Browse the repository at this point in the history
Added make target to build without cache
  • Loading branch information
francis-nijay authored Sep 6, 2024
2 parents 0290535 + fda7e48 commit 651ba20
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ build: dependencies check
podman-build:
make -f docker.mk podman-build

# Generates the docker container without using cache(but does not push)
podman-build-no-cache:
make -f docker.mk podman-build-no-cache

dev-build: build
make -f docker.mk docker-build

Expand Down
6 changes: 5 additions & 1 deletion docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ podman-build: download-csm-common
@echo "Base image build: SUCCESS" $(eval BASEIMAGE=localhost/csipowerscale-ubimicro:latest)
@echo "Building: $(REGISTRY)/$(IMAGENAME):$(IMAGETAG)"
@echo "Using Golang Image $(DEFAULT_GOIMAGE)"
$(BUILDER) build -t "$(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" -f Dockerfile.podman --target $(BUILDSTAGE) --build-arg GOPROXY=$(GOPROXY) --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) .
$(BUILDER) build $(NOCACHE) -t "$(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" -f Dockerfile.podman --target $(BUILDSTAGE) --build-arg GOPROXY=$(GOPROXY) --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) .

podman-build-no-cache:
@echo "Building with --no-cache ..."
@make podman-build NOCACHE=--no-cache

podman-build-image-push:
@echo "Pushing: $(REGISTRY)/$(IMAGENAME):$(IMAGETAG)"
Expand Down

0 comments on commit 651ba20

Please sign in to comment.