Skip to content

Commit 779bf18

Browse files
committed
added multi-arch container image build
1 parent 30c1330 commit 779bf18

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

.goreleaser.yml

+26-2
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,25 @@ dockers:
2626
ids:
2727
- gnmic
2828
image_templates:
29-
- "ghcr.io/openconfig/gnmic:latest"
30-
- 'ghcr.io/openconfig/gnmic:{{ replace .Version "v" ""}}'
29+
- &amd64_latest_image "ghcr.io/openconfig/gnmic:latest-amd64"
30+
- &amd64_versioned_image 'ghcr.io/openconfig/gnmic:{{ replace .Version "v" ""}}-amd64'
3131
dockerfile: goreleaser-alpine.dockerfile
3232
skip_push: false
33+
use: buildx
34+
build_flag_templates:
35+
- "--platform=linux/amd64"
36+
- goos: linux
37+
goarch: arm64
38+
ids:
39+
- gnmic
40+
image_templates:
41+
- &arm64_latest_image "ghcr.io/openconfig/gnmic:latest-arm64"
42+
- &arm64_versioned_image 'ghcr.io/openconfig/gnmic:{{ replace .Version "v" ""}}-arm64'
43+
dockerfile: goreleaser-alpine.dockerfile
44+
skip_push: false
45+
use: buildx
46+
build_flag_templates:
47+
- "--platform=linux/arm64"
3348
- goos: linux
3449
goarch: amd64
3550
ids:
@@ -39,6 +54,15 @@ dockers:
3954
- 'ghcr.io/openconfig/gnmic:{{ replace .Version "v" ""}}-scratch'
4055
dockerfile: goreleaser-scratch.dockerfile
4156
skip_push: false
57+
docker_manifests:
58+
- name_template: 'ghcr.io/openconfig/gnmic:{{ replace .Version "v" "" }}'
59+
image_templates:
60+
- *amd64_versioned_image
61+
- *arm64_versioned_image
62+
- name_template: "{{- if not .IsSnapshot}}ghcr.io/openconfig/gnmic:latest{{- end}}"
63+
image_templates:
64+
- *amd64_latest_image
65+
- *arm64_latest_image
4266
archives:
4367
- name_template: >-
4468
{{ .ProjectName }}_

0 commit comments

Comments
 (0)