Skip to content

Commit 4a2663d

Browse files
danehanscoolkp
authored andcommitted
Adds image-load and kind-load Make targets (#288)
Signed-off-by: Daneyon Hansen <[email protected]>
1 parent b6d9d47 commit 4a2663d

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

Makefile

+22-4
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ ifdef IMAGE_EXTRA_TAG
4848
IMAGE_BUILD_EXTRA_OPTS += -t $(IMAGE_EXTRA_TAG)
4949
endif
5050

51+
# The name of the kind cluster to use for the "kind-load" target.
52+
KIND_CLUSTER ?= kind
53+
5154
##@ General
5255

5356
# The help target prints out all targets with their descriptions organized
@@ -136,28 +139,42 @@ verify: vet fmt-verify manifests generate ci-lint
136139

137140
# Build the container image
138141
.PHONY: image-local-build
139-
image-local-build:
142+
image-local-build: ## Build the EPP image using Docker Buildx for local development.
140143
BUILDER=$(shell $(DOCKER_BUILDX_CMD) create --use)
141144
$(MAKE) image-build PUSH=$(PUSH)
145+
$(MAKE) image-build LOAD=$(LOAD)
142146
$(DOCKER_BUILDX_CMD) rm $$BUILDER
143147

144148
.PHONY: image-local-push
145-
image-local-push: PUSH=--push
149+
image-local-push: PUSH=--push ## Build the EPP image for local development and push it to $IMAGE_REPO.
146150
image-local-push: image-local-build
147151

152+
.PHONY: image-local-load
153+
image-local-load: LOAD=--load ## Build the EPP image for local development and load it in the local Docker registry.
154+
image-local-load: image-local-build
155+
148156
.PHONY: image-build
149-
image-build:
157+
image-build: ## Build the EPP image using Docker Buildx.
150158
$(IMAGE_BUILD_CMD) -t $(IMAGE_TAG) \
151159
--platform=$(PLATFORMS) \
152160
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
153161
--build-arg BUILDER_IMAGE=$(BUILDER_IMAGE) \
154162
$(PUSH) \
163+
$(LOAD) \
155164
$(IMAGE_BUILD_EXTRA_OPTS) ./
156165

157166
.PHONY: image-push
158-
image-push: PUSH=--push
167+
image-push: PUSH=--push ## Build the EPP image and push it to $IMAGE_REPO.
159168
image-push: image-build
160169

170+
.PHONY: image-load
171+
image-load: LOAD=--load ## Build the EPP image and load it in the local Docker registry.
172+
image-load: image-build
173+
174+
.PHONY: image-kind
175+
image-kind: image-build ## Build the EPP image and load it to kind cluster $KIND_CLUSTER ("kind" by default).
176+
kind load docker-image $(IMAGE_TAG) --name $(KIND_CLUSTER)
177+
161178
##@ Lora Syncer
162179

163180
.PHONY: syncer-image-local-build
@@ -183,6 +200,7 @@ syncer-image-build:
183200
syncer-image-push: PUSH=--push
184201
syncer-image-push: syncer-image-build
185202

203+
186204
##@ Docs
187205

188206
.PHONY: build-docs

0 commit comments

Comments
 (0)