Skip to content

Commit

Permalink
Added no cache build
Browse files Browse the repository at this point in the history
  • Loading branch information
francis-nijay committed Sep 3, 2024
1 parent 9e0aab1 commit d0db646
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ build: dependencies
docker: dependencies
make -f docker.mk build-base-image docker

# Generates the docker container with no cache (but does not push)
docker-no-cache: dependencies
make -f docker.mk build-base-image docker-no-cache

# Pushes container to the repository
push: docker
make -f docker.mk push
Expand Down
10 changes: 10 additions & 0 deletions docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ docker:
@echo "Building: $(REGISTRY)/$(IMAGENAME):$(IMAGETAG)"
$(BUILDER) build -t "$(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" --target $(BUILDSTAGE) --build-arg GOPROXY --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) .

docker-no-cache:
@echo "Base Images is set to: $(BASEIMAGE)"
@echo "Building: $(REGISTRY)/$(IMAGENAME):$(IMAGETAG)"
$(BUILDER) build --no-cache -t "$(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" --target $(BUILDSTAGE) --build-arg GOPROXY --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) .

docker-no-cache:
@echo "Base Images is set to: $(BASEIMAGE)"
@echo "Building: $(REGISTRY)/$(IMAGENAME):$(IMAGETAG)"
$(BUILDER) build --no-cache -t "$(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" --target $(BUILDSTAGE) --build-arg GOPROXY --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) .

push:
@echo "Pushing: $(REGISTRY)/$(IMAGENAME):$(IMAGETAG)"
$(BUILDER) push "$(REGISTRY)/$(IMAGENAME):$(IMAGETAG)"
Expand Down

0 comments on commit d0db646

Please sign in to comment.