Skip to content

Commit 5d23360

Browse files
authored
Merge pull request #99 from planetscale/joem/goreleaser-multi-arch-docker-manifest
docker: fix arm64 image and generate multiarch manifests
2 parents 16fdb9c + c00bf2d commit 5d23360

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

.goreleaser.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ release:
8686
dockers:
8787
# primary docker image for amd64 arch
8888
- dockerfile: Dockerfile
89+
use: buildx
90+
build_flag_templates:
91+
- "--pull"
92+
- "--platform=linux/amd64"
8993
ids:
9094
- ghcommit
9195
goos: linux
@@ -98,6 +102,10 @@ dockers:
98102
- "ghcr.io/planetscale/ghcommit:latest"
99103
# build a docker image for arm64 arch
100104
- dockerfile: Dockerfile
105+
use: buildx
106+
build_flag_templates:
107+
- "--pull"
108+
- "--platform=linux/arm64"
101109
ids:
102110
- ghcommit
103111
goos: linux
@@ -109,4 +117,25 @@ dockers:
109117
- "ghcr.io/planetscale/ghcommit:v{{ .Major }}.{{ .Minor }}-arm64"
110118
- "ghcr.io/planetscale/ghcommit:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}-arm64"
111119
- "ghcr.io/planetscale/ghcommit:latest-arm64"
112-
# TODO: generate multi-arch docker image manifests
120+
121+
# use `docker_manifests` section to create combined multi-arch image manifests:
122+
docker_manifests:
123+
- name_template: "ghcr.io/planetscale/ghcommit:{{ .Tag }}"
124+
image_templates:
125+
- "ghcr.io/planetscale/ghcommit:{{ .Tag }}-amd64"
126+
- "ghcr.io/planetscale/ghcommit:{{ .Tag }}-arm64"
127+
128+
- name_template: "ghcr.io/planetscale/ghcommit:v{{ .Major }}"
129+
image_templates:
130+
- "ghcr.io/planetscale/ghcommit:v{{ .Major }}-amd64"
131+
- "ghcr.io/planetscale/ghcommit:v{{ .Major }}-arm64"
132+
133+
- name_template: "ghcr.io/planetscale/ghcommit:v{{ .Major }}.{{ .Minor }}"
134+
image_templates:
135+
- "ghcr.io/planetscale/ghcommit:v{{ .Major }}.{{ .Minor }}-amd64"
136+
- "ghcr.io/planetscale/ghcommit:v{{ .Major }}.{{ .Minor }}-arm64"
137+
138+
- name_template: "ghcr.io/planetscale/ghcommit:latest"
139+
image_templates:
140+
- "ghcr.io/planetscale/ghcommit:latest-amd64"
141+
- "ghcr.io/planetscale/ghcommit:latest-arm64"

0 commit comments

Comments
 (0)