Skip to content

Commit 72891f9

Browse files
authored
chore(build/release): add multi-arch support for counter demo images v2 (#72)
- Updated .goreleaser.yaml to build and publish for amd64 and arm64 - Configured multi-arch Docker manifests for both normal and debian-slim images - Added a new `release` target in the Makefile for easier build/publish flow --- Did you sign your commit? [Instructions](https://github.com/kumahq/.github/blob/main/CONTRIBUTING.md#sign-your-commits): 👍 Have you read [Contributing guidelines](https://github.com/kumahq/.github/blob/main/CONTRIBUTING.md)?: 👍 --------- Signed-off-by: Bart Smykla <bartek@smykla.com>
1 parent 915e204 commit 72891f9

File tree

3 files changed

+84
-8
lines changed

3 files changed

+84
-8
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
14+
- name: Set up QEMU
15+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
16+
- name: Set up Docker Buildx
17+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
1418
- uses: actions/setup-go@v5
1519
with:
1620
go-version-file: go.mod

.goreleaser.yaml

Lines changed: 76 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,31 +44,99 @@ changelog:
4444
- '^test:'
4545

4646
dockers:
47-
- id: demo-app
47+
- id: demo-app-amd64
48+
use: buildx
49+
goarch: amd64
4850
image_templates:
49-
- ghcr.io/kumahq/kuma-counter-demo:{{ .Tag }}
50-
- ghcr.io/kumahq/kuma-counter-demo:{{ .Major }}
51-
- ghcr.io/kumahq/kuma-counter-demo:latest
51+
- ghcr.io/kumahq/kuma-counter-demo:{{ .Tag }}-amd64
52+
- ghcr.io/kumahq/kuma-counter-demo:{{ .Major }}-amd64
53+
- ghcr.io/kumahq/kuma-counter-demo:latest-amd64
5254
dockerfile: ./app/Dockerfile
5355
build_flag_templates:
56+
- "--pull"
5457
- "--label=org.opencontainers.image.source=https://github.com/kumahq/kuma-counter-demo"
5558
- "--label=org.opencontainers.image.created={{.Date}}"
5659
- "--label=org.opencontainers.image.title={{.ProjectName}}"
5760
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
5861
- "--label=org.opencontainers.image.version={{.Version}}"
59-
- id: demo-app-debian-slim
62+
- "--platform=linux/amd64"
63+
- id: demo-app-arm64
64+
use: buildx
65+
goarch: arm64
6066
image_templates:
61-
- ghcr.io/kumahq/kuma-counter-demo:{{ .Tag }}-debian-slim
62-
- ghcr.io/kumahq/kuma-counter-demo:{{ .Major }}-debian-slim
63-
- ghcr.io/kumahq/kuma-counter-demo:debian-slim
67+
- ghcr.io/kumahq/kuma-counter-demo:{{ .Tag }}-arm64
68+
- ghcr.io/kumahq/kuma-counter-demo:{{ .Major }}-arm64
69+
- ghcr.io/kumahq/kuma-counter-demo:latest-arm64
6470
dockerfile: ./app/Dockerfile
6571
build_flag_templates:
72+
- "--pull"
73+
- "--label=org.opencontainers.image.source=https://github.com/kumahq/kuma-counter-demo"
74+
- "--label=org.opencontainers.image.created={{.Date}}"
75+
- "--label=org.opencontainers.image.title={{.ProjectName}}"
76+
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
77+
- "--label=org.opencontainers.image.version={{.Version}}"
78+
- "--platform=linux/arm64"
79+
80+
- id: demo-app-debian-slim-amd64
81+
use: buildx
82+
goarch: amd64
83+
image_templates:
84+
- ghcr.io/kumahq/kuma-counter-demo:{{ .Tag }}-debian-slim-amd64
85+
- ghcr.io/kumahq/kuma-counter-demo:{{ .Major }}-debian-slim-amd64
86+
- ghcr.io/kumahq/kuma-counter-demo:debian-slim-amd64
87+
dockerfile: ./app/Dockerfile
88+
build_flag_templates:
89+
- "--pull"
6690
- "--label=org.opencontainers.image.source=https://github.com/kumahq/kuma-counter-demo"
6791
- "--label=org.opencontainers.image.created={{.Date}}"
6892
- "--label=org.opencontainers.image.title={{.ProjectName}}"
6993
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
7094
- "--label=org.opencontainers.image.version={{.Version}}"
7195
- "--build-arg=BASE_IMAGE=debian:12.8-slim"
96+
- "--platform=linux/amd64"
97+
- id: demo-app-debian-slim-arm64
98+
use: buildx
99+
goarch: arm64
100+
image_templates:
101+
- ghcr.io/kumahq/kuma-counter-demo:{{ .Tag }}-debian-slim-arm64
102+
- ghcr.io/kumahq/kuma-counter-demo:{{ .Major }}-debian-slim-arm64
103+
- ghcr.io/kumahq/kuma-counter-demo:debian-slim-arm64
104+
dockerfile: ./app/Dockerfile
105+
build_flag_templates:
106+
- "--pull"
107+
- "--label=org.opencontainers.image.source=https://github.com/kumahq/kuma-counter-demo"
108+
- "--label=org.opencontainers.image.created={{.Date}}"
109+
- "--label=org.opencontainers.image.title={{.ProjectName}}"
110+
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
111+
- "--label=org.opencontainers.image.version={{.Version}}"
112+
- "--build-arg=BASE_IMAGE=debian:12.8-slim"
113+
- "--platform=linux/arm64"
114+
115+
docker_manifests:
116+
- name_template: "ghcr.io/kumahq/kuma-counter-demo:{{ .Tag }}"
117+
image_templates:
118+
- ghcr.io/kumahq/kuma-counter-demo:{{ .Tag }}-amd64
119+
- ghcr.io/kumahq/kuma-counter-demo:{{ .Tag }}-arm64
120+
- name_template: "ghcr.io/kumahq/kuma-counter-demo:{{ .Major }}"
121+
image_templates:
122+
- ghcr.io/kumahq/kuma-counter-demo:{{ .Major }}-amd64
123+
- ghcr.io/kumahq/kuma-counter-demo:{{ .Major }}-arm64
124+
- name_template: "ghcr.io/kumahq/kuma-counter-demo:latest"
125+
image_templates:
126+
- ghcr.io/kumahq/kuma-counter-demo:latest-amd64
127+
- ghcr.io/kumahq/kuma-counter-demo:latest-arm64
128+
- name_template: "ghcr.io/kumahq/kuma-counter-demo:{{ .Tag }}-debian-slim"
129+
image_templates:
130+
- ghcr.io/kumahq/kuma-counter-demo:{{ .Tag }}-debian-slim-amd64
131+
- ghcr.io/kumahq/kuma-counter-demo:{{ .Tag }}-debian-slim-arm64
132+
- name_template: "ghcr.io/kumahq/kuma-counter-demo:{{ .Major }}-debian-slim"
133+
image_templates:
134+
- ghcr.io/kumahq/kuma-counter-demo:{{ .Major }}-debian-slim-amd64
135+
- ghcr.io/kumahq/kuma-counter-demo:{{ .Major }}-debian-slim-arm64
136+
- name_template: "ghcr.io/kumahq/kuma-counter-demo:debian-slim"
137+
image_templates:
138+
- ghcr.io/kumahq/kuma-counter-demo:debian-slim-amd64
139+
- ghcr.io/kumahq/kuma-counter-demo:debian-slim-arm64
72140

73141
release:
74142
draft: true

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ clean:
2727
.PHONY: all
2828
all: check build test run
2929

30+
.PHONY: release
31+
release:
32+
$(GORELEASER) release --clean
33+
3034
.PHONY: check
3135
check: tidy fmt lint
3236

0 commit comments

Comments
 (0)