Skip to content

Commit

Permalink
build docker image in multiarch
Browse files Browse the repository at this point in the history
  • Loading branch information
choffmeister committed Nov 22, 2021
1 parent f658840 commit d4b1ebe
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ jobs:
- uses: actions/setup-go@v2
with:
go-version: 1.17.x
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
with:
registry: https://ghcr.io
registry: ghcr.io
username: choffmeister
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
Expand Down
33 changes: 24 additions & 9 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,32 @@ builds:
goarch:
- amd64
- arm64
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
dockers:
- image_templates:
- "ghcr.io/choffmeister/{{ .ProjectName }}:{{ .Tag }}"
- "ghcr.io/choffmeister/{{ .ProjectName }}:latest"
- "ghcr.io/choffmeister/{{ .ProjectName }}:{{ .Version }}-amd64"
- "ghcr.io/choffmeister/{{ .ProjectName }}:latest-amd64"
use: buildx
goarch: amd64
dockerfile: Dockerfile
build_flag_templates:
- "--platform=linux/amd64"
- image_templates:
- "ghcr.io/choffmeister/{{ .ProjectName }}:{{ .Version }}-arm64v8"
- "ghcr.io/choffmeister/{{ .ProjectName }}:latest-arm64v8"
use: buildx
goarch: arm64
dockerfile: Dockerfile
build_flag_templates:
- "--platform=linux/arm64/v8"
docker_manifests:
- name_template: ghcr.io/choffmeister/{{ .ProjectName }}:{{ .Version }}
image_templates:
- ghcr.io/choffmeister/{{ .ProjectName }}:{{ .Version }}-amd64
- ghcr.io/choffmeister/{{ .ProjectName }}:{{ .Version }}-arm64v8
- name_template: ghcr.io/choffmeister/{{ .ProjectName }}:latest
image_templates:
- ghcr.io/choffmeister/{{ .ProjectName }}:latest-amd64
- ghcr.io/choffmeister/{{ .ProjectName }}:latest-arm64v8
checksum:
name_template: 'checksums.txt'
snapshot:
Expand Down

0 comments on commit d4b1ebe

Please sign in to comment.