@@ -23,7 +23,7 @@ SHELL = /usr/bin/env bash -o pipefail
2323
2424GIT_COMMIT_SHA ?= "$(shell git rev-parse HEAD 2>/dev/null) "
2525GIT_TAG ?= $(shell git describe --tags --dirty --always)
26- PLATFORMS ?= linux/amd64,linux/arm64
26+ PLATFORMS ?= linux/amd64
2727DOCKER_BUILDX_CMD ?= docker buildx
2828IMAGE_BUILD_CMD ?= $(DOCKER_BUILDX_CMD ) build
2929IMAGE_BUILD_EXTRA_OPTS ?=
@@ -181,23 +181,26 @@ image-local-load: image-local-build
181181
182182.PHONY : image-build
183183image-build : # # Build the EPP image using Docker Buildx.
184- docker buildx inspect multiplatform > /dev/null 2>&1 || docker buildx create --name multiplatform --use
185- docker run --privileged --rm tonistiigi/binfmt --install all
186- docker buildx inspect --bootstrap
187-
188184 $(IMAGE_BUILD_CMD ) -t $(IMAGE_TAG ) \
189185 --platform=$(PLATFORMS ) \
190186 --build-arg BASE_IMAGE=$(BASE_IMAGE ) \
191187 --build-arg BUILDER_IMAGE=$(BUILDER_IMAGE ) \
192188 --build-arg COMMIT_SHA=${GIT_COMMIT_SHA} \
193189 --build-arg BUILD_REF=${BUILD_REF} \
194190 $(PUSH ) \
191+ $(LOAD ) \
195192 $(IMAGE_BUILD_EXTRA_OPTS ) ./
196- docker pull $(IMAGE_TAG)
193+
194+ .PHONY : multi-platform-init
195+ multi-platform-init : # # Set up Docker Buildx for multi-platform builds.
196+ @docker buildx inspect multiplatform > /dev/null 2>&1 || docker buildx create --name multiplatform --use
197+ @docker run --privileged --rm tonistiigi/binfmt --install all
198+ @docker buildx inspect --bootstrap
197199
198200.PHONY : image-push
199201image-push : PUSH=--push # # Build the EPP image and push it to $IMAGE_REPO.
200- image-push : image-build
202+ image-push : PLATFORMS=linux/amd64,linux/arm64
203+ image-push : multi-platform-init image-build
201204
202205.PHONY : image-load
203206image-load : LOAD=--load # # Build the EPP image and load it in the local Docker registry.
0 commit comments