Skip to content

Commit 460c9c9

Browse files
committed
feat: add multiarch support
Modify .goreleaser.yml file to build two images one for amd64 and another for arm64 and then create the proper manifest to publish with the proper images. Closes get-woke#215 Signed-off-by: Jonathan Gonzalez V <[email protected]>
1 parent a6470c4 commit 460c9c9

File tree

2 files changed

+42
-3
lines changed

2 files changed

+42
-3
lines changed

Diff for: .github/workflows/tag.yml

+10
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ jobs:
1818
with:
1919
go-version: 1.17
2020

21+
- name: Set up QEMU
22+
uses: docker/setup-qemu-action@v2
23+
with:
24+
image: tonistiigi/binfmt:qemu-v6.2.0
25+
platforms: "linux/amd64, linux/arm64"
26+
27+
- name: Set up Docker Buildx
28+
id: buildx
29+
uses: docker/setup-buildx-action@v2
30+
2131
- name: Login docker.io
2232
run: docker login -u celfring -p ${{ secrets.DOCKER_TOKEN }}
2333

Diff for: .goreleaser.yml

+32-3
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,39 @@ changelog:
5050

5151
dockers:
5252
- dockerfile: build/Dockerfile
53+
use: buildx
54+
goos: linux
55+
goarch: amd64
56+
build_flag_templates:
57+
- "--platform=linux/amd64"
5358
image_templates:
54-
- "getwoke/woke:latest"
55-
- "getwoke/woke:{{ .Major }}.{{ .Minor }}"
56-
- "getwoke/woke:{{ .RawVersion }}"
59+
- "getwoke/woke:latest-amd64"
60+
- "getwoke/woke:{{ .Major }}.{{ .Minor }}-amd64"
61+
- "getwoke/woke:{{ .RawVersion }}-amd64"
62+
- dockerfile: build/Dockerfile
63+
use: buildx
64+
goos: linux
65+
goarch: arm64
66+
build_flag_templates:
67+
- "--platform=linux/arm64"
68+
image_templates:
69+
- "getwoke/woke:latest-arm64"
70+
- "getwoke/woke:{{ .Major }}.{{ .Minor }}-arm64"
71+
- "getwoke/woke:{{ .RawVersion }}-arm64"
72+
73+
docker_manifests:
74+
- name_template: getwoke/woke:latest
75+
image_templates:
76+
- "getwoke/woke:latest-amd64"
77+
- "getwoke/woke:latest-arm64"
78+
- name_template: getwoke/woke:{{ .Major }}.{{ .Minor }}
79+
image_templates:
80+
- "getwoke/woke:{{ .Major }}.{{ .Minor }}-amd64"
81+
- "getwoke/woke:{{ .Major }}.{{ .Minor }}-arm64"
82+
- name_template: getwoke/woke:{{ .RawVersion }}
83+
image_templates:
84+
- "getwoke/woke:{{ .RawVersion }}-amd64"
85+
- "getwoke/woke:{{ .RawVersion }}-arm64"
5786

5887
brews:
5988
- tap:

0 commit comments

Comments
 (0)