Skip to content

Commit

Permalink
Use multiarch docker build to support both amd64 and arm64 platforms.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbub committed Mar 17, 2021
1 parent 41af990 commit d411ce9
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 7 deletions.
41 changes: 34 additions & 7 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ builds:
- windows
goarch:
- amd64
- arm
- arm64
- 386
archives:
Expand All @@ -38,11 +39,37 @@ archives:
snapshot:
name_template: "SNAPSHOT-{{ .Commit }}"
dockers:
- skip_push: auto
goos: linux
goarch: amd64
ids:
- pgbouncer_exporter
image_templates:
- "jbub/pgbouncer_exporter:latest"
- image_templates:
- "jbub/pgbouncer_exporter:{{ .Tag }}"
dockerfile: Dockerfile
use_buildx: true
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- "--platform=linux/amd64"
- image_templates:
- "jbub/pgbouncer_exporter:{{ .Tag }}-arm64"
dockerfile: Dockerfile
use_buildx: true
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- "--platform=linux/arm64"
goarch: arm64
docker_manifests:
- name_template: 'jbub/pgbouncer_exporter:{{ .Tag }}'
image_templates:
- 'jbub/pgbouncer_exporter:{{ .Tag }}'
- 'jbub/pgbouncer_exporter:{{ .Tag }}-arm64'
- name_template: 'jbub/pgbouncer_exporter:latest'
image_templates:
- 'jbub/pgbouncer_exporter:{{ .Tag }}'
- 'jbub/pgbouncer_exporter:{{ .Tag }}-arm64'
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.9.1

* Use multiarch docker build to support both amd64 and arm64 platforms.

## 0.9.0

* Build with Go 1.16.
Expand Down

0 comments on commit d411ce9

Please sign in to comment.