Skip to content

Commit 97f4cda

Browse files
authored
Release multi-arch images. (#214)
Update release images to support amd64 and arm. Note: we also pin the `push` target to docker, since podman and docker use different flags for multi-arch support. Context: I saw that we hadn't released a new docker image, tried to build it, and noticed that the image I built on my mac didn't work on my k8s cluster.
1 parent 53e7b3a commit 97f4cda

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ifeq ($(CONTAINER_RUNTIME),)
1010
$(error No container runtime found. Please install podman or docker)
1111
endif
1212

13+
PLATFORM ?= linux/amd64,linux/arm64
14+
1315
GIT_COMMIT_SHORT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
1416

1517
# Container image configuration.
@@ -55,8 +57,19 @@ build:
5557

5658
.PHONY: push
5759
push:
60+
# Note: use docker rather than $(CONTAINER_RUNTIME), since we want to push
61+
# multi-arch images, and docker and podman use different multi-arch flags.
5862
@echo "Pushing container image: $(IMAGE_FULL)"
59-
$(CONTAINER_RUNTIME) push $(IMAGE_FULL)
63+
docker buildx build \
64+
--platform $(PLATFORM) \
65+
--file Containerfile \
66+
--build-arg GO_CONTAINER_IMAGE=$(GO_CONTAINER_IMAGE) \
67+
--build-arg VERSION=$(VERSION) \
68+
--annotation org.opencontainers.image.description='Oxide Cloud Controller Manager' \
69+
--annotation org.opencontainers.image.source=https://github.com/oxidecomputer/oxide-cloud-controller-manager \
70+
--tag $(IMAGE_FULL) \
71+
--push \
72+
.
6073

6174
.PHONY: helm-set-version
6275
helm-set-version:

0 commit comments

Comments
 (0)