Skip to content

Commit fd9a15d

Browse files
committed
Adds image-load and kind-load Make targets
Signed-off-by: Daneyon Hansen <[email protected]>
1 parent db21e9e commit fd9a15d

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

Makefile

+21-4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ ifdef IMAGE_EXTRA_TAG
4444
IMAGE_BUILD_EXTRA_OPTS += -t $(IMAGE_EXTRA_TAG)
4545
endif
4646

47+
# The name of the kind cluster to use for the "kind-load" target.
48+
KIND_CLUSTER ?= kind
49+
4750
##@ General
4851

4952
# The help target prints out all targets with their descriptions organized
@@ -132,28 +135,42 @@ verify: vet fmt-verify manifests generate ci-lint
132135

133136
# Build the container image
134137
.PHONY: image-local-build
135-
image-local-build:
138+
image-local-build: ## Build the EPP image using Docker Buildx for local development.
136139
BUILDER=$(shell $(DOCKER_BUILDX_CMD) create --use)
137140
$(MAKE) image-build PUSH=$(PUSH)
141+
$(MAKE) image-build LOAD=$(LOAD)
138142
$(DOCKER_BUILDX_CMD) rm $$BUILDER
139143

140144
.PHONY: image-local-push
141-
image-local-push: PUSH=--push
145+
image-local-push: PUSH=--push ## Build the EPP image for local development and push it to $IMAGE_REPO.
142146
image-local-push: image-local-build
143147

148+
.PHONY: image-local-load
149+
image-local-load: LOAD=--load ## Build the EPP image for local development and load it in the local Docker registry.
150+
image-local-load: image-local-build
151+
144152
.PHONY: image-build
145-
image-build:
153+
image-build: ## Build the EPP image using Docker Buildx.
146154
$(IMAGE_BUILD_CMD) -t $(IMAGE_TAG) \
147155
--platform=$(PLATFORMS) \
148156
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
149157
--build-arg BUILDER_IMAGE=$(BUILDER_IMAGE) \
150158
$(PUSH) \
159+
$(LOAD) \
151160
$(IMAGE_BUILD_EXTRA_OPTS) ./
152161

153162
.PHONY: image-push
154-
image-push: PUSH=--push
163+
image-push: PUSH=--push ## Build the EPP image and push it to $IMAGE_REPO.
155164
image-push: image-build
156165

166+
.PHONY: image-load
167+
image-load: LOAD=--load ## Build the EPP image and load it in the local Docker registry.
168+
image-load: image-build
169+
170+
.PHONY: image-kind
171+
image-kind: image-build ## Build the EPP image and load it to kind cluster $KIND_CLUSTER ("kind" by default).
172+
kind load docker-image $(IMAGE_TAG) --name $(KIND_CLUSTER)
173+
157174
##@ Docs
158175

159176
.PHONY: build-docs

0 commit comments

Comments
 (0)