Skip to content

Commit

Permalink
feat: add multiarch docker image support (#216)
Browse files Browse the repository at this point in the history
Modify .goreleaser.yml file to build two images one for amd64 and
another for arm64 and then create the proper manifest to publish
with the proper images.

Closes #215

Signed-off-by: Jonathan Gonzalez V <[email protected]>
  • Loading branch information
sxd authored Jul 19, 2022
1 parent a6470c4 commit cc4fe39
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ jobs:
with:
go-version: 1.17

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: Login docker.io
run: docker login -u celfring -p ${{ secrets.DOCKER_TOKEN }}

Expand Down
35 changes: 32 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,39 @@ changelog:

dockers:
- dockerfile: build/Dockerfile
use: buildx
goos: linux
goarch: amd64
build_flag_templates:
- "--platform=linux/amd64"
image_templates:
- "getwoke/woke:latest"
- "getwoke/woke:{{ .Major }}.{{ .Minor }}"
- "getwoke/woke:{{ .RawVersion }}"
- "getwoke/woke:latest-amd64"
- "getwoke/woke:{{ .Major }}.{{ .Minor }}-amd64"
- "getwoke/woke:{{ .RawVersion }}-amd64"
- dockerfile: build/Dockerfile
use: buildx
goos: linux
goarch: arm64
build_flag_templates:
- "--platform=linux/arm64"
image_templates:
- "getwoke/woke:latest-arm64"
- "getwoke/woke:{{ .Major }}.{{ .Minor }}-arm64"
- "getwoke/woke:{{ .RawVersion }}-arm64"

docker_manifests:
- name_template: getwoke/woke:latest
image_templates:
- "getwoke/woke:latest-amd64"
- "getwoke/woke:latest-arm64"
- name_template: getwoke/woke:{{ .Major }}.{{ .Minor }}
image_templates:
- "getwoke/woke:{{ .Major }}.{{ .Minor }}-amd64"
- "getwoke/woke:{{ .Major }}.{{ .Minor }}-arm64"
- name_template: getwoke/woke:{{ .RawVersion }}
image_templates:
- "getwoke/woke:{{ .RawVersion }}-amd64"
- "getwoke/woke:{{ .RawVersion }}-arm64"

brews:
- tap:
Expand Down

0 comments on commit cc4fe39

Please sign in to comment.