add Makefile: multi-arch build-push (amd64+arm64) for the mixed k8s cluster
The single-arch image crashed with 'exec format error' on arm64 nodes. This codifies the podman multi-arch manifest build so future pushes stay multi-arch.
This commit is contained in:
16
Makefile
Normal file
16
Makefile
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
IMAGE := edenic-exporter
|
||||||
|
REGISTRY := mysources.co.uk
|
||||||
|
REGISTRY_IMAGE := $(REGISTRY)/michal/$(IMAGE)
|
||||||
|
# The k8s cluster is mixed amd64+arm64 — the registry image MUST be a multi-arch
|
||||||
|
# manifest list, or pods on the "other" arch crash with `exec format error`.
|
||||||
|
PLATFORMS := linux/amd64,linux/arm64
|
||||||
|
MANIFEST := edenic-exporter-mm
|
||||||
|
|
||||||
|
.PHONY: build-push
|
||||||
|
# Log in once first (GITEA_TOKEN):
|
||||||
|
# echo "$$GITEA_TOKEN" | podman login mysources.co.uk -u michal --password-stdin
|
||||||
|
build-push:
|
||||||
|
-podman manifest rm $(MANIFEST) 2>/dev/null
|
||||||
|
podman build --platform $(PLATFORMS) --manifest $(MANIFEST) .
|
||||||
|
podman manifest push --all $(MANIFEST) docker://$(REGISTRY_IMAGE):latest
|
||||||
|
podman manifest inspect docker://$(REGISTRY_IMAGE):latest | grep architecture
|
||||||
Reference in New Issue
Block a user