Skip to content

Commit d6be29c

Browse files
authored
chore(ci): build multiplatform Docker image (italia#218)
Build multi-platform Docker image (https://goreleaser.com/cookbooks/multi-platform-docker-images/#creating-multi-platform-docker-images-with-goreleaser), with arm64. Fix italia#201.
1 parent 15f878e commit d6be29c

File tree

2 files changed

+36
-3
lines changed

2 files changed

+36
-3
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ jobs:
1515
with:
1616
go-version: '1.23'
1717
id: go
18+
19+
# Needed to build multi-platform Docker images
20+
-
21+
name: Set up QEMU
22+
uses: docker/setup-qemu-action@v3
23+
-
24+
name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v3
26+
1827
-
1928
name: Checkout
2029
uses: actions/checkout@v2

.goreleaser.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,36 @@ changelog:
4949
- '^test:'
5050
dockers:
5151
-
52+
use: buildx
5253
goos: linux
5354
goarch: amd64
5455
ids:
5556
- publiccode-parser
56-
skip_push: false
5757
dockerfile: Dockerfile.goreleaser
5858
image_templates:
59-
- "italia/publiccode-parser-go:latest"
60-
- "italia/publiccode-parser-go:{{ .Tag }}"
59+
- "italia/publiccode-parser-go:{{ .Tag }}-amd64"
60+
build_flag_templates:
61+
- "--pull"
62+
- "--platform=linux/amd64"
63+
-
64+
use: buildx
65+
goos: linux
66+
goarch: arm64
67+
ids:
68+
- publiccode-parser
69+
dockerfile: Dockerfile.goreleaser
70+
image_templates:
71+
- "italia/publiccode-parser-go:{{ .Tag }}-arm64"
72+
build_flag_templates:
73+
- "--pull"
74+
- "--platform=linux/arm64"
75+
76+
docker_manifests:
77+
- name_template: "italia/publiccode-parser-go:latest"
78+
image_templates:
79+
- "italia/publiccode-parser-go:{{ .Tag }}-amd64"
80+
- "italia/publiccode-parser-go:{{ .Tag }}-arm64"
81+
- name_template: "italia/publiccode-parser-go:{{ .Tag }}"
82+
image_templates:
83+
- "italia/publiccode-parser-go:{{ .Tag }}-amd64"
84+
- "italia/publiccode-parser-go:{{ .Tag }}-arm64"

0 commit comments

Comments
 (0)