Skip to content

Commit 6ff7a19

Browse files
adarshagrawal38kfswain
authored andcommitted
Clean up
1 parent 7d7390a commit 6ff7a19

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

Makefile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ SHELL = /usr/bin/env bash -o pipefail
2323

2424
GIT_COMMIT_SHA ?= "$(shell git rev-parse HEAD 2>/dev/null)"
2525
GIT_TAG ?= $(shell git describe --tags --dirty --always)
26-
PLATFORMS ?= linux/amd64,linux/arm64
26+
PLATFORMS ?= linux/amd64
2727
DOCKER_BUILDX_CMD ?= docker buildx
2828
IMAGE_BUILD_CMD ?= $(DOCKER_BUILDX_CMD) build
2929
IMAGE_BUILD_EXTRA_OPTS ?=
@@ -192,23 +192,26 @@ image-local-load: image-local-build
192192

193193
.PHONY: image-build
194194
image-build: ## Build the EPP image using Docker Buildx.
195-
docker buildx inspect multiplatform > /dev/null 2>&1 || docker buildx create --name multiplatform --use
196-
docker run --privileged --rm tonistiigi/binfmt --install all
197-
docker buildx inspect --bootstrap
198-
199195
$(IMAGE_BUILD_CMD) -t $(IMAGE_TAG) \
200196
--platform=$(PLATFORMS) \
201197
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
202198
--build-arg BUILDER_IMAGE=$(BUILDER_IMAGE) \
203199
--build-arg COMMIT_SHA=${GIT_COMMIT_SHA} \
204200
--build-arg BUILD_REF=${BUILD_REF} \
205201
$(PUSH) \
202+
$(LOAD) \
206203
$(IMAGE_BUILD_EXTRA_OPTS) ./
207-
docker pull $(IMAGE_TAG)
204+
205+
.PHONY: multi-platform-init
206+
multi-platform-init: ## Set up Docker Buildx for multi-platform builds.
207+
@docker buildx inspect multiplatform >/dev/null 2>&1 || docker buildx create --name multiplatform --use
208+
@docker run --privileged --rm tonistiigi/binfmt --install all
209+
@docker buildx inspect --bootstrap
208210

209211
.PHONY: image-push
210212
image-push: PUSH=--push ## Build the EPP image and push it to $IMAGE_REPO.
211-
image-push: image-build
213+
image-push: PLATFORMS=linux/amd64,linux/arm64
214+
image-push: multi-platform-init image-build
212215

213216
.PHONY: image-load
214217
image-load: LOAD=--load ## Build the EPP image and load it in the local Docker registry.

0 commit comments

Comments
 (0)