Skip to content

Commit

Permalink
Update goreleaser to support multiarch docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilsbhat committed Dec 22, 2024
1 parent 826364a commit 6df4706
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This is an example .goreleaser.yml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
version: 2
before:
hooks:
# You may remove this if you don't use go modules.
Expand Down Expand Up @@ -31,16 +32,40 @@ builds:
binary: '{{ .ProjectName }}'

dockers:
- goos: linux
goarch: amd64
- use: buildx
ids:
- gocd-cli
dockerfile: Dockerfile
skip_push: false
image_templates:
- "ghcr.io/nikhilsbhat/gocd-cli:latest"
- "ghcr.io/nikhilsbhat/gocd-cli:{{ .Tag }}"
- "ghcr.io/nikhilsbhat/gocd-cli:{{ .Tag }}-{{ .Env.GOVERSION }}"
- use: buildx
ids:
- gocd-cli
dockerfile: Dockerfile
skip_push: false
image_templates:
- "ghcr.io/nikhilsbhat/gocd-cli:{{ .Tag }}-amd64"
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
- use: buildx
ids:
- gocd-cli
dockerfile: Dockerfile
skip_push: false
image_templates:
- "ghcr.io/nikhilsbhat/gocd-cli:{{ .Tag }}-arm64"
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"

docker_manifests:
- name_template: "ghcr.io/nikhilsbhat/gocd-cli:{{ .Tag }}"
image_templates:
- "ghcr.io/nikhilsbhat/gocd-cli:{{ .Tag }}-amd64"
- "ghcr.io/nikhilsbhat/gocd-cli:{{ .Tag }}-arm64"

archives:
- format: 'tar.gz'
Expand Down

0 comments on commit 6df4706

Please sign in to comment.